Esempio n. 1
0
  ====================*/
// ログアウト処理
if (isset($_GET['logout']) && $_GET['logout'] == 'logout') {
    $_SESSION = array();
    if (!empty($_GET['return_uri'])) {
        header('Location: ' . $_GET['return_uri']);
        exit;
    }
}
// ログイン処理
if (isset($_POST['mode'])) {
    if ($_POST['mode'] == 'login') {
        $_username = strval($_POST['username']);
        $_password = strval($_POST['password']);
        $_hashedPassword = hashconv($_password, false, SECURE_SALT);
        $loginValue = $login->login($_username, $_hashedPassword);
        $assets['result'] = $loginValue;
        if ($loginValue > 0) {
            $_SESSION['login'] = '******';
            if ($loginValue == 9) {
                $_SESSION['managerlogin'] = 1;
            } else {
                $_SESSION['managerlogin'] = 0;
            }
            if (!empty($_POST['return_uri'])) {
                header('Location: ' . $_POST['return_uri']);
                exit;
            } else {
                header('Location: top.php');
                exit;
            }