$default_config = $acp_default_config; // validate if ($submit) { // init for error $error = false; $error_msg = ''; // format and verify data @reset($acp_modules[$menu_name]['data'][$mod_name]['data'][$sub_name]['data']); while (list($config_name, $config_data) = @each($acp_modules[$menu_name]['data'][$mod_name]['data'][$sub_name]['data'])) { if (isset($_POST[$config_name])) { $config_data['name'] = $config_name; $config_data['default'] = $_POST[$config_name]; $config_value = $class_form->validate_value($config_data); // Save data if (empty($is_plugin)) { $config_value = fix_config_values($config_name, $config_value); $class_settings->set_config($config_name, $config_value, false, false); } else { $class_plugins->set_plugin_config($config_name, $config_value, false, false); } } if (isset($_POST[$config_name . '_over'])) { $config_name = $config_name . '_over'; $config_value = !empty($_POST[$config_name]) ? '1' : '0'; // Save data if (empty($is_plugin)) { $class_settings->set_config($config_name, $config_value, false, false); } else { $class_plugins->set_plugin_config($config_name, $config_value, false, false); } }
if (!defined('IP_ROOT_PATH')) { define('IP_ROOT_PATH', './../'); } if (!defined('PHP_EXT')) { define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1)); } require 'pagestart.' . PHP_EXT; include_once IP_ROOT_PATH . 'includes/functions_selects.' . PHP_EXT; // Pull all config data $tmp_config = array(); $tmp_config = get_config(false); foreach ($tmp_config as $k => $v) { $default_config[$k] = $v; $tmp_value = request_post_var($k, '', true); $new[$k] = isset($_POST[$k]) ? $tmp_value : $default_config[$k]; $new[$k] = fix_config_values($k, $new[$k]); if (isset($_POST['submit']) && isset($_POST[$k])) { set_config($k, $new[$k], false); } } if (isset($_POST['submit'])) { $cache->destroy('config'); $message = $lang['Config_updated'] . '<br /><br />' . sprintf($lang['Click_return_config'], '<a href="' . append_sid('admin_board.' . PHP_EXT) . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid('index.' . PHP_EXT . '?pane=right') . '">', '</a>'); message_die(GENERAL_MESSAGE, $message); } $switch_header_table_yes = $new['switch_header_table'] ? 'checked="checked"' : ''; $switch_header_table_no = !$new['switch_header_table'] ? 'checked="checked"' : ''; // Ajax Shoutbox - BEGIN $shoutguest_yes = $new['shout_allow_guest'] == 1 ? 'checked="checked"' : ''; $shoutguest_read = $new['shout_allow_guest'] == 2 ? 'checked="checked"' : ''; $shoutguest_no = $new['shout_allow_guest'] == 0 ? 'checked="checked"' : '';
if (!defined('PHP_EXT')) { define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1)); } require IP_ROOT_PATH . 'common.' . PHP_EXT; $lang['Clear_browser'] = 'You need to clear your browser cookies and cache and restart it for the settings to take effect.'; $lang['Delete_file'] = 'Please delete this script and the install directory now!'; // Start session management $user->session_begin(); $auth->acl($user->data); $user->setup(); // End session management $action = request_var('action', ''); if ($action == 'write') { $configs_array = array('cookie_domain', 'cookie_path', 'cookie_name', 'domain_name', 'script_path', 'server_port', 'cookie_secure'); foreach ($configs_array as $k) { $tmp_value = fix_config_values($k, request_post_var($k, '', true)); if (isset($_POST[$k])) { set_config($k, $tmp_value, false); } } $cache->destroy('config'); echo '<p><b>' . $lang['Config_updated'] . '</b></p>'; echo '<p><b>' . $lang['Clear_browser'] . '</b></p>'; echo '<p><b>' . $lang['Delete_file'] . '</b></p>'; } else { $file_path = $_SERVER['SCRIPT_NAME']; $dirs = explode('/', $file_path); $dir_count = sizeof($dirs) - 1; unset($dirs[$dir_count]); unset($dirs[$dir_count - 1]); $script_path = implode('/', $dirs) . '/';