Exemple #1
0
function is_login()
{
    if ($_SESSION['login_in'] == 1 && $_SESSION['admin']) {
        if (time() - $_SESSION['login_time'] > 3600) {
            login_out();
        } else {
            $_SESSION['login_time'] = time();
            @session_regenerate_id();
        }
        return 1;
    } else {
        $_SESSION['admin'] = '';
        $_SESSION['admin_purview'] = '';
        $_SESSION['admin_id'] = '';
        $_SESSION['admin_time'] = '';
        $_SESSION['login_in'] = '';
        $_SESSION['login_time'] = '';
        $_SESSION['admin_ip'] = '';
        return 0;
    }
}
Exemple #2
0
    ob_clean();
    $img = MooAutoLoad('MooSeccode');
    $img->outCodeImage(100, 20, 4);
}
/***************************************   控制层(C)   ****************************************/
$name = MooGetGPC('h', 'string', 'G') == '' ? 'index' : MooGetGPC('h', 'string', 'G');
//允许的方法
$names = array('login', 'index', 'logout', 'logout_change_identify', 'seccode');
if (!in_array($name, $names)) {
    MooMessageAdmin('没有这个页面', 'index.php', 0);
}
switch ($name) {
    case 'login':
        login_login();
        break;
    case 'index':
        login_index();
        break;
    case 'logout':
        login_out();
        break;
    case 'logout_change_identify':
        logout_change_identify();
        break;
    case 'seccode':
        login_code();
        break;
    default:
        login_index();
        break;
}