Ejemplo n.º 1
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);
Ejemplo n.º 2
0
 * 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");
if (util_empty($col)) {
    $col = "#3A75BC";
}