Exemplo n.º 1
0
if ($size == false) {
    header("HTTP/1.0 404 Not Found");
    include __DIR__ . "/private/page/404.page.php";
    exit;
}
$allowed = array("image/gif", "image/jpeg", "image/png");
$supported = false;
foreach ($allowed as $mime) {
    if (strcmp($mime, $size["mime"]) == 0) {
        $supported = true;
    }
}
if (!$supported) {
    header("HTTP/1.0 404 Not Found");
    include __DIR__ . "/private/page/404.page.php";
    exit;
}
if (!util_empty(conf_read("piwikurl")) && !util_empty(conf_read("piwiksiteid")) && !secu_isloged()) {
    include __DIR__ . "/private/api/PiwikTracker.php";
    PiwikTracker::$URL = conf_read("piwikurl");
    $piwikTracker = new PiwikTracker($idSite = intval(conf_read("piwiksiteid")));
    $piwikTracker->doTrackPageView($req . " (" . $size["mime"] . ")");
}
error_reporting(0);
ob_start();
ob_clean();
ob_start("ob_gzhandler");
header("Content-Type: " . $size["mime"]);
ob_end_flush();
readfile($file);
exit;
Exemplo n.º 2
0
<?php

/**
 * Spic <https://github.com/ricain/spic>
 * @author Jean Mercadier <jmercadier.fr>
 * @license The MIT License
 */
require_once __DIR__ . "/../private/lib/secu.lib.php";
require_once __DIR__ . "/../private/lib/dir.lib.php";
require_once __DIR__ . "/../private/lib/ajax.lib.php";
require_once __DIR__ . "/../private/lib/util.lib.php";
util_define_timezone();
$resp = array();
if (isset($_POST["resend"])) {
    $resp["resend"] = $_POST["resend"];
}
if (!secu_isloged() && (!isset($_POST["pass"]) || !secu_login($_POST["pass"]))) {
    echo ajax_format($resp, "wrong password.");
    exit;
}
$resp["list"] = dir_list();
echo ajax_format($resp);
Exemplo n.º 3
0
<?php

/**
 * Spic <https://github.com/ricain/spic>
 * @author Jean Mercadier <jmercadier.fr>
 * @license The MIT License
 */
require_once __DIR__ . "/../lib/conf.lib.php";
require_once __DIR__ . "/../lib/util.lib.php";
if (secu_isloged()) {
    header("Location: .");
    exit;
}
$err = "";
if (util_empty(conf_read("password"))) {
    $err = "Password not set.";
} else {
    if (isset($_POST["pass"])) {
        if (secu_login($_POST["pass"])) {
            header("Location: .");
            exit;
        }
        $err = "Bad password.";
    }
}
$brand = conf_read("brandname");
if (util_empty($brand)) {
    $brand = "Spic";
}
$welcometext = conf_read("wellcometext");
$col = conf_read("color");