[ PHPXref.com ] [ Generated: Sun Jul 20 18:37:24 2008 ] [ MetaBB 5.0 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/admin/ -> admin_board.php (source)

   1  <?php
   2  /***************************************************************************

   3   *                              admin_board.php

   4   *                            -------------------

   5   *   begin                : Thursday, Jul 12, 2001

   6   *   copyright            : (C) 2001 The phpBB Group

   7   *   email                : support@phpbb.com

   8   *

   9   *   $Id: admin_board.php,v 1.51.2.8 2004/07/15 18:02:44 acydburn Exp $

  10   *

  11   *

  12   ***************************************************************************/
  13  
  14  define('IN_PHPBB', 1);
  15  
  16  if( !empty($setmodules) )
  17  {
  18      $file = basename(__FILE__);
  19      $module['General']['Configuration'] = $file;
  20      return;
  21  }
  22  
  23  //

  24  // Let's set the root dir for phpBB

  25  //

  26  $phpbb_root_path = "./../";
  27  require ($phpbb_root_path . 'extension.inc');
  28  require('./pagestart.' . $phpEx);
  29  include($phpbb_root_path . 'includes/functions_selects.'.$phpEx);
  30  
  31  //

  32  // Pull all config data

  33  //

  34  $sql = "SELECT *
  35      FROM " . CONFIG_TABLE;
  36  if(!$result = $db->sql_query($sql))
  37  {
  38      message_die(CRITICAL_ERROR, "Could not query config information in admin_board", "", __LINE__, __FILE__, $sql);
  39  }
  40  else
  41  {
  42      while( $row = $db->sql_fetchrow($result) )
  43      {
  44          $config_name = $row['config_name'];
  45          $config_value = $row['config_value'];
  46          $default_config[$config_name] = isset($HTTP_POST_VARS['submit']) ? str_replace("'", "\'", $config_value) : $config_value;
  47          
  48          $new[$config_name] = ( isset($HTTP_POST_VARS[$config_name]) ) ? $HTTP_POST_VARS[$config_name] : $default_config[$config_name];
  49  
  50          if ($config_name == 'cookie_name')
  51          {
  52              $new['cookie_name'] = str_replace('.', '_', $new['cookie_name']);
  53          }
  54  
  55          // Attempt to prevent a common mistake with this value,

  56          // http:// is the protocol and not part of the server name

  57          if ($config_name == 'server_name')
  58          {
  59              $new['server_name'] = str_replace('http://', '', $new['server_name']);
  60          }
  61  
  62          if( isset($HTTP_POST_VARS['submit']) )
  63          {
  64  
  65  // - add mods : admin_disable_board_message -------------------------------------------------------------------

  66        $sql = 'UPDATE ' . CONFIG_TABLE . ' SET config_value=\'' . $_POST['message_board_disable_text'] . '\' WHERE config_name = \'board_disable_message\'';
  67        if( !$db->sql_query($sql) )
  68        {
  69              message_die(GENERAL_ERROR, "Failed to update general configuration for $config_name", "", __LINE__, __FILE__, $sql);
  70        }
  71  // - end add mods : admin_disable_board_message ---------------------------------------------------------------

  72  
  73              $sql = "UPDATE " . CONFIG_TABLE . " SET
  74                  config_value = '" . str_replace("\'", "''", $new[$config_name]) . "'
  75                  WHERE config_name = '$config_name'";
  76              if( !$db->sql_query($sql) )
  77              {
  78                  message_die(GENERAL_ERROR, "Failed to update general configuration for $config_name", "", __LINE__, __FILE__, $sql);
  79              }
  80          }
  81      }
  82  
  83      if( isset($HTTP_POST_VARS['submit']) )
  84      {
  85          $message = $lang['Config_updated'] . "<br /><br />" . sprintf($lang['Click_return_config'], "<a href=\"" . append_sid("admin_board.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");
  86  
  87          message_die(GENERAL_MESSAGE, $message);
  88      }
  89  }
  90  
  91  $style_select = style_select($new['default_style'], 'default_style', "../templates");
  92  $lang_select = language_select($new['default_lang'], 'default_lang', "language");
  93  $timezone_select = tz_select($new['board_timezone'], 'board_timezone');
  94  
  95  
  96  $disable_board_yes = ( $new['board_disable'] ) ? "checked=\"checked\"" : "";
  97  $disable_board_no = ( !$new['board_disable'] ) ? "checked=\"checked\"" : "";
  98  // BEGIN Disable Registration MOD

  99  $registration_status_yes = ( $new['registration_status'] ) ? "checked=\"checked\"" : "";
 100  $registration_status_no = ( !$new['registration_status'] ) ? "checked=\"checked\"" : ""; 
 101  // END Disable Registration MOD

 102  
 103  // - add mods : admin_disable_board_message -------------------------------------------------------------------

 104  $message_disable_board_yes = ( $new['board_disable_mess_st'] ) ? "checked=\"checked\"" : "";
 105  $message_disable_board_no = ( !$new['board_disable_mess_st'] ) ? "checked=\"checked\"" : "";
 106  // - end add mods : admin_disable_board_message ---------------------------------------------------------------

 107  
 108  
 109  $cookie_secure_yes = ( $new['cookie_secure'] ) ? "checked=\"checked\"" : "";
 110  $cookie_secure_no = ( !$new['cookie_secure'] ) ? "checked=\"checked\"" : "";
 111  
 112  $html_tags = $new['allow_html_tags'];
 113  
 114  $override_user_style_yes = ( $new['override_user_style'] ) ? "checked=\"checked\"" : "";
 115  $override_user_style_no = ( !$new['override_user_style'] ) ? "checked=\"checked\"" : "";
 116  
 117  $html_yes = ( $new['allow_html'] ) ? "checked=\"checked\"" : "";
 118  $html_no = ( !$new['allow_html'] ) ? "checked=\"checked\"" : "";
 119  
 120  $bbcode_yes = ( $new['allow_bbcode'] ) ? "checked=\"checked\"" : "";
 121  $bbcode_no = ( !$new['allow_bbcode'] ) ? "checked=\"checked\"" : "";
 122  
 123  $activation_none = ( $new['require_activation'] == USER_ACTIVATION_NONE ) ? "checked=\"checked\"" : "";
 124  $activation_user = ( $new['require_activation'] == USER_ACTIVATION_SELF ) ? "checked=\"checked\"" : "";
 125  $activation_admin = ( $new['require_activation'] == USER_ACTIVATION_ADMIN ) ? "checked=\"checked\"" : "";
 126  
 127  $confirm_yes = ($new['enable_confirm']) ? 'checked="checked"' : ''; 
 128  $confirm_no = (!$new['enable_confirm']) ? 'checked="checked"' : '';
 129  
 130  $allow_autologin_yes = ($new['allow_autologin']) ? 'checked="checked"' : '';
 131  $allow_autologin_no = (!$new['allow_autologin']) ? 'checked="checked"' : '';
 132  
 133  $board_email_form_yes = ( $new['board_email_form'] ) ? "checked=\"checked\"" : "";
 134  $board_email_form_no = ( !$new['board_email_form'] ) ? "checked=\"checked\"" : "";
 135  
 136  $gzip_yes = ( $new['gzip_compress'] ) ? "checked=\"checked\"" : "";
 137  $gzip_no = ( !$new['gzip_compress'] ) ? "checked=\"checked\"" : "";
 138  
 139  $privmsg_on = ( !$new['privmsg_disable'] ) ? "checked=\"checked\"" : "";
 140  $privmsg_off = ( $new['privmsg_disable'] ) ? "checked=\"checked\"" : "";
 141  
 142  $prune_yes = ( $new['prune_enable'] ) ? "checked=\"checked\"" : "";
 143  $prune_no = ( !$new['prune_enable'] ) ? "checked=\"checked\"" : "";
 144  
 145  $auto_lock_yes = ( $new['auto_lock_enable'] ) ? "checked=\"checked\"" : "";
 146  $auto_lock_no = ( !$new['auto_lock_enable'] ) ? "checked=\"checked\"" : "";
 147  
 148  $namechange_yes = ( $new['allow_namechange'] ) ? "checked=\"checked\"" : "";
 149  $namechange_no = ( !$new['allow_namechange'] ) ? "checked=\"checked\"" : "";
 150  
 151  $smtp_yes = ( $new['smtp_delivery'] ) ? "checked=\"checked\"" : "";
 152  $smtp_no = ( !$new['smtp_delivery'] ) ? "checked=\"checked\"" : "";
 153  
 154  $template->set_filenames(array(
 155      "body" => "admin/board_config_body.tpl")
 156  );
 157  
 158  //

 159  // Escape any quotes in the site description for proper display in the text

 160  // box on the admin page 

 161  //

 162  
 163  // BEGIN Disable Registration MOD

 164  $new['registration_closed'] = str_replace('"', '&quot;', $new['registration_closed']);
 165  // END Disable Registration MOD

 166  
 167  
 168  
 169  $template->assign_vars(array(
 170      "S_CONFIG_ACTION" => append_sid("admin_board.$phpEx"),
 171  
 172      "L_YES" => $lang['Yes'],
 173      "L_NO" => $lang['No'],
 174      "L_CONFIGURATION_TITLE" => $lang['General_Config'],
 175      "L_CONFIGURATION_EXPLAIN" => $lang['Config_explain'],
 176      "L_GENERAL_SETTINGS" => $lang['General_settings'],
 177      "L_SERVER_NAME" => $lang['Server_name'], 
 178      "L_SERVER_NAME_EXPLAIN" => $lang['Server_name_explain'], 
 179      "L_SERVER_PORT" => $lang['Server_port'], 
 180      "L_SERVER_PORT_EXPLAIN" => $lang['Server_port_explain'], 
 181      "L_SCRIPT_PATH" => $lang['Script_path'], 
 182      "L_SCRIPT_PATH_EXPLAIN" => $lang['Script_path_explain'], 
 183      "L_DISABLE_BOARD" => $lang['Board_disable'], 
 184      "L_DISABLE_BOARD_EXPLAIN" => $lang['Board_disable_explain'],
 185    // BEGIN Disable Registration MOD

 186    "L_REGISTRATION_STATUS" => $lang['registration_status'],
 187    "L_REGISTRATION_STATUS_EXPLAIN" => $lang['registration_status_explain'], 
 188    "L_REGISTRATION_CLOSED" => $lang['registration_closed'],
 189    "L_REGISTRATION_CLOSED_EXPLAIN" => $lang['registration_closed_explain'],
 190    // END Disable Registration MOD

 191  
 192  // - add mods : admin_disable_board_message -------------------------------------------------------------------

 193      "L_MESSAGE_DISABLE_BOARD" => $lang['board_disable_message'],
 194      "L_MESSAGE_DISABLE_BOARD_TEXT" => $lang['board_disable_message_texte'],    
 195  // - end add mods : admin_disable_board_message ---------------------------------------------------------------

 196  
 197      "L_ACCT_ACTIVATION" => $lang['Acct_activation'], 
 198      "L_NONE" => $lang['Acc_None'], 
 199      "L_USER" => $lang['Acc_User'], 
 200      "L_ADMIN" => $lang['Acc_Admin'],
 201      "L_VISUAL_CONFIRM" => $lang['Visual_confirm'], 
 202      "L_VISUAL_CONFIRM_EXPLAIN" => $lang['Visual_confirm_explain'],
 203      "L_ALLOW_AUTOLOGIN" => $lang['Allow_autologin'],
 204      "L_ALLOW_AUTOLOGIN_EXPLAIN" => $lang['Allow_autologin_explain'],
 205      "L_AUTOLOGIN_TIME" => $lang['Autologin_time'],
 206      "L_AUTOLOGIN_TIME_EXPLAIN" => $lang['Autologin_time_explain'],
 207      'L_MAX_LOGIN_ATTEMPTS'            => $lang['Max_login_attempts'],
 208      'L_MAX_LOGIN_ATTEMPTS_EXPLAIN'    => $lang['Max_login_attempts_explain'],
 209      'L_LOGIN_RESET_TIME'            => $lang['Login_reset_time'],
 210      'L_LOGIN_RESET_TIME_EXPLAIN'    => $lang['Login_reset_time_explain'],
 211      'MAX_LOGIN_ATTEMPTS'            => $new['max_login_attempts'],
 212      'LOGIN_RESET_TIME'                => $new['login_reset_time'], 
 213      "L_COOKIE_SETTINGS" => $lang['Cookie_settings'], 
 214      "L_COOKIE_SETTINGS_EXPLAIN" => $lang['Cookie_settings_explain'], 
 215      "L_COOKIE_DOMAIN" => $lang['Cookie_domain'],
 216      "L_COOKIE_NAME" => $lang['Cookie_name'], 
 217      "L_COOKIE_PATH" => $lang['Cookie_path'], 
 218      "L_COOKIE_SECURE" => $lang['Cookie_secure'], 
 219      "L_COOKIE_SECURE_EXPLAIN" => $lang['Cookie_secure_explain'], 
 220      "L_SESSION_LENGTH" => $lang['Session_length'], 
 221      "L_PRIVATE_MESSAGING" => $lang['Private_Messaging'], 
 222      "L_INBOX_LIMIT" => $lang['Inbox_limits'], 
 223      "L_SENTBOX_LIMIT" => $lang['Sentbox_limits'], 
 224      "L_SAVEBOX_LIMIT" => $lang['Savebox_limits'], 
 225      "L_DISABLE_PRIVATE_MESSAGING" => $lang['Disable_privmsg'], 
 226      "L_ENABLED" => $lang['Enabled'], 
 227      "L_DISABLED" => $lang['Disabled'],
 228      "L_SEARCH_FLOOD_INTERVAL" => $lang['Search_Flood_Interval'],
 229      "L_SEARCH_FLOOD_INTERVAL_EXPLAIN" => $lang['Search_Flood_Interval_explain'], 
 230      "L_ABILITIES_SETTINGS" => $lang['Abilities_settings'], 
 231      "L_BOARD_EMAIL_FORM" => $lang['Board_email_form'], 
 232      "L_BOARD_EMAIL_FORM_EXPLAIN" => $lang['Board_email_form_explain'], 
 233      "L_DEFAULT_STYLE" => $lang['Default_style'],
 234      "L_OVERRIDE_STYLE" => $lang['Override_style'],
 235      "L_OVERRIDE_STYLE_EXPLAIN" => $lang['Override_style_explain'],
 236      "L_DEFAULT_LANGUAGE" => $lang['Default_language'],
 237      "L_DATE_FORMAT" => $lang['Date_format'],
 238      "L_SYSTEM_TIMEZONE" => $lang['System_timezone'],
 239      "L_ENABLE_GZIP" => $lang['Enable_gzip'],
 240      "L_ENABLE_PRUNE" => $lang['Enable_prune'],
 241      "L_ENABLE_AUTO_LOCK" => $lang['Enable_auto_lock'],
 242      "L_ALLOW_HTML" => $lang['Allow_HTML'],
 243      "L_ALLOW_BBCODE" => $lang['Allow_BBCode'],
 244      "L_ALLOWED_TAGS" => $lang['Allowed_tags'],
 245      "L_ALLOWED_TAGS_EXPLAIN" => $lang['Allowed_tags_explain'],
 246      "L_COPPA_SETTINGS" => $lang['COPPA_settings'],
 247      "L_COPPA_FAX" => $lang['COPPA_fax'],
 248      "L_COPPA_MAIL" => $lang['COPPA_mail'],
 249      "L_COPPA_MAIL_EXPLAIN" => $lang['COPPA_mail_explain'],
 250      "L_EMAIL_SETTINGS" => $lang['Email_settings'],
 251      "L_ADMIN_EMAIL" => $lang['Admin_email'],
 252      "L_EMAIL_SIG" => $lang['Email_sig'],
 253      "L_EMAIL_SIG_EXPLAIN" => $lang['Email_sig_explain'],
 254      "L_USE_SMTP" => $lang['Use_SMTP'],
 255      "L_USE_SMTP_EXPLAIN" => $lang['Use_SMTP_explain'],
 256      "L_SMTP_SERVER" => $lang['SMTP_server'], 
 257      "L_SMTP_USERNAME" => $lang['SMTP_username'], 
 258      "L_SMTP_USERNAME_EXPLAIN" => $lang['SMTP_username_explain'], 
 259      "L_SMTP_PASSWORD" => $lang['SMTP_password'], 
 260      "L_SMTP_PASSWORD_EXPLAIN" => $lang['SMTP_password_explain'],
 261      "L_SUBMIT" => $lang['Submit'], 
 262      "L_RESET" => $lang['Reset'],
 263      "SERVER_NAME" => $new['server_name'], 
 264      "SCRIPT_PATH" => $new['script_path'], 
 265      "SERVER_PORT" => $new['server_port'],  
 266  
 267  // - add mods : admin_disable_board_message -------------------------------------------------------------------

 268      "BOARD_DISABLE_MESSAGE" => $new['board_disable_message'],
 269  // - end add mods : admin_disable_board_message ---------------------------------------------------------------

 270      
 271      "S_DISABLE_BOARD_YES" => $disable_board_yes,
 272      "S_DISABLE_BOARD_NO" => $disable_board_no,
 273    // BEGIN Disable Registration MOD

 274    "S_REGISTRATION_STATUS_YES" => $registration_status_yes,
 275    "S_REGISTRATION_STATUS_NO" => $registration_status_no,
 276    "REGISTRATION_CLOSED" => $new['registration_closed'], 
 277    // END Disable Registration MOD 

 278  
 279  // - add mods : admin_disable_board_message -------------------------------------------------------------------

 280      "S_MESSAGE_DISABLE_BOARD_NO" => $message_disable_board_no,
 281      "S_MESSAGE_DISABLE_BOARD_YES" => $message_disable_board_yes,
 282  // - end add mods : admin_disable_board_message ---------------------------------------------------------------

 283  
 284      "ACTIVATION_NONE" => USER_ACTIVATION_NONE, 
 285      "ACTIVATION_NONE_CHECKED" => $activation_none,
 286      "ACTIVATION_USER" => USER_ACTIVATION_SELF, 
 287      "ACTIVATION_USER_CHECKED" => $activation_user,
 288      "ACTIVATION_ADMIN" => USER_ACTIVATION_ADMIN, 
 289      "ACTIVATION_ADMIN_CHECKED" => $activation_admin, 
 290      "CONFIRM_ENABLE" => $confirm_yes,
 291      "CONFIRM_DISABLE" => $confirm_no,
 292      "ACTIVATION_NONE_CHECKED" => $activation_none,
 293      "STYLE_SELECT" => $style_select,
 294      "OVERRIDE_STYLE_YES" => $override_user_style_yes,
 295      "OVERRIDE_STYLE_NO" => $override_user_style_no,
 296      "LANG_SELECT" => $lang_select,
 297      "L_DATE_FORMAT_EXPLAIN" => $lang['Date_format_explain'],
 298      "DEFAULT_DATEFORMAT" => admin_date_format_select($new['default_dateformat'], $timezone_select),
 299      "TIMEZONE_SELECT" => $timezone_select,
 300      "BOARD_EMAIL_FORM_ENABLE" => $board_email_form_yes, 
 301      "BOARD_EMAIL_FORM_DISABLE" => $board_email_form_no,
 302      'ALLOW_AUTOLOGIN_YES' => $allow_autologin_yes,
 303      'ALLOW_AUTOLOGIN_NO' => $allow_autologin_no,
 304      'AUTOLOGIN_TIME' => (int) $new['max_autologin_time'],
 305      "S_PRIVMSG_ENABLED" => $privmsg_on, 
 306      "S_PRIVMSG_DISABLED" => $privmsg_off, 
 307      "INBOX_LIMIT" => $new['max_inbox_privmsgs'], 
 308      "SENTBOX_LIMIT" => $new['max_sentbox_privmsgs'],
 309      "SAVEBOX_LIMIT" => $new['max_savebox_privmsgs'],
 310      "COOKIE_DOMAIN" => $new['cookie_domain'], 
 311      "COOKIE_NAME" => $new['cookie_name'], 
 312      "COOKIE_PATH" => $new['cookie_path'], 
 313      "SESSION_LENGTH" => $new['session_length'], 
 314      "S_COOKIE_SECURE_ENABLED" => $cookie_secure_yes, 
 315      "S_COOKIE_SECURE_DISABLED" => $cookie_secure_no,
 316      "SEARCH_FLOOD_INTERVAL" => $new['search_flood_interval'], 
 317      "GZIP_YES" => $gzip_yes,
 318      "GZIP_NO" => $gzip_no,
 319      "PRUNE_YES" => $prune_yes,
 320      "PRUNE_NO" => $prune_no,
 321      "AUTO_LOCK_YES" => $auto_lock_yes,
 322      "AUTO_LOCK_NO" => $auto_lock_no,
 323      "HTML_TAGS" => $html_tags, 
 324      "HTML_YES" => $html_yes,
 325      "HTML_NO" => $html_no,
 326      "BBCODE_YES" => $bbcode_yes,
 327      "BBCODE_NO" => $bbcode_no,
 328      "NAMECHANGE_YES" => $namechange_yes,
 329      "NAMECHANGE_NO" => $namechange_no,
 330      "CUSTOM_RANK" => $new['allow_custom_rank'], 
 331      "L_ALLOW_CUSTOM_RANK" => $lang['Allow_custom_rank'],
 332      "L_ALLOW_CUSTOM_RANK_EXPLAIN" => $lang['Allow_custom_rank_explain'], 
 333      "INBOX_PRIVMSGS" => $new['max_inbox_privmsgs'], 
 334      "SENTBOX_PRIVMSGS" => $new['max_sentbox_privmsgs'], 
 335      "SAVEBOX_PRIVMSGS" => $new['max_savebox_privmsgs'], 
 336      "EMAIL_FROM" => $new['board_email'],
 337      "EMAIL_SIG" => $new['board_email_sig'],
 338      "SMTP_YES" => $smtp_yes,
 339      "SMTP_NO" => $smtp_no,
 340      "SMTP_HOST" => $new['smtp_host'],
 341      "SMTP_USERNAME" => $new['smtp_username'],
 342      "SMTP_PASSWORD" => $new['smtp_password'],
 343      "COPPA_MAIL" => $new['coppa_mail'],
 344      "COPPA_FAX" => $new['coppa_fax'])
 345  );
 346  
 347  $template->pparse("body");
 348  
 349  include('./page_footer_admin.'.$phpEx);
 350  
 351  ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]