$msg->addError('MAX_LOGIN_ATTEMPT');
 } else {
     if ($row['status'] == AT_STATUS_UNCONFIRMED) {
         $msg->addError('NOT_CONFIRMED');
     } else {
         if ($row && $row['status'] == AT_STATUS_DISABLED) {
             $msg->addError('ACCOUNT_DISABLED');
         } else {
             if (count($row) > 0) {
                 $_SESSION['valid_user'] = true;
                 $_SESSION['member_id'] = intval($row['member_id']);
                 $_SESSION['login'] = $row['login'];
                 if ($row['preferences'] == "") {
                     assign_session_prefs(unserialize(stripslashes($_config["pref_defaults"])), 1);
                 } else {
                     assign_session_prefs(unserialize(stripslashes($row['preferences'])), 1);
                 }
                 $_SESSION['is_guest'] = 0;
                 $_SESSION['lang'] = $row['language'];
                 $_SESSION['course_id'] = 0;
                 $now = date('Y-m-d H:i:s');
                 if ($auto_login == 1) {
                     $parts = parse_url($_base_href);
                     // update the cookie.. increment to another 2 days
                     $cookie_expire = time() + 172800;
                     // #4775, also look at pref_tab_functions.inc.php setAutoLoginCookie(). Same technique.
                     $saltedPassword = hash('sha512', $row['pass'] . hash('sha512', $now));
                     ATutor . setcookie('ATLogin', $this_login, $cookie_expire, $parts['path']);
                     ATutor . setcookie('ATPass', $saltedPassword, $cookie_expire, $parts['path']);
                 }
                 $_SESSION['first_login'] = false;
Example #2
0
     save_email_notification(assignDefaultMnot());
     setAutoLoginCookie(assignDefaultAutologin());
     unset($_POST);
     $_POST['set_default'] = 1;
     
     $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
}

unset($_SESSION['first_login']);
$is_auto_login = checkAutoLoginCookie();

if (isset($_POST['pref_index'])) {
    $last_pref_index = intVal($_POST['pref_index']);
    if ($last_pref_index >= 0) {
        $temp_prefs = assignPostVars();
        assign_session_prefs($temp_prefs);
        save_prefs();
        
        if (isset($_POST['mnot'])) save_email_notification(intval($_POST['mnot']));

        if (isset($_POST['auto'])) setAutoLoginCookie($_POST['auto']);        
    }
}

$savant->assign('lang_charset', $myLang->getCharacterSet());
$savant->assign('lang_code', $_SESSION['lang']);

// display initialization page IF
// first time loading pref wiz OR going from first pref page
// to initialize page via previous button OR submit checkboxes with none checked
if (isFirstLoad() || isReturnToInit() || initNoChecks()) {
Example #3
0
                $mail->Body = _AT('email_confirmation_message', SITE_NAME, $confirmation_link);
                $mail->Send();
            } else {
                // if en_id is set, automatically enroll into courses that links with en_id and go to "My Start Page"
                $member_id = $m_id;
                require AT_INCLUDE_PATH . 'html/auto_enroll_courses.inc.php';
                // update last_login
                $sql = "UPDATE %smembers \n\t\t\t           SET last_login=now(), creation_date=creation_date \n\t\t\t         WHERE member_id=%d";
                queryDB($sql, array(TABLE_PREFIX, $member_id));
                $msg->addFeedback(array(LOGIN_SUCCESS_AUTO_ENROLL, $course_names));
                // auto login
                $_SESSION['valid_user'] = true;
                $_SESSION['member_id'] = $m_id;
                $_SESSION['course_id'] = 0;
                $_SESSION['login'] = $_POST[login];
                assign_session_prefs(unserialize(stripslashes($_config[pref_defaults])), 1);
                $_SESSION['is_guest'] = 0;
                $_SESSION['lang'] = $_SESSION[lang];
                session_write_close();
                header('Location: ' . AT_BASE_HREF . 'bounce.php?course=' . $_POST['course']);
            }
            require AT_INCLUDE_PATH . 'header.inc.php';
            require AT_INCLUDE_PATH . 'footer.inc.php';
            exit;
        }
    } else {
        $_POST = array();
    }
}
function validate_enid($en_id)
{
 // the following config calculation
 if (is_mobile_device()) {
     $current_theme = $_SESSION['prefs']['PREF_THEME'];
 }
 // Calculates the actual default theme
 // set defaults with the $_config_defaults and overwrite them with what's defined in table `config`
 $pref_defaults = unserialize($_config_defaults['pref_defaults']);
 if (is_array(unserialize($_config['pref_defaults']))) {
     foreach (unserialize($_config['pref_defaults']) as $name => $value) {
         $pref_defaults[$name] = $value;
     }
 }
 // Save the desktop theme
 $desktop_theme = $pref_defaults['PREF_THEME'];
 // $_SESSION['prefs']['PREF_THEME'] is overwritten here into the desktop theme
 assign_session_prefs($pref_defaults);
 // restore the mobile theme
 if (is_mobile_device()) {
     $_SESSION['prefs']['PREF_THEME'] = $current_theme;
 }
 $sql = "SELECT value FROM %sconfig WHERE name='pref_inbox_notify'";
 $row_notify = queryDB($sql, array(TABLE_PREFIX), TRUE);
 if (count($row_notify) > 0) {
     $notify = $row_notify['value'];
 } else {
     $notify = $_config_defaults['pref_inbox_notify'];
 }
 $sql = "SELECT value FROM %sconfig WHERE name='pref_is_auto_login'";
 $row_is_auto_login = queryDB($sql, array(TABLE_PREFIX), TRUE);
 if (count($row_is_auto_login) > 0) {
     $auto_login = $row_is_auto_login["value"];