/** * Tests if checkboxes were checked on submission of the initial pref wizard page * * @return boolean true if no checkboxes were checked, false otherwise */ function initNoChecks() { if (isset($_POST['next']) && !is_array($_POST['pref_wiz'])) return true; return false; } //START OF PROCESSING if ($_POST['set_default']) { $temp_prefs = assignDefaultPrefs(); assign_session_prefs($temp_prefs); save_prefs(); 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);
if (isset($_POST['submit'])) { if (isset($_POST['hide_feedback']) && $_POST['hide_feedback'] < 0) { $msg->addError("FEEDBACK_AUTOHIDE_NEGATIVE_VALUE"); header('Location: preferences.php?current_tab=' . $current_tab); exit; } //copy posted variables to a temporary array $temp_prefs = assignPostVars(); //email notification and auto-login settings are handled //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'];