diff options
Diffstat (limited to 'phpBB/admin')
-rw-r--r-- | phpBB/admin/admin_board.php | 176 | ||||
-rw-r--r-- | phpBB/admin/admin_mass_email.php | 4 | ||||
-rw-r--r-- | phpBB/admin/admin_users.php | 6 | ||||
-rw-r--r-- | phpBB/admin/index.php | 4 | ||||
-rw-r--r-- | phpBB/admin/page_header_admin.php | 10 |
5 files changed, 73 insertions, 127 deletions
diff --git a/phpBB/admin/admin_board.php b/phpBB/admin/admin_board.php index 4d98e63dad..11eed1fb2b 100644 --- a/phpBB/admin/admin_board.php +++ b/phpBB/admin/admin_board.php @@ -36,114 +36,60 @@ if(!$result = $db->sql_query($sql)) } else { -/* while($row = $db->sql_fetchrow($result)) { - $board_config[$row['config_var_name']] = stripslashes($row['config_var_value']); + $config_name = $row['config_name']; + $config_value = $row['config_value']; + $default_config[$config_name] = $config_value; + + $new[$config_name] = (isset($HTTP_POST_VARS[$config_name])) ? $HTTP_POST_VARS[$config_name] : $default_config[$config_name]; + + if($HTTP_POST_VARS['submit']) + { + $sql = "UPDATE " . CONFIG_TABLE . " SET + config_value = '".$new[$config_name]."' + WHERE config_name = '$config_name'"; + if( !$db->sql_query($sql) ) + { + message_die(GENERAL_ERROR, "Failed to update general configuration for $config_name", "", __LINE__, __FILE__, $sql); + } + } } -*/ - - $default_config = $db->sql_fetchrow($result); -} - -$sitename = (isset($HTTP_POST_VARS['sitename'])) ? $HTTP_POST_VARS['sitename'] : $default_config['sitename']; -$require_activation = (isset($HTTP_POST_VARS['require_activation'])) ? $HTTP_POST_VARS['require_activation'] : $default_config['require_activation']; -$flood_interval = (isset($HTTP_POST_VARS['flood_interval'])) ? $HTTP_POST_VARS['flood_interval'] : $default_config['flood_interval']; -$topics_per_page = (isset($HTTP_POST_VARS['topics_per_page'])) ? $HTTP_POST_VARS['topics_per_page'] : $default_config['topics_per_page']; -$posts_per_page = (isset($HTTP_POST_VARS['posts_per_page'])) ? $HTTP_POST_VARS['posts_per_page'] : $default_config['posts_per_page']; -$hot_topic = (isset($HTTP_POST_VARS['hot_topic'])) ? $HTTP_POST_VARS['hot_topic'] : $default_config['hot_threshold']; -$selected_template = (isset($HTTP_POST_VARS['template'])) ? $HTTP_POST_VARS['template'] : $default_config['sys_template']; -$template_select = template_select($selected_template, "../templates"); -$theme = (isset($HTTP_POST_VARS['theme'])) ? $HTTP_POST_VARS['theme'] : $default_config['default_theme']; -$theme_select = theme_select($theme); -$language = (isset($HTTP_POST_VARS['language'])) ? $HTTP_POST_VARS['language'] : $default_config['default_lang']; -$lang_select = language_select($language, "../language"); -$timezone = (isset($HTTP_POST_VARS['timezone'])) ? intval($HTTP_POST_VARS['timezone']) : $default_config['system_timezone']; -$timezone_select = tz_select($timezone); -$date_format = (isset($HTTP_POST_VARS['date_format'])) ? $HTTP_POST_VARS['date_format'] : $default_config['default_dateformat']; -$gzip = (isset($HTTP_POST_VARS['gzip'])) ? $HTTP_POST_VARS['gzip'] : $default_config['gzip_compress']; -$prune = (isset($HTTP_POST_VARS['prune'])) ? $HTTP_POST_VARS['prune'] : $default_config['prune_enable']; -$allow_html = (isset($HTTP_POST_VARS['allow_html'])) ? $HTTP_POST_VARS['allow_html'] : $default_config['allow_html']; -$allow_bbcode = (isset($HTTP_POST_VARS['allow_bbcode'])) ? $HTTP_POST_VARS['allow_bbcode'] : $default_config['allow_bbcode']; -$allow_smile = (isset($HTTP_POST_VARS['allow_smile'])) ? $HTTP_POST_VARS['allow_smile'] : $default_config['allow_smilies']; -$allow_sig = (isset($HTTP_POST_VARS['allow_sig'])) ? $HTTP_POST_VARS['allow_sig'] : $default_config['allow_sig']; -$allow_namechange = (isset($HTTP_POST_VARS['allow_namechange'])) ? $HTTP_POST_VARS['allow_namechange'] : $default_config['allow_namechange']; -$allow_avatars_local = (isset($HTTP_POST_VARS['allow_avatars_local'])) ? $HTTP_POST_VARS['allow_avatars_local'] : $default_config['allow_avatar_local']; -$allow_avatars_remote = (isset($HTTP_POST_VARS['allow_avatars_remote'])) ? $HTTP_POST_VARS['allow_avatars_remote'] : $default_config['allow_avatar_remote']; -$allow_avatars_upload = (isset($HTTP_POST_VARS['allow_avatars_upload'])) ? $HTTP_POST_VARS['allow_avatars_upload'] : $default_config['allow_avatar_upload']; -$avatar_filesize = (isset($HTTP_POST_VARS['avatar_filesize'])) ? $HTTP_POST_VARS['avatar_filesize'] : $default_config['avatar_filesize']; -$avatar_height = (isset($HTTP_POST_VARS['avatar_height'])) ? $HTTP_POST_VARS['avatar_height'] : $default_config['avatar_max_height']; -$avatar_width = (isset($HTTP_POST_VARS['avatar_width'])) ? $HTTP_POST_VARS['avatar_width'] : $default_config['avatar_max_width']; -$avatar_path = (isset($HTTP_POST_VARS['avatar_path'])) ? $HTTP_POST_VARS['avatar_path'] : $default_config['avatar_path']; -$admin_email = (isset($HTTP_POST_VARS['admin_email'])) ? $HTTP_POST_VARS['admin_email'] : $default_config['board_email_from']; -$email_sig = (isset($HTTP_POST_VARS['email_sig'])) ? $HTTP_POST_VARS['email_sig'] : $default_config['board_email']; -$use_smtp = (isset($HTTP_POST_VARS['use_smtp'])) ? $HTTP_POST_VARS['use_smtp'] : $default_config['smtp_delivery']; -$smtp_server = (isset($HTTP_POST_VARS['smtp_server'])) ? $HTTP_POST_VARS['smtp_server'] : $default_config['smtp_host']; - -$html_yes = ($allow_html) ? "checked=\"checked\"" : ""; -$html_no = (!$allow_html) ? "checked=\"checked\"" : ""; -$bbcode_yes = ($allow_bbcode) ? "checked=\"checked\"" : ""; -$bbcode_no = (!$allow_bbcode) ? "checked=\"checked\"" : ""; -$activation_yes = ($require_activation) ? "checked=\"checked\"" : ""; -$activation_no = (!$require_activation) ? "checked=\"checked\"" : ""; -$gzip_yes = ($gzip) ? "checked=\"checked\"" : ""; -$gzip_no = (!$gzip) ? "checked=\"checked\"" : ""; -$smile_yes = ($allow_smile) ? "checked=\"checked\"" : ""; -$smile_no = (!$allow_smile) ? "checked=\"checked\"" : ""; -$sig_yes = ($allow_sig) ? "checked=\"checked\"" : ""; -$sig_no = (!$allow_sig) ? "checked=\"checked\"" : ""; -$namechange_yes = ($allow_namechange) ? "checked=\"checked\"" : ""; -$namechange_no = (!$allow_namechange) ? "checked=\"checked\"" : ""; -$avatars_local_yes = ($allow_avatars_local) ? "checked=\"checked\"" : ""; -$avatars_local_no = (!$allow_avatars_local) ? "checked=\"checked\"" : ""; -$avatars_remote_yes = ($allow_avatars_remote) ? "checked=\"checked\"" : ""; -$avatars_remote_no = (!$allow_avatars_remote) ? "checked=\"checked\"" : ""; -$avatars_upload_yes = ($allow_avatars_upload) ? "checked=\"checked\"" : ""; -$avatars_upload_no = (!$allow_avatars_upload) ? "checked=\"checked\"" : ""; -$smtp_yes = ($use_smtp) ? "checked=\"checked\"" : ""; -$smtp_no = (!$use_smtp) ? "checked=\"checked\"" : ""; - -if($HTTP_POST_VARS['submit']) -{ - $sql = "UPDATE " . CONFIG_TABLE . " SET - sitename = '$sitename', - allow_html = $allow_html, - allow_bbcode = $allow_bbcode, - allow_smilies = $allow_smile, - allow_sig = $allow_sig, - allow_namechange = $allow_namechange, - allow_avatar_local = $allow_avatars_local, - allow_avatar_remote = $allow_avatars_remote, - allow_avatar_upload = $allow_avatars_upload, - posts_per_page = $posts_per_page, - topics_per_page = $topics_per_page, - hot_threshold = $hot_topic, - email_sig = '$email_sig', - email_from = '$admin_email', - smtp_delivery = $use_smtp, - smtp_host = '$smtp_server', - require_activation = $require_activation, - flood_interval = $flood_interval, - avatar_filesize = $avatar_filesize, - avatar_max_width = $avatar_width, - avatar_max_height = $avatar_height, - avatar_path = '$avatar_path', - default_theme = $theme, - default_lang = '$language', - default_dateformat = '$date_format', - system_timezone = $timezone, - sys_template = '$selected_template', - gzip_compress = $gzip, - prune_enable = $prune"; - - if( !$db->sql_query($sql) ) + if($HTTP_POST_VARS['submit']) { - message_die(GENERAL_ERROR, "Failed to update general configuration", "", __LINE__, __FILE__, $sql); + message_die(GENERAL_MESSAGE, $lang['Config_updated']); } - - message_die(GENERAL_MESSAGE, $lang['Config_updated']); } +$template_select = template_select($new['board_template'], 'board_template', "../templates"); +$theme_select = theme_select($new['default_theme'], 'default_theme'); +$lang_select = language_select($new['default_lang'], 'default_lang', "../language"); +$timezone_select = tz_select($new['board_timezone'], 'board_timezone'); + +$html_yes = ($new['allow_html']) ? "checked=\"checked\"" : ""; +$html_no = (!$new['allow_html']) ? "checked=\"checked\"" : ""; +$bbcode_yes = ($new['allow_bbcode']) ? "checked=\"checked\"" : ""; +$bbcode_no = (!$new['allow_bbcode']) ? "checked=\"checked\"" : ""; +$activation_yes = ($new['require_activation']) ? "checked=\"checked\"" : ""; +$activation_no = (!$new['require_activation']) ? "checked=\"checked\"" : ""; +$gzip_yes = ($new['gzip_compress']) ? "checked=\"checked\"" : ""; +$gzip_no = (!$new['gzip_compress']) ? "checked=\"checked\"" : ""; +$smile_yes = ($new['allow_smilies']) ? "checked=\"checked\"" : ""; +$smile_no = (!$new['allow_smilies']) ? "checked=\"checked\"" : ""; +$sig_yes = ($new['allow_sig']) ? "checked=\"checked\"" : ""; +$sig_no = (!$new['allow_sig']) ? "checked=\"checked\"" : ""; +$namechange_yes = ($new['allow_namechange']) ? "checked=\"checked\"" : ""; +$namechange_no = (!$new['allow_namechange']) ? "checked=\"checked\"" : ""; +$avatars_local_yes = ($new['allow_avatar_local']) ? "checked=\"checked\"" : ""; +$avatars_local_no = (!$new['allow_avatar_local']) ? "checked=\"checked\"" : ""; +$avatars_remote_yes = ($new['allow_avatar_remote']) ? "checked=\"checked\"" : ""; +$avatars_remote_no = (!$new['allow_avatar_remote']) ? "checked=\"checked\"" : ""; +$avatars_upload_yes = ($new['allow_avatar_upload']) ? "checked=\"checked\"" : ""; +$avatars_upload_no = (!$new['allow_avatar_upload']) ? "checked=\"checked\"" : ""; +$smtp_yes = ($new['smtp_delivery']) ? "checked=\"checked\"" : ""; +$smtp_no = (!$new['smtp_delivery']) ? "checked=\"checked\"" : ""; + + $template->set_filenames(array( "body" => "admin/admin_config_body.tpl") @@ -151,18 +97,18 @@ $template->set_filenames(array( $template->assign_vars(array( "S_CONFIG_ACTION" => append_sid("admin_board.$phpEx"), - "SITENAME" => $sitename, + "SITENAME" => $new['sitename'], "ACTIVATION_YES" => $activation_yes, "ACTIVATION_NO" => $activation_no, - "FLOOD_INTERVAL" => $flood_interval, - "TOPICS_PER_PAGE" => $topics_per_page, - "POSTS_PER_PAGE" => $posts_per_page, - "HOT_TOPIC" => $hot_topic, + "FLOOD_INTERVAL" => $new['flood_interval'], + "TOPICS_PER_PAGE" => $new['topics_per_page'], + "POSTS_PER_PAGE" => $new['posts_per_page'], + "HOT_TOPIC" => $new['hot_threshold'], "TEMPLATE_SELECT" => $template_select, "THEME_SELECT" => $theme_select, "LANG_SELECT" => $lang_select, "L_DATE_FORMAT_EXPLAIN" => $lang['Date_format_explain'], - "DATE_FORMAT" => $date_format, + "DEFAULT_DATEFORMAT" => $new['default_dateformat'], "TIMEZONE_SELECT" => $timezone_select, "GZIP_YES" => $gzip_yes, "GZIP_NO" => $gzip_no, @@ -182,19 +128,19 @@ $template->assign_vars(array( "AVATARS_REMOTE_NO" => $avatars_remote_no, "AVATARS_UPLOAD_YES" => $avatars_upload_yes, "AVATARS_UPLOAD_NO" => $avatars_upload_no, - "AVATAR_FILESIZE" => $avatar_filesize, - "AVATAR_HEIGHT" => $avatar_height, - "AVATAR_WIDTH" => $avatar_width, - "AVATAR_PATH" => $avatar_path, - "ADMIN_EMAIL" => $admin_email, - "EMAIL_SIG" => $email_sig, + "AVATAR_FILESIZE" => $new['avatar_filesize'], + "AVATAR_MAX_HEIGHT" => $new['avatar_max_height'], + "AVATAR_MAX_WIDTH" => $new['avatar_max_width'], + "AVATAR_PATH" => $new['avatar_path'], + "EMAIL_FROM" => $new['email_from'], + "EMAIL_SIG" => $new['email_sig'], "SMTP_YES" => $smtp_yes, "SMTP_NO" => $smtp_no, - "SMTP_SERVER" => $smtp_server) + "SMTP_HOST" => $new['smtp_host']) ); $template->pparse("body"); include('page_footer_admin.'.$phpEx); -?>
\ No newline at end of file +?> diff --git a/phpBB/admin/admin_mass_email.php b/phpBB/admin/admin_mass_email.php index b2f34f8ed3..9d62cdc169 100644 --- a/phpBB/admin/admin_mass_email.php +++ b/phpBB/admin/admin_mass_email.php @@ -90,7 +90,7 @@ if(isset($HTTP_POST_VARS['submit'])) } $g_list = $db->sql_fetchrowset($g_result); - $email_headers = "From: " . $board_config['board_email_from'] . "\r\n"; + $email_headers = "From: " . $board_config['board_email'] . "\r\n"; $msg = stripslashes($HTTP_POST_VARS["$f_msg"]); $email_headers .= 'bcc: '; @@ -102,7 +102,7 @@ if(isset($HTTP_POST_VARS['submit'])) } $email_headers .= $g_list[$i]['user_email']; } - mail($board_config['board_email_from'],$HTTP_POST_VARS["$f_title"],$HTTP_POST_VARS["$f_msg"],$email_headers); + mail($board_config['board_email'],$HTTP_POST_VARS["$f_title"],$HTTP_POST_VARS["$f_msg"],$email_headers); $notice = $lang['Messages'].' '.$lang['Sent'].'!'; } //Else, or if they already sent a message diff --git a/phpBB/admin/admin_users.php b/phpBB/admin/admin_users.php index 103783dcd6..d476dc802d 100644 --- a/phpBB/admin/admin_users.php +++ b/phpBB/admin/admin_users.php @@ -109,7 +109,7 @@ if ( isset($HTTP_GET_VARS['submit']) ) { if(!isset($user_template)) { - $selected_template = $board_config['default_template']; + $selected_template = $board_config['board_template']; } $html_status = ($board_config['allow_html']) ? $lang['ON'] : $lang['OFF']; @@ -276,8 +276,8 @@ else if($HTTP_POST_VARS[submit] && $HTTP_POST_VARS['user_id']) $user_theme = ($HTTP_POST_VARS['theme']) ? $HTTP_POST_VARS['theme'] : $board_config['default_theme']; $user_lang = ($HTTP_POST_VARS['language']) ? $HTTP_POST_VARS['language'] : $board_config['default_lang']; - $user_timezone = (isset($HTTP_POST_VARS['timezone'])) ? $HTTP_POST_VARS['timezone'] : $board_config['default_timezone']; - $user_template = ($HTTP_POST_VARS['template']) ? $HTTP_POST_VARS['template'] : $board_config['default_template']; + $user_timezone = (isset($HTTP_POST_VARS['timezone'])) ? $HTTP_POST_VARS['timezone'] : $board_config['board_timezone']; + $user_template = ($HTTP_POST_VARS['template']) ? $HTTP_POST_VARS['template'] : $board_config['board_template']; $user_dateformat = ($HTTP_POST_VARS['dateformat']) ? trim($HTTP_POST_VARS['dateformat']) : $board_config['default_dateformat']; $user_status = (!empty($HTTP_POST_VARS['user_status'])) ? $HTTP_POST_VARS['user_status'] : 0; diff --git a/phpBB/admin/index.php b/phpBB/admin/index.php index c7d6ae0dea..8436fee577 100644 --- a/phpBB/admin/index.php +++ b/phpBB/admin/index.php @@ -141,7 +141,7 @@ elseif( $HTTP_GET_VARS['pane'] == 'right' ) $total_users = get_db_stat('usercount'); $total_topics = get_db_stat('topiccount'); - $start_date = create_date($board_config['default_dateformat'], $board_config['board_startdate'], $board_config['default_timezone']); + $start_date = create_date($board_config['default_dateformat'], $board_config['board_startdate'], $board_config['board_timezone']); $boarddays = (time() - $board_config['board_startdate']) / (24*60*60); @@ -397,7 +397,7 @@ elseif( $HTTP_GET_VARS['pane'] == 'right' ) "ROW_CLASS" => $row_class, "USERNAME" => $username, "LOGGED_ON" => $logged_on, - "LASTUPDATE" => create_date($board_config['default_dateformat'], $onlinerow[$i]['session_time'], $board_config['default_timezone']), + "LASTUPDATE" => create_date($board_config['default_dateformat'], $onlinerow[$i]['session_time'], $board_config['board_timezone']), "LOCATION" => $location, "IP_ADDRESS" => $ip_address, "U_USER_PROFILE" => append_sid("admin_users.$phpEx?" . POST_USERS_URL . "=" . $onlinerow[$i]['user_id'])) diff --git a/phpBB/admin/page_header_admin.php b/phpBB/admin/page_header_admin.php index 8ef73f17f2..c17e9d61d9 100644 --- a/phpBB/admin/page_header_admin.php +++ b/phpBB/admin/page_header_admin.php @@ -60,17 +60,17 @@ $template->set_filenames(array( // // Do timezone text output // -if($board_config['default_timezone'] < 0) +if($board_config['board_timezone'] < 0) { - $s_timezone = $lang['All_times'] . " " .$lang['GMT'] . " - " . (-$board_config['default_timezone']) . " " . $lang['Hours']; + $s_timezone = $lang['All_times'] . " " .$lang['GMT'] . " - " . (-$board_config['board_timezone']) . " " . $lang['Hours']; } -else if($board_config['default_timezone'] == 0) +else if($board_config['board_timezone'] == 0) { $s_timezone = $lang['All_times'] . " " . $lang['GMT']; } else { - $s_timezone = $lang['All_times'] . " " . $lang['GMT'] ." + " . $board_config['default_timezone'] . " " . $lang['Hours']; + $s_timezone = $lang['All_times'] . " " . $lang['GMT'] ." + " . $board_config['board_timezone'] . " " . $lang['Hours']; } // @@ -113,7 +113,7 @@ $template->assign_vars(array( "S_TIMEZONE" => $s_timezone, "S_LOGIN_ACTION" => append_sid("../login.$phpEx"), "S_JUMPBOX_ACTION" => append_sid("../viewforum.$phpEx"), - "S_CURRENT_TIME" => create_date($board_config['default_dateformat'], time(), $board_config['default_timezone']), + "S_CURRENT_TIME" => create_date($board_config['default_dateformat'], time(), $board_config['board_timezone']), "T_HEAD_STYLESHEET" => $theme['head_stylesheet'], "T_BODY_BACKGROUND" => $theme['body_background'], |