get('timezone')) { $core_pref->set('timezone', 'GMT'); } $frm = e107::getForm(false, true); //enable inner tabindex counter $emessage = e107::getMessage(); $tp = e107::getParser(); /* RESET DISPLAY NAMES */ if(isset($_POST['submit_resetdisplaynames'])) { e107::getDb()->db_Update('user', 'user_name=user_loginname'); $emessage->add(PRFLAN_157); } //echo '
'; //var_dump($core_pref->getPref()); //echo ''; /* UPDATE PREFERENCES */ if(isset($_POST['updateprefs'])) { unset($_POST['updateprefs'], $_POST['sitelanguage']); $_POST['cookie_name'] = str_replace(array(" ", "."), "_", $_POST['cookie_name']); $_POST['cookie_name'] = preg_replace("#[^a-zA-Z0-9_]#", "", $_POST['cookie_name']); $_POST['siteurl'] = trim($_POST['siteurl']) ? trim($_POST['siteurl']) : SITEURL; $_POST['siteurl'] = substr($_POST['siteurl'], - 1) == "/" ? $_POST['siteurl'] : $_POST['siteurl']."/"; // If email verification or Email/Password Login Method - email address is required! if (($_POST['user_reg_veri'] == 1 || $_POST['allowEmailLogin'] == 1) && $_POST['disable_emailcheck']) { $_POST['disable_emailcheck'] = 0; $emessage->add(PRFLAN_211, E_MESSAGE_ERROR); } // Table of range checking values - min and max for numerics. Only do the important ones $pref_limits = array('loginname_maxlength' => array('min' => 10, 'max' => 100, 'default' => 30), 'displayname_maxlength' => array('min' => 5, 'max' => 100, 'default' => 15), 'antiflood_timeout' => array('min' => 3, 'max' => 300, 'default' => 10), 'signup_pass_len' => array('min' => 2, 'max' => 100, 'default' => 4) ); $pref['post_html'] = intval($_POST['post_html']); // This ensures the setting is reflected in set text $_POST['membersonly_exceptions'] = explode("\n",$_POST['membersonly_exceptions']); // FIXME - automate - pref model & validation handler $prefChanges = array(); $sessionRegenerate = false; foreach($_POST as $key => $value) { if(isset($pref_limits[$key])) { // Its a numeric value to check if(is_numeric($value)) { if($value < $pref_limits[$key]['min']) { $value = $pref_limits[$key]['min']; $emessage->addWarning(str_replace(array('--FIELD--','--VALUE--'),array($key,$value),PRFLAN_213)); } if($value > $pref_limits[$key]['max']) { $value = $pref_limits[$key]['max']; $emessage->addWarning(str_replace(array('--FIELD--','--VALUE--'),array($key,$value),PRFLAN_212)); } } else { $value = $pref_limits[$key]['default']; } $newValue = $value; } elseif('cookie_name' == $key && $core_pref->get($key) != $value) { // special case if(!preg_match('/^[\w\-]+$/', $value)) { $newValue = e_COOKIE; $emessage->addWarning(PRFLAN_219); } else { $newValue = $value; $sessionRegenerate = true; } } else { $newValue = $tp->toDB($value); } $core_pref->update($key, $newValue); /*if($newValue != $core_pref->get($key)) { // Changed value $core_pref->set($key, $newValue); $prefChanges[$key] = $newValue; }*/ } $core_pref->save(false); // special case, do session cleanup, logout, redirect to login screen if($sessionRegenerate) { // reset cookie cookie($core_pref->get('cookie_name'), $_COOKIE[e_COOKIE], (time() + 3600 * 24 * 30), e_HTTP, e107::getLanguage()->getCookieDomain()); cookie(e_COOKIE, null, null); // regenerate session $s = $_SESSION; e107::getSession()->destroy(); $session = new e_core_session(array('name' => $core_pref->get('cookie_name'))); $_SESSION = $s; } } if (plugInstalled('alt_auth')) { $authlist[] = "e107"; $handle = opendir(e_PLUGIN."alt_auth"); while($file = readdir($handle)) { if(preg_match("/^(.*)_auth\.php/", $file, $match)) { $authlist[] = $match[1]; } } } /* if(isset($message)) { $ns->tablerender("", "