コード例 #1
0
ファイル: login.php プロジェクト: renduples/alibtob
if (isset($_GET['action'])) {
    if ($_GET['action'] == "dereg") {
        usetcookie("admin", "");
        unset($_SESSION['last_adminer_time']);
    }
}
capt_check("capt_login_admin");
if (isset($_POST['do'])) {
    $do = trim($_POST['do']);
    if ($do == "login") {
        pb_submit_check('data');
        if (!empty($_POST['data']['username']) && !empty($_POST['data']['userpass'])) {
            $checked = false;
            $uname = $_POST['data']['username'];
            $upass = $_POST['data']['userpass'];
            $checked = $adminer->checkUserLogin($uname, $upass);
            if ($checked > 0) {
                pheader("Location:index.php");
            } else {
                setvar("LoginError", $adminer->error);
            }
        }
    }
}
$smarty->template_dir = "template/";
$smarty->setCompileDir("pb-admin" . DS);
if (!empty($arrTemplate)) {
    $smarty->assign($arrTemplate);
}
template("login");
exit;