Example #1
0
File: Init.php Project: hqd276/bigs
}
// Disable ALL magic_quote
ini_set("magic_quotes_runtime", 0);
if (get_magic_quotes_gpc()) {
    function stripslashes_deep($value)
    {
        $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);
        return $value;
    }
    $_REQUEST = array_map('stripslashes_deep', $_REQUEST);
    $_COOKIE = array_map('stripslashes_deep', $_COOKIE);
}
if (!ERROR_PAGE) {
    if (!User::is_login()) {
        if (isset($_COOKIE['suma_id']) && isset($_COOKIE['password'])) {
            User::check_cookie_login($_COOKIE['suma_id'], $_COOKIE['password']);
        } else {
            EClassApi::my_setcookie('eclass_id', "", TIME_NOW - 3600);
            EClassApi::my_setcookie('password', "", TIME_NOW - 3600);
        }
    } else {
        if (isset($_GET['login_as']) || isset($_GET['login_as_id'])) {
            if (User::is_admin()) {
                $user_id = (int) Url::get('login_as_id', 0);
                $user = array();
                if ($user_id) {
                    $user = User::getUser($user_id);
                } else {
                    $user_name = Url::get('login_as');
                    if ($user_name != '') {
                        $user = User::getByUserName($user_name);