sql->db_Update("user", "user_name=user_loginname"); $emessage->add(PRFLAN_157); } /* 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'] = 0; } // 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' => 30, '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']); $prefChanges = array(); 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']; if($value > $pref_limits[$key]['max']) $value = $pref_limits[$key]['max']; } else { $value = $pref_limits[$key]['default']; } $newValue = $value; } else { $newValue = $tp->toDB($value); } if($newValue != $pref[$key]) { // Changed value $pref[$key] = $newValue; $prefChanges[$key] = $newValue; } } if(count($prefChanges)) { // Values have changed $e107cache->clear('', TRUE); $saved = save_prefs(); $logStr = ''; foreach($prefChanges as $k => $v) { $logStr .= "[!br!]{$k} => {$v}"; } $admin_log->log_event('PREFS_01', PRFLAN_195.$logStr, ''); $e107->sql->db_Select_gen("TRUNCATE ".MPREFIX."online"); } if($saved) { /*$emessage->addSession(PRFLAN_106, E_MESSAGE_SUCCESS); header("location:".e_ADMIN."prefs.php?u"); exit();*/ //no redirect, smarter form (remember last used tab $emessage->add(PRFLAN_106, E_MESSAGE_SUCCESS); } else { // done in class2: include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_admin.php'); $emessage->add(LAN_NO_CHANGE); } } 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]; } } } require_once (e_ADMIN."auth.php"); /* if(isset($message)) { $ns->tablerender("", "