get('timezone')) { $core_pref->set('timezone', 'UTC'); } $frm = e107::getForm(false, true); //enable inner tabindex counter $mes = e107::getMessage(); $tp = e107::getParser(); /* RESET DISPLAY NAMES */ if(isset($_POST['submit_resetdisplaynames'])) { e107::getDb()->db_Update('user', 'user_name=user_loginname'); $mes->addInfo(PRFLAN_157); } //echo '
';
//var_dump($core_pref->getPref());
//echo '
'; if (isset($_POST['testemail'])) { sendTest(); } /* 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; $mes->addError(PRFLAN_211); } // 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 $smtp_opts = array(); if(!empty($_POST['smtp_options'])) { switch (trim($_POST['smtp_options'])) { case 'smtp_ssl' : $smtp_opts[] = 'secure=SSL'; break; case 'smtp_tls' : $smtp_opts[] = 'secure=TLS'; break; case 'smtp_pop3auth' : $smtp_opts[] = 'pop3auth'; break; } if (!empty($_POST['smtp_keepalive'])) { $smtp_opts[] = 'keepalive'; } if (!empty($_POST['smtp_useVERP'])) { $smtp_opts[] = 'useVERP'; } $_POST['smtp_options'] = implode(',',$smtp_opts); unset($_POST['smtp_keepalive'],$_POST['smtp_useVERP']); // e107::getMessage()->addDebug(print_a($_POST['smtp_options'],true)); } $_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']; $mes->addWarning(str_replace(array('--FIELD--','--VALUE--'),array($key,$value),PRFLAN_213)); } if($value > $pref_limits[$key]['max']) { $value = $pref_limits[$key]['max']; $mes->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; $mes->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 (e107::isInstalled('alt_auth')) { $authlist[] = "e107"; $handle = opendir(e_PLUGIN."alt_auth"); while($file = readdir($handle)) { if(preg_match("/^(.*)_auth\.php/", $file, $match)) { $authlist[] = $match[1]; } } } function sendTest() { $log = e107::getAdminLog(); $mes = e107::getMessage(); if(trim($_POST['testaddress']) == '') { $mes->add(LAN_MAILOUT_19, E_MESSAGE_ERROR); $subAction = 'error'; } else { $mailheader_e107id = USERID; $pref = e107::pref('core'); $add = ($pref['mailer']) ? " (".strtoupper($pref['mailer']).") " : ' (PHP)'; if($pref['mailer'] == 'smtp') { $add .= "Port: ".varset($pref['smtp_port'],25); $add .= " - ".str_replace("secure=", "", $pref['smtp_options']); } $sendto = trim($_POST['testaddress']); $eml = array(); $eml['email_subject'] = LAN_MAILOUT_113." ".$add; $eml['email_sender_email'] = null; $eml['email_sender_name'] = null; $eml['email_replyto'] = null; $eml['email_replytonames'] = null; $eml['send_html'] = true; $eml['add_html_header'] = null; $eml['email_body'] = str_replace("[br]", "
", LAN_MAILOUT_114); $eml['email_attach'] = null; $eml['template'] = 'default'; $eml['e107_header'] = USERID; if (!e107::getEmail()->sendEmail($sendto, LAN_MAILOUT_189, $eml)) { $mes->addError(($pref['mailer'] == 'smtp') ? LAN_MAILOUT_67 : LAN_MAILOUT_106); } // if (!sendemail($sendto, LAN_MAILOUT_113." ".SITENAME.$add, str_replace("[br]", "\n", LAN_MAILOUT_114),LAN_MAILOUT_189)) // { // $mes->addError(($pref['mailer'] == 'smtp') ? LAN_MAILOUT_67 : LAN_MAILOUT_106); // } else { $mes->addSuccess(LAN_MAILOUT_81. ' ('.$sendto.')'); $log->log_event('MAIL_01',$sendto,E_LOG_INFORMATIVE,''); } } } /* if(e_QUERY == "u") { $ns->tablerender("", "
".PRFLAN_106."
"); } */ $handle = opendir(e_ADMIN.'includes/'); while($file = readdir($handle)) { if($file != "." && $file != "..") { $file = str_replace(".php", "", $file); $adminlist[] = $file; } } closedir($handle); $pref['membersonly_exceptions'] = implode("\n",$pref['membersonly_exceptions']); $text = "
".PRFLAN_1."
".$frm->text('sitename', $pref['sitename'], 100, 'required=1&size=xxlarge')."
".$frm->text('siteurl', $pref['siteurl'], 150, 'size=xxlarge')." ".($pref['siteurl'] == SITEURL ? "" : "
".PRFLAN_159.": ".SITEURL."
")."
"; /* ".$frm->radio('redirectsiteurl', 1, $pref['redirectsiteurl'], array('label'=>LAN_ENABLED))." ".$frm->radio('redirectsiteurl', 0, !$pref['redirectsiteurl'], array('label'=>LAN_DISABLED))." */ $text .= $frm->radio_switch('redirectsiteurl', $pref['redirectsiteurl'])."
".PRFLAN_135."
"; /* $parms = "name=sitebutton"; $parms .= "&path=".e_THEME.$pref['sitetheme']."/images/|".e_IMAGE; $parms .= "&filter=0"; $parms .= "&fullpath=1"; $parms .= "&default=".urlencode($pref['sitebutton']); //$parms .= "&width=128px"; //$parms .= "&height=128px"; $parms .= "&multiple=FALSE"; $parms .= "&label=-- No Image --"; $parms .= "&subdirs=1"; $parms .= "&tabindex=".$frm->getNext(); $text .= "
".$tp->parseTemplate("{IMAGESELECTOR={$parms}&scaction=select}")."
"; // $text .= "
".$frm->imagepicker('sitebutton',$pref['sitebutton'],'-- No Image --')."
"; //TODO make the preview update when image-picker is used. $text .= "
".$tp->parseTemplate("{IMAGESELECTOR={$parms}&scaction=preview}")."
"; $sLogo = siteinfo_shortcodes::sc_logo(); */ if(!empty($pref['sitebutton']) && strpos($pref['sitebutton'],'{')===false && file_exists(e_IMAGE.$pref['sitebutton'])) { $pref['sitebutton'] = '{e_IMAGE}'.$pref['sitebutton']; } $text .= $frm->imagepicker('sitebutton',$pref['sitebutton'],'','help='.PRFLAN_225); $text .= "
".$frm->imagepicker('sitelogo',$pref['sitelogo'],'','w=200&help='.PRFLAN_226)."
".$frm->textarea('sitetag', $tp->toForm($pref['sitetag']), 3, 59, array('size'=>'xxlarge'))."
".PRFLAN_227."
".$frm->textarea('sitedescription', $tp->toForm($pref['sitedescription']), 3, 80, array('size'=>'xxlarge'))."
".PRFLAN_228."
".$frm->textarea('sitedisclaimer',$tp->toForm( $pref['sitedisclaimer']), 3, 80, array('size'=>'xxlarge'))."
".PRFLAN_229."
".pref_submit('main')."
"; // Email and Contact Information -------------- $text .= "
".PRFLAN_13."
".$frm->text('siteadmin', SITEADMIN, 100, array('size'=>'xlarge'))."
".$frm->text('siteadminemail', SITEADMINEMAIL, 100, array('size'=>'xlarge'))."
".$frm->text('replyto_name', $pref['replyto_name'], 100, array('size'=>'xlarge'))."
".PRFLAN_175."
".$frm->text('replyto_email', $pref['replyto_email'], 100, array('size'=>'xlarge'))."
".PRFLAN_177."

".$frm->admin_button('testemail', LAN_MAILOUT_112,'other')." 

"; $text .= mailoutAdminClass::mailerPrefsTable($pref); $text .="
"; $emFormat = array( 'textonly' => LAN_MAILOUT_125, 'texthtml' => LAN_MAILOUT_126, 'texttheme' => LAN_MAILOUT_127 ); $text .= $frm->select('mail_sendstyle', $emFormat, vartrue($pref['mail_sendstyle'])); $text .= "
".$frm->textarea('sitecontactinfo', $pref['sitecontactinfo'], 6, 59, array('size'=>'xxlarge'))."
".PRFLAN_163."
".$e_userclass->uc_dropdown('sitecontacts', $pref['sitecontacts'], 'nobody,main,admin,classes', "tabindex='".$frm->getNext()."'")."
".PRFLAN_169."
".$e_userclass->uc_dropdown('contact_visibility', varset( $pref['contact_visibility'],e_UC_PUBLIC), null, "tabindex='".$frm->getNext()."'")."
Contact form will only be visible to this userclass group.
".$frm->textarea('contact_filter', $pref['contact_filter'], 5, 59, array('size'=>'xxlarge'))."
".PRFLAN_271."
"; /* ".$frm->radio('contact_emailcopy', 1, $pref['contact_emailcopy'])." ".$frm->label(LAN_ENABLED, 'contact_emailcopy', 1)."   ".$frm->radio('contact_emailcopy', 0, !$pref['contact_emailcopy'])." ".$frm->label(LAN_DISABLED, 'contact_emailcopy', 0)."
".PRFLAN_165."
*/ $text .= $frm->radio_switch('contact_emailcopy', $pref['contact_emailcopy'])."
".PRFLAN_165."
".pref_submit('email')."
"; $text .= "
".PRFLAN_13." "; if(function_exists("memory_get_usage")) { $text .= " "; } $text .= "
".$frm->radio_switch('displaythemeinfo', $pref['displaythemeinfo'])."
".$frm->radio_switch('displayrendertime', $pref['displayrendertime'])."
".$frm->radio_switch('displaysql', $pref['displaysql'])."
".$frm->radio_switch('display_memory_usage', $pref['display_memory_usage'])."
".pref_submit('display')."
"; // Admin Display Areas $text .= "
".PRFLAN_77." "; /**/ $text .= "
".$frm->radio_switch('admin_alerts_ok', $pref['admin_alerts_ok'])."
".PRFLAN_96."
".$frm->radio_switch('admin_alerts_uniquemenu', $pref['admin_alerts_uniquemenu'])."
".PRFLAN_98."
".PRFLAN_199." ".$frm->radio_switch('admin_slidedown_subs', $pref['admin_slidedown_subs'])."
".PRFLAN_200."
".$frm->radio_switch('admin_separate_plugins', $pref['admin_separate_plugins'])."
".PRFLAN_205."
".pref_submit('admindisp')."
"; // Date options. $ga = new convert(); $date1 = $ga->convert_date(time(), "short"); $date2 = $ga->convert_date(time(), "long"); $date3 = $ga->convert_date(time(), "forum"); $date4 = e107::getDate()->convert(time(),"input"); $text .= "
".PRFLAN_21." "; $def = strtotime('December 21, 2012 3:45pm'); $inputdate = array( // TODO add more formats "%A, %d %B, %Y" => strftime("%A, %d %B, %Y",$def), "%A, %d %b, %Y" => strftime("%A, %d %b, %Y",$def), "%a, %d %B, %Y" => strftime("%a, %d %B, %Y",$def), "%a, %d %b, %Y" => strftime("%a, %d %b, %Y",$def), "%A, %B %d, %Y" => strftime("%A, %B %d, %Y",$def), "%A, %b %d, %Y" => strftime("%A, %b %d, %Y",$def), "%A, %b %d, %y" => strftime("%A, %b %d, %y",$def), "%B %d, %Y" => strftime("%B %d, %Y",$def), "%b %d, %Y" => strftime("%b %d, %Y",$def), "%b %d, %y" => strftime("%b %d, %y",$def), "%d %B, %Y" => strftime("%d %B, %Y",$def), "%d %b, %Y" => strftime("%d %b, %Y",$def), "%d %b, %y" => strftime("%d %b, %y",$def), "%Y-%m-%d" => strftime("%Y-%m-%d",$def), "%d-%m-%Y" => strftime("%d-%m-%Y",$def), "%m/%d/%Y" => strftime("%m/%d/%Y",$def) ); $inputtime = array(); $inputtime["%I:%M %p"] = strftime("%I:%M %p",$def); if(e107::getDate()->supported('P')) { $inputtime["%I:%M %P"] = strftime("%I:%M %P",$def); } if(e107::getDate()->supported('l')) { $inputtime["%l:%M %p"] = strftime("%l:%M %p",$def); $inputtime["%l:%M %P"] = strftime("%l:%M %P",$def); } $inputtime["%H:%M"] = strftime("%H:%M",$def); $inputtime["%H:%M:%S"] = strftime("%H:%M:%S",$def); $text .= "
".$frm->text('shortdate', $pref['shortdate'], 50)."
".PRFLAN_83.": {$date1}
".$frm->text('longdate', $pref['longdate'], 50)."
".PRFLAN_83.": {$date2}
".$frm->text('forumdate', $pref['forumdate'], 50)."
".PRFLAN_83.": {$date3}
".PRFLAN_25." ".PRFLAN_93."
".$frm->select('inputdate',$inputdate, e107::getPref('inputdate')); $text .= $frm->select('inputtime',$inputtime, e107::getPref('inputtime')); $text .= "
".$frm->select_open('time_offset', 'class=tbox select time-offset');//use form handler because of the tabindex $toffset = array("-12", "-11", "-10", "-9", "-8", "-7", "-6", "-5", "-4", "-3", "-2", "-1", "0", "+1", "+2", "+3", "+4", "+5", "+6", "+7", "+8", "+9", "+10", "+11", "+12", "+13", "+14", "+15", "+16"); if(! isset($pref['time_offset'])) { $pref['time_offset'] = "0"; } //XXX TODO FIXME - Do we still need this? foreach($toffset as $o) { $text .= " ".$frm->option($o, $o, ($o == $pref['time_offset']))." "; } $timeZones = timezone_identifiers_list(); $text .= "
".PRFLAN_27."
".$frm->select('timezone', $timeZones, vartrue($pref['timezone'],'GMT'), 'useValues=1')."
".pref_submit('date')."
"; // =========== Registration Preferences. ================== $elements = array(1=> PRFLAN_259, 2=> PRFLAN_260, 0=>LAN_DISABLED); $text .= "
".PRFLAN_28." "; /* // Highly problematic. $text .= " "; */ $membersOnlyRedirectOptions = array( 'login'=>PRFLAN_264, 'splash'=>PRFLAN_265); $text .= "
".$frm->radio('user_reg', $elements, $pref['user_reg'])."
".PRFLAN_30."
".$frm->select_open('user_reg_veri', array('size'=>'xlarge')); $veri_list = array(PRFLAN_152,PRFLAN_31,PRFLAN_153); foreach($veri_list as $v => $v_title) { $text .= $frm->option($v_title, $v, ($pref['user_reg_veri'] == $v)); } $srch = array('[', ']'); $repl = array("", ''); $PRFLAN_154a = str_replace($srch,$repl, PRFLAN_154a); $text .= "
".$PRFLAN_154a."
".$frm->select_open('allowEmailLogin', array('size'=>'xlarge')); // $login_list = array(PRFLAN_201,PRFLAN_202,PRFLAN_203); $login_list = array( 2 => PRFLAN_203, 1 => PRFLAN_202, 0 => PRFLAN_201 ); foreach($login_list as $l => $l_title) { $text .= $frm->option($l_title, $l, ($pref['allowEmailLogin'] == $l)); } $text .= "
".$frm->radio_switch('signup_remote_emailcheck', $pref['signup_remote_emailcheck'])."
"; $memDisp = !vartrue($pref['membersonly_enabled']) ? "e-hideme" : ""; $text .= $frm->radio_switch('membersonly_enabled', $pref['membersonly_enabled'],'', '', 'class=e-expandit')."
".PRFLAN_59."
". $frm->select('membersonly_redirect',$membersOnlyRedirectOptions,$pref['membersonly_redirect'], array('size'=>'xxlarge'))."
".PRFLAN_266."
". $frm->textarea('membersonly_exceptions', $pref['membersonly_exceptions'], 3, 1, 'size=xxlarge&placeholder='.PRFLAN_206)."
".PRFLAN_207."
".$frm->radio_switch('autologinpostsignup', $pref['autologinpostsignup'])."
".PRFLAN_198."
".$frm->number('displayname_maxlength', $pref['displayname_maxlength'], 3)."
".$frm->number('loginname_maxlength', $pref['loginname_maxlength'], 3)."
".$frm->number('signup_pass_len', $pref['signup_pass_len'], 2)."
".$frm->number('signup_maxip', $pref['signup_maxip'], 3)."
".PRFLAN_78."
".pref_submit('registration')."
"; // Key registration // Signup options ===========================. $prefOptionPassword = (isset($pref['signup_option_password'])) ? $pref['signup_option_password'] : 2; $text .= "
".PRFLAN_19." "; /* */ $text .= " "; /* */ $text .= "
".PRFLAN_261." "; $signup_option_names = array( // "signup_option_loginname" => "Login Name", "signup_option_realname" => CUSTSIG_2, "signup_option_email_confirm" => CUSTSIG_21, "signup_option_image" => CUSTSIG_7, 'signup_option_customtitle' => CUSTSIG_20, 'signup_option_hideemail' => CUSTSIG_22, "signup_option_class" => CUSTSIG_17, "signup_option_signature" => CUSTSIG_6, ); foreach($signup_option_names as $value => $key) { $label_value = str_replace('_', '-', $value); $text .= " "; } $text .= "
".$frm->radio('disable_emailcheck', 2, ($pref['disable_emailcheck']==2), array('label' => CUSTSIG_12, 'disabled'=>true))." ".$frm->radio('disable_emailcheck', 1, (intval($pref['disable_emailcheck']) == 1), array('label' => CUSTSIG_14))." ".$frm->radio('disable_emailcheck', 0, (intval($pref['disable_emailcheck']) == 0), array('label' => CUSTSIG_15))."
".$frm->radio('signup_option_password', 0, !$prefOptionPassword, array('label' => CUSTSIG_12))." ".$frm->radio('signup_option_password', 1, ($prefOptionPassword == 1), array('label' => CUSTSIG_14, 'disabled'=>true))." ".$frm->radio('signup_option_password', 2, ($prefOptionPassword == 2), array('label' => CUSTSIG_15))."
".$frm->radio($value, 0, !$pref[$value], array('label' => CUSTSIG_12))." ".$frm->radio($value, 1, ($pref[$value] == 1), array('label' => CUSTSIG_14))." ".$frm->radio($value, 2, ($pref[$value] == 2), array('label' => CUSTSIG_15))."
".$frm->radio_switch('user_reg_secureveri', $pref['user_reg_secureveri'], CUSTSIG_12, CUSTSIG_14)."
".$frm->radio_switch('use_coppa', $pref['use_coppa'])."
".PRFLAN_46." ".PRFLAN_94."
". $pref['disable_emailcheck']."
".$frm->textarea('signup_text', $pref['signup_text'], 3, 80, array('size'=>'xxlarge'))."
".$frm->textarea('signup_text_after', $pref['signup_text_after'], 3, 80, array('size'=>'xxlarge'))."
".$frm->text('predefinedLoginName', $pref['predefinedLoginName'], 50)."
".PRFLAN_193."
".str_replace("[br]","
",PRFLAN_194)."
".$frm->tags('signup_disallow_text', $pref['signup_disallow_text'], 500)."
".CUSTSIG_19."
".$e_userclass->uc_dropdown('displayname_class', $pref['displayname_class'], 'nobody,member,admin,classes', "tabindex='".$frm->getNext()."'")." ".$frm->admin_button('submit_resetdisplaynames', PRFLAN_156, 'delete')."
".pref_submit('signup')."
"; // Custom Fields. /* text render options */ if(!isset($pref['post_html'])) { $pref['post_html'] = '250'; save_prefs(); } $text .= "
".PRFLAN_101." "; $replaceDisp = vartrue($pref['link_replace']) ? "" : "e-hideme"; $text .= " "; if(file_exists(e_PLUGIN."geshi/geshi.php")) { $text .= " "; } $text .= "
".$frm->radio_switch('make_clickable', $pref['make_clickable'])."
".PRFLAN_128."
".$frm->radio_switch('link_replace', $pref['link_replace'],'', '', 'expandit=1')."
".PRFLAN_103."
".$frm->text('link_text', $pref['link_text'], 200, 'placeholder='.PRFLAN_104)."
".PRFLAN_105."
". $frm->text('email_text', $tp->post_toForm($pref['email_text']), 200, 'placeholder='.PRFLAN_107)."
".PRFLAN_108."
".$frm->radio_switch('links_new_window', $pref['links_new_window'])."
".PRFLAN_146."
".$frm->radio_switch('profanity_filter', $pref['profanity_filter'])."
".PRFLAN_41."
".$frm->text('profanity_replace', $pref['profanity_replace'], 20)."
".$frm->tags('profanity_words', $pref['profanity_words'])."
".PRFLAN_44."
".$frm->number('main_wordwrap', $pref['main_wordwrap'], 3)."
".PRFLAN_110."
".$frm->number('menu_wordwrap', $pref['menu_wordwrap'], 3)."
".PRFLAN_110."
".$e_userclass->uc_dropdown('post_html', $pref['post_html'], 'nobody,public,member,admin,main,classes', "tabindex='".$frm->getNext()."'")."
".PRFLAN_117."
".r_userclass('post_script',$pref['post_script'],'off','nobody,member,admin,main,classes')."
".PRFLAN_216."
".$frm->userclass('inline_editing',$pref['inline_editing'],'off','nobody,admin,main,classes,no-excludes')."
".PRFLAN_269."
".$frm->radio_switch('filter_script', varset($pref['filter_script'], 1))."
".PRFLAN_218."
".$frm->radio_switch('html_abuse', varset($pref['html_abuse'], 1))."
".PRFLAN_221."
".$frm->radio_switch('wysiwyg', $pref['wysiwyg'])."
".PRFLAN_123."
".$frm->radio_switch('old_np', $pref['old_np'])."
".PRFLAN_125."
".$frm->radio_switch('useGeshi', $pref['useGeshi'])."
".str_replace("[link]", "http://qbnz.com/highlighter/", PRFLAN_119)."
".$frm->text('defaultLanGeshi', ($pref['defaultLanGeshi'] ? $pref['defaultLanGeshi'] : "php"), 20)."
".PRFLAN_121."
".pref_submit('textpost')."
"; function multi_radio($name, $textsVals, $currentval = '') { $ret = ''; $gap = ''; foreach($textsVals as $v => $t) { $sel = ($v == $currentval) ? " checked='checked'" : ""; $ret .= $gap." ".$t.""; $gap = "  "; } return $ret; } // Security Options. . $hasGD = extension_loaded("gd"); $text .= "
".PRFLAN_47." "; $secureImage = array('signcode'=>PRFLAN_76, 'logcode'=>PRFLAN_81, "fpwcode"=>PRFLAN_138,'admincode'=>PRFLAN_222); foreach($secureImage as $key=>$label) { $label = str_replace($srch,$repl,$label); $text .= "\n"; } /* $text .= " "; * */ $text .= " "; $pwdEncodeOpts = array(); if(function_exists('password_verify')) // ie. php 5.5 or higher { $pwdEncodeOpts[3] = "PHP Default (Preferred)"; } $pwdEncodeOpts[1] = PRFLAN_190; $pwdEncodeOpts[0] = PRFLAN_189; $text .= (isset($pwdEncodeOpts[3]) && $pref['passwordEncoding']!=3) ? ""; $CHAP_list = array(PRFLAN_180, PRFLAN_181, PRFLAN_182); $text .= "
".$frm->radio_switch('ssl_enabled', $pref['ssl_enabled'])."
".PRFLAN_61."
"; if($hasGD) { $text .= $frm->radio_switch($key, $pref[$key]); } else { $text .= PRFLAN_133; } $text .= "
".PRFLAN_223."
".PRFLAN_81.": "; if($hasGD) { $text .= $frm->radio_switch('logcode', $pref['logcode']); } else { $text .= PRFLAN_133; } $text .= "
".PRFLAN_138.": "; if($hasGD) { $text .= $frm->radio_switch('fpwcode', $pref['fpwcode']); } else { $text .= PRFLAN_133; } $text .= "
".$frm->radio_switch('disallowMultiLogin', $pref['disallowMultiLogin'], LAN_YES, LAN_NO)."
".PRFLAN_130."
".$frm->radio('user_tracking', array('cookie' => PRFLAN_49, 'session' => PRFLAN_50), $pref['user_tracking'])."
".$frm->text('cookie_name', $pref['cookie_name'], 20)."
".PRFLAN_263.".
" : ""; $text .= $frm->select('passwordEncoding', $pwdEncodeOpts, varset($pref['passwordEncoding'], 0)); // $text .= $frm->radio_switch('passwordEncoding', varset($pref['passwordEncoding'], 0), PRFLAN_190, PRFLAN_189); $text .= "
".$frm->select('password_CHAP',$CHAP_list,$pref['password_CHAP'] ); //." ".$frm->select_open('password_CHAP'); //TODO - user tracking session name - visible only if Cookie is enabled (JS) $text .= "
".PRFLAN_183."
".PRFLAN_179."
".$frm->radio_switch('antiflood1', $pref['antiflood1'])."
".$frm->number('antiflood_timeout', $pref['antiflood_timeout'], 3)."
".PRFLAN_38."
".$frm->select_open('autoban'); $autoban_list = array( PRFLAN_113, PRFLAN_144, PRFLAN_142, PRFLAN_143 ); foreach($autoban_list as $ab => $ab_title) { $sel = ($pref['autoban'] == $ab) ? "selected='selected'" : ""; $text .= " ".$frm->option($ab_title, $ab, ($pref['autoban'] == $ab))." "; } $text .= "
".PRFLAN_91."
".$frm->number('failed_login_limit', varset($pref['failed_login_limit'],10), 3, array('max'=>10, 'min'=>0))."
".PRFLAN_232."
".$frm->radio_switch('adminpwordchange', $pref['adminpwordchange'])."
".pref_submit('security')."
"; $text .= "
".PRFLAN_87."
".PRFLAN_161.": ".$frm->radio_switch('comments_disabled', $pref['comments_disabled'], LAN_NO, LAN_YES,array('reverse'=>1))."
".PRFLAN_32." ".$frm->radio_switch('anon_post', $pref['anon_post'], LAN_YES, LAN_NO)."
".PRFLAN_33."
".PRFLAN_89.": ".$frm->radio_switch('comments_icon', $pref['comments_icon'], LAN_YES, LAN_NO)."
".PRFLAN_88.": ".$frm->radio_switch('nested_comments', $pref['nested_comments'], LAN_YES, LAN_NO)."
".PRFLAN_90.": ".$frm->radio_switch('allowCommentEdit', $pref['allowCommentEdit'], LAN_YES, LAN_NO)."
".PRFLAN_166.": ".$frm->radio_switch('comments_emoticons', $pref['comments_emoticons'], LAN_YES, LAN_NO)."
".PRFLAN_233." ". $frm->uc_select('comments_moderate', $pref['comments_moderate'],"nobody,guest,new,bots,public,admin,main,classes"). "
".PRFLAN_234."
".PRFLAN_235." "; $comment_sort = array( "desc" => PRFLAN_236, //default 'asc' => PRFLAN_237 ); $text .= $frm->select('comments_sort',$comment_sort, $pref['comments_moderate'], array('size'=>'xlarge'))."
".PRFLAN_209."
".PRFLAN_208.": ".$e_userclass->uc_dropdown('email_item_class',varset($pref['email_item_class'],e_UC_MEMBER),'nobody,admin,main,public,member,classes', "tabindex='".$frm->getNext()."'")."
".pref_submit('comments')."
"; // File Uploads include_lan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_upload.php"); require_once(e_HANDLER."upload_handler.php"); $text .= "
".PRFLAN_238.""; $upload_max_filesize = ini_get('upload_max_filesize'); $post_max_size = ini_get('post_max_size'); $maxINI = min($upload_max_filesize,$post_max_size); if($maxINI < $pref['upload_maxfilesize']) { $text .= "
"; $text .= PRFLAN_239." ".$maxINI."
"; $pref['upload_maxfilesize'] = $maxINI; } $text .= "
".UPLLAN_25." ". $frm->radio_switch('upload_enabled', $pref['upload_enabled'], LAN_YES, LAN_NO) ."
".UPLLAN_26."
".UPLLAN_33."
". $frm->text('upload_maxfilesize', $pref['upload_maxfilesize'], 10) ."
".UPLLAN_34."
".UPLLAN_37." ".r_userclass("upload_class", $pref['upload_class'],"off","nobody,public,guest,member,admin,classes")."
".UPLLAN_38."
".PRFLAN_240." "; $fl = e107::getFile(); $data = $fl->getFiletypeLimits(); foreach($data as $k=>$v) { $text .= ""; } // $text .= print_a($data,true); $text .= "
".LAN_TYPE."".UPLLAN_33."
".$k." ".$fl->file_size_encode($v)."
".PRFLAN_241." ".str_replace("../",'',e_SYSTEM).e_READ_FILETYPES."
".pref_submit('uploads'); $text .= "
"; // Javascript Control $text .= "
".PRFLAN_242." "; $js_options = array( 'auto' => PRFLAN_243, // load based on dependency 'admin' => PRFLAN_244, // Always load in admin 'front' => PRFLAN_245, // Always load in front-end 'all' => PRFLAN_246, // Always load in admin and front-end 'none' => PRFLAN_247 // disabled ); //TODO FIXME // ie. e107 Core Minimum: JS similar to e107 v1.0 should be loaded "e_js.php" (no framwork dependency) // with basic functions like SyncWithServerTime() and expandit(), externalLinks() etc. $js_types = array( array('id' => 'jquery', 'name'=> 'jQuery (local)'), array('id' => 'prototype', 'name'=> 'Prototype (local)'), ); //TODO // separate switch for CDN.. or automatic fall-back. foreach($js_types as $arr) { // $k = $arr['path']; $k = $arr['id']; $name = $arr['name']; $text .= ""; } $text .= "
".$name." ".$frm->radio("e_jslib_core[{$k}]", $js_options, $pref['e_jslib_core'][$k])."
"; if(E107_DEBUG_LEVEL > 0) { $text .= " "; $text .= "
DEPRECATED Available only in DEBUG mode
".PRFLAN_248." ".$frm->radio_switch('e_jslib_nocombine', $pref['e_jslib_nocombine'], LAN_YES, LAN_NO)."
".PRFLAN_249."
".PRFLAN_250." ".$frm->radio_switch('e_jslib_gzip', $pref['e_jslib_gzip'], LAN_YES, LAN_NO)."
".PRFLAN_251."
".PRFLAN_252." ".$frm->radio_switch('e_jslib_nocache', $pref['e_jslib_nocache'], LAN_YES, LAN_NO)."
".PRFLAN_251."
".PRFLAN_253." ".$frm->radio_switch('e_jslib_nobcache', $pref['e_jslib_nobcache'], LAN_YES, LAN_NO)."
".PRFLAN_251."
"; } else { $text .= "
". $frm->hidden('e_jslib_nocombine',1). $frm->hidden('e_jslib_nocache', 1). $frm->hidden('e_jslib_nobcache',1). $frm->hidden('e_jslib_gzip',0). "
"; } $text .= pref_submit('javascript'); // [e_LANGUAGEDIR]/[e_LANGUAGE]/lan_library_manager.php e107::lan('core', 'library_manager'); $text .= '

' . LAN_LIBRARY_MANAGER_25 . '

'; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $libraries = e107::library('info'); foreach($libraries as $machineName => $library) { $details = e107::library('detect', $machineName); if(empty($details['name'])) { continue; } $name = libraryGetName($machineName, $details); $provider = libraryGetProvider($details); $status = libraryGetStatus($details); $links = libraryGetLinks($details); $text .= ''; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $text .= ''; $text .= ''; } if(empty($libraries)) { $text .= ''; $text .= ''; $text .= ''; } $text .= ''; $text .= '
' . LAN_LIBRARY_MANAGER_13 . '' . LAN_LIBRARY_MANAGER_21 . '' . LAN_LIBRARY_MANAGER_14 . '' . LAN_LIBRARY_MANAGER_18 . '' . LAN_LIBRARY_MANAGER_19 . '
' . $name . '' . $provider . '' . $details['version'] . '' . $status . '' . $details['error_message'] . '' . $links . '
' . LAN_LIBRARY_MANAGER_26 . '
'; $text .= "
"; /* e107::js('inline'," \$\$('#e-jslib-nocombine', '#e-jslib-nocombine-1').invoke('observe', 'change', function(event) { var element = event.findElement('input'), check = !parseInt(element.value); eHandleJsForm(check); }); var eHandleJsForm = function(enable) { var collection = \$w('e-jslib-gzip e-jslib-nocache e-jslib-nobcache'); collection.each(function(id) { var method = enable ? 'enable' : 'disable'; \$\$('#' + id, '#' + id + '-1').invoke(method); }); }; eHandleJsForm(".($pref['e_jslib_nocombine'] ? 'false' : 'true')."); ","prototype"); */ //Advanced Features $text .= "
".PRFLAN_149." "; $auth_dropdown = ''; if($authlist) { $auth_dropdown = "\n".$frm->select_open('auth_method')."\n"; foreach($authlist as $a) { $auth_dropdown .= $frm->option($a, $a, ($pref['auth_method'] == $a))."\n"; } $auth_dropdown .= "\n"; } else { $auth_dropdown = "".PRFLAN_151; $pref['auth_method'] = ""; } $text .= "
".PRFLAN_147.": ".$frm->radio_switch('developer', $pref['developer'])."
".PRFLAN_148."
".PRFLAN_196." ".$frm->radio_switch('log_page_accesses', $pref['log_page_accesses'])."
".PRFLAN_196a." ".e_LOG."
".PRFLAN_17." ".$frm->radio_switch('compress_output', $pref['compress_output'])."
".PRFLAN_150." {$auth_dropdown}
".PRFLAN_173." ".$frm->radio_switch('check_updates', $pref['check_updates'])."
".pref_submit('advanced')."
"; // END Advanced Features $text .= "
"; $ns->tablerender(PRFLAN_53, $mes->render().$text); require_once(e_ADMIN."footer.php"); function pref_submit($post_id = '') { global $frm; if($post_id) $post_id = '-'.$post_id; $text = "
"; // ML /* if(e_MLANG == 1){ //$text .=" $but_typ = array(""); // empty = submit $but_nam = array("updateprefs"); // empty = autobutX with X autoincrement $but_val = array("updateprefs"); // empty = Submit $but_class = array("caption"); // empty = button $butjs = array(""); // empty = "" $buttitle = array(""); // empty = "" $text .= e107ml_adpanel(1,$but_typ,$but_nam,$but_val,$but_class,$butjs,$buttitle); }else{*/ $text .= $frm->admin_button('updateprefs', PRFLAN_52, 'update', '', "id=updateprefs{$post_id}"); // } $text .= "\n
"; // END ML return $text; } function prefs_adminmenu() { $var['core-prefs-main']['text'] = PRFLAN_1; $var['core-prefs-email']['text'] = PRFLAN_254; $var['core-prefs-registration']['text'] = PRFLAN_28; $var['core-prefs-signup']['text'] = PRFLAN_19; // $var['core-prefs-sociallogin']['text'] = "Social Options"; // Moved into plugin. $var['core-prefs-comments']['text'] = PRFLAN_210; $var['core-prefs-uploads']['text'] = PRFLAN_255; $var['core-prefs-header1']['header'] = PRFLAN_256; $var['core-prefs-display']['text'] = PRFLAN_13; $var['core-prefs-admindisp']['text'] = PRFLAN_77; $var['core-prefs-textpost']['text'] = PRFLAN_101; $var['core-prefs-security']['text'] = PRFLAN_47; $var['core-prefs-date']['text'] = PRFLAN_21; $var['core-prefs-javascript']['text'] = PRFLAN_257; $var['core-prefs-advanced']['text'] = PRFLAN_149; e107::getNav()->admin("Basic ".LAN_OPTIONS.'--id--prev_nav', 'core-prefs-main', $var); } /** * Helper function to get library's name. */ function libraryGetName($machineName, $details) { $text = e107::getParser()->lanVars(LAN_LIBRARY_MANAGER_27, array($machineName)); return '' . $details['name'] . ''; } /** * Helper function to get links. */ function libraryGetLinks($details) { $homepage = libraryGetHomepage($details); $download = libraryGetDownload($details); if ($homepage && $download) { return $homepage . ' | ' . $download; } if($homepage) { return $homepage; } if($download) { return $download; } } /** * Helper function to get homepage link. */ function libraryGetHomepage($details) { if (empty($details['vendor_url'])) { return false; } $href = $details['vendor_url']; $title = $details['name']; return '' . LAN_LIBRARY_MANAGER_15 . ''; } /** * Helper function to get download link. */ function libraryGetDownload($details) { if (empty($details['download_url'])) { return false; } $href = $details['download_url']; $title = $details['name']; return '' . LAN_LIBRARY_MANAGER_16 . ''; } /** * Helper function to get provider. */ function libraryGetProvider($details) { $text = 'e107'; $provider = LAN_LIBRARY_MANAGER_24; if(varset($details['plugin'], false) == true) { $text = $details['plugin']; $provider = LAN_LIBRARY_MANAGER_22; } if(varset($details['theme'], false) == true) { $text = $details['theme']; $provider = LAN_LIBRARY_MANAGER_23; } return '' . $provider . ''; } /** * Helper function to get status. */ function libraryGetStatus($details) { $tp = e107::getParser(); if($details['installed'] == true) { $icon = $tp->toGlyph('glyphicon-ok'); $text = LAN_OK; return '' . $icon . ''; } $icon = $tp->toGlyph('glyphicon-remove'); $text = $details['error']; return '' . $icon . ''; }