示例#1
0
     $_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()) {
    if (initNoChecks()) {
    	//TODO LAW add language
        $msg->addError("NO_BOXES_CHECKED");
示例#2
0
        //separately from other preferences
        $mnot = intval($_POST['mnot']);
        $auto_login = isset($_POST['auto']) ? $_POST['auto'] : NULL;
    } else {
        if (isset($_POST['set_default'])) {
            $temp_prefs = assignDefaultPrefs();
            $mnot = assignDefaultMnot();
            $auto_login = assignDefaultAutologin();
            unset($_POST);
        }
    }
    //save most preferences to session and db
    assign_session_prefs($temp_prefs);
    save_prefs();
    //update email notification and auto-login settings separately
    save_email_notification($mnot);
    $is_auto_login = isset($auto_login) ? setAutoLoginCookie($auto_login) : $is_auto_login;
    $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
    header('Location: preferences.php?current_tab=' . $current_tab);
    exit;
}
$member_id = $_SESSION['member_id'];
// Re-set selected desktop theme if the request is from a mobile device
// because now $_SESSION['prefs']['PREF_THEME'] == $_SESSION['prefs']['PREF_MOBILE_THEME'] instead of the desktop theme
// The code below re-assign $_SESSION['prefs']['PREF_THEME'] back to what it should be
if (is_mobile_device()) {
    $row = queryDB('SELECT * FROM %smembers WHERE member_id=%d', array(TABLE_PREFIX, $member_id), true);
    foreach (unserialize(stripslashes($row['preferences'])) as $pref_name => $value) {
        $desktop_theme = $pref_name == 'PREF_THEME' ? $value : $desktop_theme;
    }
} else {