if (!defined('LANGUAGE')) { define('LANGUAGE', $_POST['sc']['LANGUAGE']); } } include_once '../exponent.php'; if (!file_exists('not_configured') && file_exists(BASE . 'conf/config.php')) { flash('notice', gt('This Exponent Site has already been configured.')); header('Location: ../index.php'); exit(gt('This Exponent Site has already been configured.')); } if (isset($_POST['sc'])) { if (file_exists("../conf/config.php")) { // Update the config $config = $_POST['sc']; foreach ($config as $key => $value) { expSettings::change($key, addslashes($value)); } } else { // Initialize /conf/config $config = $_POST['sc']; $values = array('c' => $config, 'opts' => array(), 'configname' => 'Default', 'activate' => 1); expSettings::saveConfiguration($values); } } if (isset($_POST['install_sample'])) { $eql = BASE . $_POST['install_sample'] . ".eql"; if (file_exists($eql)) { $errors = array(); expFile::restoreDatabase($db, $eql, $errors, 0); $files = BASE . $_POST['install_sample'] . ".tar.gz"; // only install if there was an eql file
public function update_siteconfig() { foreach ($this->params['sc'] as $key => $value) { expSettings::change($key, addslashes($value)); } flash('message', gt("Your Website Configuration has been updated")); // expHistory::back(); expHistory::returnTo('viewable'); }
unset($output); //Update each language file based on default language and then attempt to translate // Initialize the exponent environment and language subsystem include_once '../exponent_bootstrap.php'; expLang::loadLang(); global $default_lang, $cur_lang; if (empty($default_lang)) { $default_lang = (include BASE . "framework/core/lang/English - US.php"); } $orig_lang = LANG; $lang_list = expLang::langList(); foreach ($lang_list as $key => $value) { if ($key != "English - US") { output("Now attempting to translate new " . $key . " phrases\n"); expSettings::change('LANGUAGE', $key); exec('php ./lang_translate.php', $output); output($output); unset($output); } } expSettings::change('LANGUAGE', $orig_lang); print "\nCompleted Updating the Exponent Language System!\n"; function output($text) { if (!is_array($text)) { $text = array($text); } foreach ($text as $string) { print $string . "\n"; } }
# Exponent is free software; you can redistribute # it and/or modify it under the terms of the GNU # General Public License as published by the Free # Software Foundation; either version 2 of the # License, or (at your option) any later version. # # GPL: http://www.gnu.org/licenses/gpl.txt # ################################################## if (!defined('EXPONENT')) { exit(''); } global $db; $error = false; // We have to force the language name into the config.php file expSettings::change('LANGUAGE', LANGUAGE); $user = $db->selectObject('user', 'is_admin=1'); $user->username = $_POST['username']; if ($user->username == '') { $error = true; $errorstr = gt('You must specify a valid username.'); $errorflag = '&errusername=true'; echo $errorstr; } elseif ($_POST['password'] != $_POST['password2']) { $error = true; $errorstr = gt('Your passwords do not match. Please check your entries.'); $errorflag = '&errpassword=true'; echo $errorstr; } elseif (!expValidator::validate_email_address($_POST['email'])) { $error = true; $errorstr = gt('Your email address is invalid. Please check your entry.');