USR); $PASSWD = $data->PWD; $EMAIL = $data->EMAIL; $NAME = $data->NAME; $lang_array = getFiles(GSLANGPATH); # initialize these all as null $pwd1 = $error = $success = $pwd2 = $editorchck = $prettychck = null; # if the flush cache command was invoked if (isset($_GET['flushcache'])) { delete_cache(); $update = 'flushcache-success'; } # if the undo command was invoked if (isset($_GET['undo'])) { # first check for csrf if (!defined('GSNOCSRF') || (GSNOCSRF == FALSE) ) { $nonce = $_GET['nonce']; if(!check_nonce($nonce, "undo")) { die("CSRF detected!"); } } # perform undo undo($file, GSUSERSPATH, GSBACKUSERSPATH); undo($wfile, GSDATAOTHERPATH, GSBACKUPSPATH.'other/'); generate_sitemap(); # redirect back to yourself to show the new restored data redirect('settings.php?restored=true'); } # was this page restored? if (isset($_GET['restored'])) { $restored = 'true'; } else { $restored = 'false'; } # was the form submitted? if(isset($_POST['submitted'])) { # first check for csrf if (!defined('GSNOCSRF') || (GSNOCSRF == FALSE) ) { $nonce = $_POST['nonce']; if(!check_nonce($nonce, "save_settings")) { die("CSRF detected!"); } } # website-specific fields if(isset($_POST['sitename'])) { $SITENAME = htmlentities($_POST['sitename'], ENT_QUOTES, 'UTF-8'); } if(isset($_POST['siteurl'])) { $SITEURL = tsl($_POST['siteurl']); } if(isset($_POST['permalink'])) { $PERMALINK = var_out(trim($_POST['permalink'])); } if(isset($_POST['template'])) { $TEMPLATE = $_POST['template']; } if(isset($_POST['prettyurls'])) { $PRETTYURLS = $_POST['prettyurls']; } else { $PRETTYURLS = ''; } # user-specific fields if(isset($_POST['user'])) { $USR = strtolower($_POST['user']); } if(isset($_POST['name'])) { $NAME = var_out($_POST['name']); } if(isset($_POST['email'])) { $EMAIL = var_out($_POST['email'],'email'); } if(isset($_POST['timezone'])) { $TIMEZONE = var_out($_POST['timezone']); } if(isset($_POST['lang'])) { $LANG = var_out($_POST['lang']); } if(isset($_POST['show_htmleditor'])) { $HTMLEDITOR = var_out($_POST['show_htmleditor']); } else { $HTMLEDITOR = ''; } # check to see if passwords are changing if(isset($_POST['sitepwd'])) { $pwd1 = $_POST['sitepwd']; } if(isset($_POST['sitepwd_confirm'])) { $pwd2 = $_POST['sitepwd_confirm']; } if ($pwd1 != $pwd2) { #passwords do not match $error = i18n_r('PASSWORD_NO_MATCH'); } else { # password cannot be null if ( $pwd1 != '' ) { $PASSWD = passhash($pwd1); } // check valid lang files if(!in_array($LANG.'.php', $lang_array) and !in_array($LANG.'.PHP', $lang_array)) die(); # create user xml file createBak($file, GSUSERSPATH, GSBACKUSERSPATH); if (file_exists(GSUSERSPATH . _id($USR).'.xml.reset')) { unlink(GSUSERSPATH . _id($USR).'.xml.reset'); } $xml = new SimpleXMLElement(''); $xml->addChild('USR', $USR); $xml->addChild('NAME', $NAME); $xml->addChild('PWD', $PASSWD); $xml->addChild('EMAIL', $EMAIL); $xml->addChild('HTMLEDITOR', $HTMLEDITOR); $xml->addChild('TIMEZONE', $TIMEZONE); $xml->addChild('LANG', $LANG); exec_action('settings-user'); if (! XMLsave($xml, GSUSERSPATH . $file) ) { $error = i18n_r('CHMOD_ERROR'); } # create website xml file createBak($wfile, GSDATAOTHERPATH, GSBACKUPSPATH.'other/'); $xmls = new SimpleXMLExtended(''); $note = $xmls->addChild('SITENAME'); $note->addCData($SITENAME); $note = $xmls->addChild('SITEURL'); $note->addCData($SITEURL); $note = $xmls->addChild('TEMPLATE'); $note->addCData($TEMPLATE); $xmls->addChild('PRETTYURLS', $PRETTYURLS); $xmls->addChild('PERMALINK', $PERMALINK); exec_action('settings-website'); if (! XMLsave($xmls, GSDATAOTHERPATH . $wfile) ) { $error = i18n_r('CHMOD_ERROR'); } # see new language file immediately include(GSLANGPATH.$LANG.'.php'); if (!$error) { $success = i18n_r('ER_SETTINGS_UPD').'. '.i18n_r('UNDO').''; generate_sitemap(); } } } # are any of the control panel checkboxes checked? if ($HTMLEDITOR != '' ) { $editorchck = 'checked'; } if ($PRETTYURLS != '' ) { $prettychck = 'checked'; } # get all available language files if ($LANG == ''){ $LANG = 'en_US'; } if (count($lang_array) != 0) { sort($lang_array); $sel = ''; $langs = ''; foreach ($lang_array as $lfile){ $lfile = basename($lfile,".php"); if ($LANG == $lfile) { $sel="selected"; } $langs .= ''; $sel = ''; } } else { $langs = ''; } get_template('header', cl($SITENAME).' » '.i18n_r('GENERAL_SETTINGS')); ?>
" />

'.i18n_r('LABEL_SUGGESTION').':   '.$fullpath.'

'; } ?>

/>  

'.i18n_r('WARN_EMAILINVALID').'

'; }?>

/>  

: