function action_prefs() { global $Save, $referrer, $user, $rows, $cols, $days, $min, $auth, $hist; global $CookieName, $tzoff; if (!empty($Save)) { if (!empty($user)) { if (!validate_page($user)) { die(ACTION_ErrorNameMatch); } } ereg("([[:digit:]]*)", $rows, $result); if (($rows = $result[1]) <= 0) { $rows = 20; } ereg("([[:digit:]]*)", $cols, $result); if (($cols = $result[1]) <= 0) { $cols = 65; } if (strcmp($auth, "") != 0) { $auth = 1; } else { $auth = 0; } $value = "rows={$rows}&cols={$cols}&auth={$auth}"; if (strcmp($user, "") != 0) { $value = $value . "&user="******"") != 0) { $value = $value . "&days={$days}"; } if (strcmp($min, "") != 0) { $value = $value . "&min={$min}"; } if (strcmp($hist, "") != 0) { $value = $value . "&hist={$hist}"; } if (strcmp($tzoff, "") != 0) { $value = $value . "&tzoff={$tzoff}"; } setcookie($CookieName, $value, time() + 157680000, "/", ""); header("Location: {$referrer}"); } else { template_prefs(); } }
function action_prefs() { global $CookieName, $days, $ErrorNameMatch, $hist, $hotpages, $min, $nickname; global $referrer, $rows, $Save, $tzoff, $user; if (!empty($Save)) { if (!empty($user)) { if (!validate_page($user)) { die($ErrorNameMatch); } } // make sure the nickname is not a valid username if (posix_getpwnam($nickname) !== false) { $referrer = '?action=prefs&invalid_nick=' . rawurlencode($nickname) . '&prefs_from=' . rawurlencode($referrer); $nickname = ''; } ereg("([[:digit:]]*)", $rows, $result); if (($rows = $result[1]) <= 0) { $rows = 20; } $hotpages = strcmp($hotpages, "") != 0 ? 1 : 0; $value = "rows={$rows}&hotpages={$hotpages}"; if (strcmp($nickname, '') != 0) { $value .= "&nickname=" . rawurlencode(trim($nickname)); } if (strcmp($days, "") != 0) { $value = $value . "&days={$days}"; } if (strcmp($min, "") != 0) { $value = $value . "&min={$min}"; } if (strcmp($hist, "") != 0) { $value = $value . "&hist={$hist}"; } if (strcmp($tzoff, "") != 0) { $value = $value . "&tzoff={$tzoff}"; } setcookie($CookieName, $value, time() + 157680000, "/", ""); header("Location: {$referrer}"); } else { template_prefs(); } }