[ Index ]

PHP Cross Reference of phpBB-3.2.8-deutsch

title

Body

[close]

/includes/acp/ -> acp_board.php (source)

   1  <?php
   2  /**
   3  *
   4  * This file is part of the phpBB Forum Software package.
   5  *
   6  * @copyright (c) phpBB Limited <https://www.phpbb.com>
   7  * @license GNU General Public License, version 2 (GPL-2.0)
   8  *
   9  * For full copyright and license information, please see
  10  * the docs/CREDITS.txt file.
  11  *
  12  */
  13  
  14  /**
  15  * @todo add cron intervals to server settings? (database_gc, queue_interval, session_gc, search_gc, cache_gc, warnings_gc)
  16  */
  17  
  18  /**
  19  * @ignore
  20  */
  21  if (!defined('IN_PHPBB'))
  22  {
  23      exit;
  24  }
  25  
  26  class acp_board
  27  {
  28      var $u_action;
  29      var $new_config;
  30  
  31  	function main($id, $mode)
  32      {
  33          global $user, $template, $request, $language;
  34          global $config, $phpbb_root_path, $phpEx;
  35          global $cache, $phpbb_container, $phpbb_dispatcher, $phpbb_log;
  36  
  37          /** @var \phpbb\language\language $language Language object */
  38          $language = $phpbb_container->get('language');
  39  
  40          $user->add_lang('acp/board');
  41  
  42          $submit = (isset($_POST['submit']) || isset($_POST['allow_quick_reply_enable'])) ? true : false;
  43  
  44          $form_key = 'acp_board';
  45          add_form_key($form_key);
  46  
  47          /**
  48          *    Validation types are:
  49          *        string, int, bool,
  50          *        script_path (absolute path in url - beginning with / and no trailing slash),
  51          *        rpath (relative), rwpath (realtive, writable), path (relative path, but able to escape the root), wpath (writable)
  52          */
  53          switch ($mode)
  54          {
  55              case 'settings':
  56                  $display_vars = array(
  57                      'title'    => 'ACP_BOARD_SETTINGS',
  58                      'vars'    => array(
  59                          'legend1'                => 'ACP_BOARD_SETTINGS',
  60                          'sitename'                => array('lang' => 'SITE_NAME',                'validate' => 'string',    'type' => 'text:40:255', 'explain' => false),
  61                          'site_desc'                => array('lang' => 'SITE_DESC',                'validate' => 'string',    'type' => 'text:40:255', 'explain' => false),
  62                          'site_home_url'            => array('lang' => 'SITE_HOME_URL',            'validate' => 'url',    'type' => 'url:40:255', 'explain' => true),
  63                          'site_home_text'        => array('lang' => 'SITE_HOME_TEXT',        'validate' => 'string',    'type' => 'text:40:255', 'explain' => true),
  64                          'board_index_text'        => array('lang' => 'BOARD_INDEX_TEXT',        'validate' => 'string',    'type' => 'text:40:255', 'explain' => true),
  65                          'board_disable'            => array('lang' => 'DISABLE_BOARD',            'validate' => 'bool',    'type' => 'custom', 'method' => 'board_disable', 'explain' => true),
  66                          'board_disable_msg'        => false,
  67                          'default_lang'            => array('lang' => 'DEFAULT_LANGUAGE',        'validate' => 'lang',    'type' => 'select', 'function' => 'language_select', 'params' => array('{CONFIG_VALUE}'), 'explain' => false),
  68                          'default_dateformat'    => array('lang' => 'DEFAULT_DATE_FORMAT',    'validate' => 'string',    'type' => 'custom', 'method' => 'dateformat_select', 'explain' => true),
  69                          'board_timezone'        => array('lang' => 'SYSTEM_TIMEZONE',        'validate' => 'timezone',    'type' => 'custom', 'method' => 'timezone_select', 'explain' => true),
  70  
  71                          'legend2'                => 'BOARD_STYLE',
  72                          'default_style'            => array('lang' => 'DEFAULT_STYLE',            'validate' => 'int',    'type' => 'select', 'function' => 'style_select', 'params' => array('{CONFIG_VALUE}', false), 'explain' => true),
  73                          'guest_style'            => array('lang' => 'GUEST_STYLE',            'validate' => 'int',    'type' => 'select', 'function' => 'style_select', 'params' => array($this->guest_style_get(), false), 'explain' => true),
  74                          'override_user_style'    => array('lang' => 'OVERRIDE_STYLE',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
  75  
  76                          'legend3'                => 'WARNINGS',
  77                          'warnings_expire_days'    => array('lang' => 'WARNINGS_EXPIRE',        'validate' => 'int:0:9999',    'type' => 'number:0:9999', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']),
  78  
  79                          'legend4'                    => 'ACP_SUBMIT_CHANGES',
  80                      )
  81                  );
  82              break;
  83  
  84              case 'features':
  85                  $display_vars = array(
  86                      'title'    => 'ACP_BOARD_FEATURES',
  87                      'vars'    => array(
  88                          'legend1'                => 'ACP_BOARD_FEATURES',
  89                          'allow_privmsg'            => array('lang' => 'BOARD_PM',                'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
  90                          'allow_topic_notify'    => array('lang' => 'ALLOW_TOPIC_NOTIFY',    'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
  91                          'allow_forum_notify'    => array('lang' => 'ALLOW_FORUM_NOTIFY',    'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
  92                          'allow_namechange'        => array('lang' => 'ALLOW_NAME_CHANGE',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
  93                          'allow_attachments'        => array('lang' => 'ALLOW_ATTACHMENTS',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
  94                          'allow_pm_attach'        => array('lang' => 'ALLOW_PM_ATTACHMENTS',    'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
  95                          'allow_pm_report'        => array('lang' => 'ALLOW_PM_REPORT',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
  96                          'allow_bbcode'            => array('lang' => 'ALLOW_BBCODE',            'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
  97                          'allow_smilies'            => array('lang' => 'ALLOW_SMILIES',            'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
  98                          'allow_sig'                => array('lang' => 'ALLOW_SIG',                'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
  99                          'allow_board_notifications'        => array('lang' => 'ALLOW_BOARD_NOTIFICATIONS',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
 100                          'allow_nocensors'        => array('lang' => 'ALLOW_NO_CENSORS',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 101                          'allow_bookmarks'        => array('lang' => 'ALLOW_BOOKMARKS',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 102                          'allow_birthdays'        => array('lang' => 'ALLOW_BIRTHDAYS',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 103                          'display_last_subject'    => array('lang' => 'DISPLAY_LAST_SUBJECT',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 104                          'allow_quick_reply'        => array('lang' => 'ALLOW_QUICK_REPLY',        'validate' => 'bool',    'type' => 'custom', 'method' => 'quick_reply', 'explain' => true),
 105  
 106                          'legend2'                => 'ACP_LOAD_SETTINGS',
 107                          'load_birthdays'        => array('lang' => 'YES_BIRTHDAYS',            'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 108                          'load_moderators'        => array('lang' => 'YES_MODERATORS',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
 109                          'load_jumpbox'            => array('lang' => 'YES_JUMPBOX',            'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
 110                          'load_cpf_memberlist'    => array('lang' => 'LOAD_CPF_MEMBERLIST',    'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
 111                          'load_cpf_pm'            => array('lang' => 'LOAD_CPF_PM',            'validate' => 'bool',    'type' => 'radio:yes_no', 'explain'    => false),
 112                          'load_cpf_viewprofile'    => array('lang' => 'LOAD_CPF_VIEWPROFILE',    'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
 113                          'load_cpf_viewtopic'    => array('lang' => 'LOAD_CPF_VIEWTOPIC',    'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
 114  
 115                          'legend3'                    => 'ACP_SUBMIT_CHANGES',
 116                      )
 117                  );
 118              break;
 119  
 120              case 'avatar':
 121                  /* @var $phpbb_avatar_manager \phpbb\avatar\manager */
 122                  $phpbb_avatar_manager = $phpbb_container->get('avatar.manager');
 123                  $avatar_drivers = $phpbb_avatar_manager->get_all_drivers();
 124  
 125                  $avatar_vars = array();
 126                  foreach ($avatar_drivers as $current_driver)
 127                  {
 128                      /** @var \phpbb\avatar\driver\driver_interface $driver */
 129                      $driver = $phpbb_avatar_manager->get_driver($current_driver, false);
 130  
 131                      /*
 132                      * First grab the settings for enabling/disabling the avatar
 133                      * driver and afterwards grab additional settings the driver
 134                      * might have.
 135                      */
 136                      $avatar_vars += $phpbb_avatar_manager->get_avatar_settings($driver);
 137                      $avatar_vars += $driver->prepare_form_acp($user);
 138                  }
 139  
 140                  $display_vars = array(
 141                      'title'    => 'ACP_AVATAR_SETTINGS',
 142                      'vars'    => array(
 143                          'legend1'                => 'ACP_AVATAR_SETTINGS',
 144  
 145                          'avatar_min_width'        => array('lang' => 'MIN_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false),
 146                          'avatar_min_height'        => array('lang' => 'MIN_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false),
 147                          'avatar_max_width'        => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false),
 148                          'avatar_max_height'        => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false),
 149  
 150                          'allow_avatar'            => array('lang' => 'ALLOW_AVATARS',            'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 151                          'avatar_min'            => array('lang' => 'MIN_AVATAR_SIZE',        'validate' => 'int:0',    'type' => 'dimension:0', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
 152                          'avatar_max'            => array('lang' => 'MAX_AVATAR_SIZE',        'validate' => 'int:0',    'type' => 'dimension:0', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
 153                      )
 154                  );
 155  
 156                  if (!empty($avatar_vars))
 157                  {
 158                      $display_vars['vars'] += $avatar_vars;
 159                  }
 160              break;
 161  
 162              case 'message':
 163                  $display_vars = array(
 164                      'title'    => 'ACP_MESSAGE_SETTINGS',
 165                      'lang'    => 'ucp',
 166                      'vars'    => array(
 167                          'legend1'                => 'GENERAL_SETTINGS',
 168                          'allow_privmsg'            => array('lang' => 'BOARD_PM',                'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 169                          'pm_max_boxes'            => array('lang' => 'BOXES_MAX',                'validate' => 'int:0:9999',    'type' => 'number:0:9999', 'explain' => true),
 170                          'pm_max_msgs'            => array('lang' => 'BOXES_LIMIT',            'validate' => 'int:0:9999',    'type' => 'number:0:9999', 'explain' => true),
 171                          'full_folder_action'    => array('lang' => 'FULL_FOLDER_ACTION',    'validate' => 'int',    'type' => 'select', 'method' => 'full_folder_select', 'explain' => true),
 172                          'pm_edit_time'            => array('lang' => 'PM_EDIT_TIME',            'validate' => 'int:0:99999',    'type' => 'number:0:99999', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
 173                          'pm_max_recipients'        => array('lang' => 'PM_MAX_RECIPIENTS',        'validate' => 'int:0:99999',    'type' => 'number:0:99999', 'explain' => true),
 174  
 175                          'legend2'                => 'GENERAL_OPTIONS',
 176                          'allow_mass_pm'            => array('lang' => 'ALLOW_MASS_PM',            'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
 177                          'auth_bbcode_pm'        => array('lang' => 'ALLOW_BBCODE_PM',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
 178                          'auth_smilies_pm'        => array('lang' => 'ALLOW_SMILIES_PM',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
 179                          'allow_pm_attach'        => array('lang' => 'ALLOW_PM_ATTACHMENTS',    'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
 180                          'allow_sig_pm'            => array('lang' => 'ALLOW_SIG_PM',            'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
 181                          'print_pm'                => array('lang' => 'ALLOW_PRINT_PM',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
 182                          'forward_pm'            => array('lang' => 'ALLOW_FORWARD_PM',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
 183                          'auth_img_pm'            => array('lang' => 'ALLOW_IMG_PM',            'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
 184                          'auth_flash_pm'            => array('lang' => 'ALLOW_FLASH_PM',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 185                          'enable_pm_icons'        => array('lang' => 'ENABLE_PM_ICONS',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
 186  
 187                          'legend3'                    => 'ACP_SUBMIT_CHANGES',
 188                      )
 189                  );
 190              break;
 191  
 192              case 'post':
 193                  $display_vars = array(
 194                      'title'    => 'ACP_POST_SETTINGS',
 195                      'vars'    => array(
 196                          'legend1'                => 'GENERAL_OPTIONS',
 197                          'allow_topic_notify'    => array('lang' => 'ALLOW_TOPIC_NOTIFY',    'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
 198                          'allow_forum_notify'    => array('lang' => 'ALLOW_FORUM_NOTIFY',    'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
 199                          'allow_bbcode'            => array('lang' => 'ALLOW_BBCODE',            'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
 200                          'allow_post_flash'        => array('lang' => 'ALLOW_POST_FLASH',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 201                          'allow_smilies'            => array('lang' => 'ALLOW_SMILIES',            'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
 202                          'allow_post_links'        => array('lang' => 'ALLOW_POST_LINKS',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 203                          'allowed_schemes_links'    => array('lang' => 'ALLOWED_SCHEMES_LINKS',    'validate' => 'string',    'type' => 'text:0:255', 'explain' => true),
 204                          'allow_nocensors'        => array('lang' => 'ALLOW_NO_CENSORS',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 205                          'allow_bookmarks'        => array('lang' => 'ALLOW_BOOKMARKS',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 206                          'enable_post_confirm'    => array('lang' => 'VISUAL_CONFIRM_POST',    'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 207                          'allow_quick_reply'        => array('lang' => 'ALLOW_QUICK_REPLY',        'validate' => 'bool',    'type' => 'custom', 'method' => 'quick_reply', 'explain' => true),
 208  
 209                          'legend2'                => 'POSTING',
 210                          'bump_type'                => false,
 211                          'edit_time'                => array('lang' => 'EDIT_TIME',                'validate' => 'int:0:99999',        'type' => 'number:0:99999', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
 212                          'delete_time'            => array('lang' => 'DELETE_TIME',            'validate' => 'int:0:99999',        'type' => 'number:0:99999', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
 213                          'display_last_edited'    => array('lang' => 'DISPLAY_LAST_EDITED',    'validate' => 'bool',        'type' => 'radio:yes_no', 'explain' => true),
 214                          'flood_interval'        => array('lang' => 'FLOOD_INTERVAL',        'validate' => 'int:0:9999999999',        'type' => 'number:0:9999999999', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']),
 215                          'bump_interval'            => array('lang' => 'BUMP_INTERVAL',            'validate' => 'int:0',        'type' => 'custom', 'method' => 'bump_interval', 'explain' => true),
 216                          'topics_per_page'        => array('lang' => 'TOPICS_PER_PAGE',        'validate' => 'int:1:9999',        'type' => 'number:1:9999', 'explain' => false),
 217                          'posts_per_page'        => array('lang' => 'POSTS_PER_PAGE',        'validate' => 'int:1:9999',        'type' => 'number:1:9999', 'explain' => false),
 218                          'smilies_per_page'        => array('lang' => 'SMILIES_PER_PAGE',        'validate' => 'int:1:9999',        'type' => 'number:1:9999', 'explain' => false),
 219                          'hot_threshold'            => array('lang' => 'HOT_THRESHOLD',            'validate' => 'int:0:9999',        'type' => 'number:0:9999', 'explain' => true),
 220                          'max_poll_options'        => array('lang' => 'MAX_POLL_OPTIONS',        'validate' => 'int:2:127',    'type' => 'number:2:127', 'explain' => false),
 221                          'max_post_chars'        => array('lang' => 'CHAR_LIMIT',            'validate' => 'int:0:999999',        'type' => 'number:0:999999', 'explain' => true),
 222                          'min_post_chars'        => array('lang' => 'MIN_CHAR_LIMIT',        'validate' => 'int:1:999999',        'type' => 'number:1:999999', 'explain' => true),
 223                          'max_post_smilies'        => array('lang' => 'SMILIES_LIMIT',            'validate' => 'int:0:9999',        'type' => 'number:0:9999', 'explain' => true),
 224                          'max_post_urls'            => array('lang' => 'MAX_POST_URLS',            'validate' => 'int:0:9999',        'type' => 'number:0:9999', 'explain' => true),
 225                          'max_post_font_size'    => array('lang' => 'MAX_POST_FONT_SIZE',    'validate' => 'int:0:9999',        'type' => 'number:0:9999', 'explain' => true, 'append' => ' %'),
 226                          'max_quote_depth'        => array('lang' => 'QUOTE_DEPTH_LIMIT',        'validate' => 'int:0:9999',        'type' => 'number:0:9999', 'explain' => true),
 227                          'max_post_img_width'    => array('lang' => 'MAX_POST_IMG_WIDTH',    'validate' => 'int:0:9999',        'type' => 'number:0:9999', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
 228                          'max_post_img_height'    => array('lang' => 'MAX_POST_IMG_HEIGHT',    'validate' => 'int:0:9999',        'type' => 'number:0:9999', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
 229  
 230                          'legend3'                    => 'ACP_SUBMIT_CHANGES',
 231                      )
 232                  );
 233              break;
 234  
 235              case 'signature':
 236                  $display_vars = array(
 237                      'title'    => 'ACP_SIGNATURE_SETTINGS',
 238                      'vars'    => array(
 239                          'legend1'                => 'GENERAL_OPTIONS',
 240                          'allow_sig'                => array('lang' => 'ALLOW_SIG',                'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
 241                          'allow_sig_bbcode'        => array('lang' => 'ALLOW_SIG_BBCODE',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
 242                          'allow_sig_img'            => array('lang' => 'ALLOW_SIG_IMG',            'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
 243                          'allow_sig_flash'        => array('lang' => 'ALLOW_SIG_FLASH',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
 244                          'allow_sig_smilies'        => array('lang' => 'ALLOW_SIG_SMILIES',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
 245                          'allow_sig_links'        => array('lang' => 'ALLOW_SIG_LINKS',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 246  
 247                          'legend2'                => 'GENERAL_SETTINGS',
 248                          'max_sig_chars'            => array('lang' => 'MAX_SIG_LENGTH',        'validate' => 'int:0:9999',    'type' => 'number:0:9999', 'explain' => true),
 249                          'max_sig_urls'            => array('lang' => 'MAX_SIG_URLS',            'validate' => 'int:0:9999',    'type' => 'number:0:9999', 'explain' => true),
 250                          'max_sig_font_size'        => array('lang' => 'MAX_SIG_FONT_SIZE',        'validate' => 'int:0:9999',    'type' => 'number:0:9999', 'explain' => true, 'append' => ' %'),
 251                          'max_sig_smilies'        => array('lang' => 'MAX_SIG_SMILIES',        'validate' => 'int:0:9999',    'type' => 'number:0:9999', 'explain' => true),
 252                          'max_sig_img_width'        => array('lang' => 'MAX_SIG_IMG_WIDTH',        'validate' => 'int:0:9999',    'type' => 'number:0:9999', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
 253                          'max_sig_img_height'    => array('lang' => 'MAX_SIG_IMG_HEIGHT',    'validate' => 'int:0:9999',    'type' => 'number:0:9999', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
 254  
 255                          'legend3'                    => 'ACP_SUBMIT_CHANGES',
 256                      )
 257                  );
 258              break;
 259  
 260              case 'registration':
 261                  $display_vars = array(
 262                      'title'    => 'ACP_REGISTER_SETTINGS',
 263                      'vars'    => array(
 264                          'legend1'                => 'GENERAL_SETTINGS',
 265                          'max_name_chars'        => array('lang' => 'USERNAME_LENGTH', 'validate' => 'int:8:180', 'type' => false, 'method' => false, 'explain' => false,),
 266                          'max_pass_chars'        => array('lang' => 'PASSWORD_LENGTH', 'validate' => 'int:8:255', 'type' => false, 'method' => false, 'explain' => false,),
 267  
 268                          'require_activation'    => array('lang' => 'ACC_ACTIVATION',    'validate' => 'int',    'type' => 'select', 'method' => 'select_acc_activation', 'explain' => true),
 269                          'new_member_post_limit'    => array('lang' => 'NEW_MEMBER_POST_LIMIT', 'validate' => 'int:0:255', 'type' => 'number:0:255', 'explain' => true, 'append' => ' ' . $user->lang['POSTS']),
 270                          'new_member_group_default'=> array('lang' => 'NEW_MEMBER_GROUP_DEFAULT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
 271                          'min_name_chars'        => array('lang' => 'USERNAME_LENGTH',    'validate' => 'int:1',    'type' => 'custom:5:180', 'method' => 'username_length', 'explain' => true),
 272                          'min_pass_chars'        => array('lang' => 'PASSWORD_LENGTH',    'validate' => 'int:1',    'type' => 'custom', 'method' => 'password_length', 'explain' => true),
 273                          'allow_name_chars'        => array('lang' => 'USERNAME_CHARS',    'validate' => 'string',    'type' => 'select', 'method' => 'select_username_chars', 'explain' => true),
 274                          'pass_complex'            => array('lang' => 'PASSWORD_TYPE',        'validate' => 'string',    'type' => 'select', 'method' => 'select_password_chars', 'explain' => true),
 275                          'chg_passforce'            => array('lang' => 'FORCE_PASS_CHANGE',    'validate' => 'int:0:999',    'type' => 'number:0:999', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']),
 276  
 277                          'legend2'                => 'GENERAL_OPTIONS',
 278                          'allow_namechange'        => array('lang' => 'ALLOW_NAME_CHANGE',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
 279                          'allow_emailreuse'        => array('lang' => 'ALLOW_EMAIL_REUSE',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 280                          'enable_confirm'        => array('lang' => 'VISUAL_CONFIRM_REG',    'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 281                          'max_login_attempts'    => array('lang' => 'MAX_LOGIN_ATTEMPTS',    'validate' => 'int:0:999',    'type' => 'number:0:999', 'explain' => true),
 282                          'max_reg_attempts'        => array('lang' => 'REG_LIMIT',                'validate' => 'int:0:9999',    'type' => 'number:0:9999', 'explain' => true),
 283  
 284                          'legend3'            => 'COPPA',
 285                          'coppa_enable'        => array('lang' => 'ENABLE_COPPA',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 286                          'coppa_mail'        => array('lang' => 'COPPA_MAIL',        'validate' => 'string',    'type' => 'textarea:5:40', 'explain' => true),
 287                          'coppa_fax'            => array('lang' => 'COPPA_FAX',            'validate' => 'string',    'type' => 'text:25:100', 'explain' => false),
 288  
 289                          'legend4'            => 'ACP_SUBMIT_CHANGES',
 290                      )
 291                  );
 292              break;
 293  
 294              case 'feed':
 295                  $display_vars = array(
 296                      'title'    => 'ACP_FEED_MANAGEMENT',
 297                      'vars'    => array(
 298                          'legend1'                    => 'ACP_FEED_GENERAL',
 299                          'feed_enable'                => array('lang' => 'ACP_FEED_ENABLE',                'validate' => 'bool',    'type' => 'radio:enabled_disabled',    'explain' => true ),
 300                          'feed_item_statistics'        => array('lang' => 'ACP_FEED_ITEM_STATISTICS',        'validate' => 'bool',    'type' => 'radio:enabled_disabled',    'explain' => true),
 301                          'feed_http_auth'            => array('lang' => 'ACP_FEED_HTTP_AUTH',            'validate' => 'bool',    'type' => 'radio:enabled_disabled',    'explain' => true),
 302  
 303                          'legend2'                    => 'ACP_FEED_POST_BASED',
 304                          'feed_limit_post'            => array('lang' => 'ACP_FEED_LIMIT',                'validate' => 'int:5:9999',    'type' => 'number:5:9999',                'explain' => true),
 305                          'feed_overall'                => array('lang' => 'ACP_FEED_OVERALL',                'validate' => 'bool',    'type' => 'radio:enabled_disabled',    'explain' => true ),
 306                          'feed_forum'                => array('lang' => 'ACP_FEED_FORUM',                'validate' => 'bool',    'type' => 'radio:enabled_disabled',    'explain' => true ),
 307                          'feed_topic'                => array('lang' => 'ACP_FEED_TOPIC',                'validate' => 'bool',    'type' => 'radio:enabled_disabled',    'explain' => true ),
 308  
 309                          'legend3'                    => 'ACP_FEED_TOPIC_BASED',
 310                          'feed_limit_topic'            => array('lang' => 'ACP_FEED_LIMIT',                'validate' => 'int:5:9999',    'type' => 'number:5:9999',                'explain' => true),
 311                          'feed_topics_new'            => array('lang' => 'ACP_FEED_TOPICS_NEW',            'validate' => 'bool',    'type' => 'radio:enabled_disabled',    'explain' => true ),
 312                          'feed_topics_active'        => array('lang' => 'ACP_FEED_TOPICS_ACTIVE',        'validate' => 'bool',    'type' => 'radio:enabled_disabled',    'explain' => true ),
 313                          'feed_news_id'                => array('lang' => 'ACP_FEED_NEWS',                    'validate' => 'string',    'type' => 'custom', 'method' => 'select_news_forums', 'explain' => true),
 314  
 315                          'legend4'                    => 'ACP_FEED_SETTINGS_OTHER',
 316                          'feed_overall_forums'        => array('lang'    => 'ACP_FEED_OVERALL_FORUMS',        'validate' => 'bool',    'type' => 'radio:enabled_disabled',    'explain' => true ),
 317                          'feed_exclude_id'            => array('lang' => 'ACP_FEED_EXCLUDE_ID',            'validate' => 'string',    'type' => 'custom', 'method' => 'select_exclude_forums', 'explain' => true),
 318                      )
 319                  );
 320              break;
 321  
 322              case 'cookie':
 323                  $display_vars = array(
 324                      'title'    => 'ACP_COOKIE_SETTINGS',
 325                      'vars'    => array(
 326                          'legend1'        => 'ACP_COOKIE_SETTINGS',
 327                          'cookie_domain'    => array('lang' => 'COOKIE_DOMAIN',    'validate' => 'string',    'type' => 'text::255', 'explain' => true),
 328                          'cookie_name'    => array('lang' => 'COOKIE_NAME',    'validate' => 'string',    'type' => 'text::16', 'explain' => true),
 329                          'cookie_path'    => array('lang'    => 'COOKIE_PATH',    'validate' => 'string',    'type' => 'text::255', 'explain' => true),
 330                          'cookie_secure'    => array('lang' => 'COOKIE_SECURE',    'validate' => 'bool',    'type' => 'radio:enabled_disabled', 'explain' => true),
 331                          'cookie_notice'    => array('lang' => 'COOKIE_NOTICE',    'validate' => 'bool',    'type' => 'radio:enabled_disabled', 'explain' => true),
 332                      )
 333                  );
 334              break;
 335  
 336              case 'load':
 337                  $display_vars = array(
 338                      'title'    => 'ACP_LOAD_SETTINGS',
 339                      'vars'    => array(
 340                          'legend1'            => 'GENERAL_SETTINGS',
 341                          'limit_load'        => array('lang' => 'LIMIT_LOAD',        'validate' => 'int:0:9999',    'type' => 'number:0:9999', 'explain' => true),
 342                          'session_length'    => array('lang' => 'SESSION_LENGTH',    'validate' => 'int:60:9999999999',    'type' => 'number:60:9999999999', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']),
 343                          'active_sessions'    => array('lang' => 'LIMIT_SESSIONS',    'validate' => 'int:0:9999',    'type' => 'number:0:9999', 'explain' => true),
 344                          'load_online_time'    => array('lang' => 'ONLINE_LENGTH',        'validate' => 'int:0:999',    'type' => 'number:0:999', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
 345                          'read_notification_expire_days'    => array('lang' => 'READ_NOTIFICATION_EXPIRE_DAYS',    'validate' => 'int:0',    'type' => 'number:0', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']),
 346  
 347                          'legend2'                => 'GENERAL_OPTIONS',
 348                          'load_notifications'    => array('lang' => 'LOAD_NOTIFICATIONS',    'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 349                          'load_db_track'            => array('lang' => 'YES_POST_MARKING',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 350                          'load_db_lastread'        => array('lang' => 'YES_READ_MARKING',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 351                          'load_anon_lastread'    => array('lang' => 'YES_ANON_READ_MARKING',    'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 352                          'load_online'            => array('lang' => 'YES_ONLINE',            'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 353                          'load_online_guests'    => array('lang' => 'YES_ONLINE_GUESTS',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 354                          'load_onlinetrack'        => array('lang' => 'YES_ONLINE_TRACK',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 355                          'load_birthdays'        => array('lang' => 'YES_BIRTHDAYS',            'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 356                          'load_unreads_search'    => array('lang' => 'YES_UNREAD_SEARCH',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
 357                          'load_moderators'        => array('lang' => 'YES_MODERATORS',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
 358                          'load_jumpbox'            => array('lang' => 'YES_JUMPBOX',            'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
 359                          'load_user_activity'    => array('lang' => 'LOAD_USER_ACTIVITY',    'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 360                          'load_user_activity_limit'        => array('lang' => 'LOAD_USER_ACTIVITY_LIMIT',        'validate' => 'int:0:99999999',    'type' => 'number:0:99999999', 'explain' => true),
 361                          'load_tplcompile'        => array('lang' => 'RECOMPILE_STYLES',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 362                          'allow_cdn'                => array('lang' => 'ALLOW_CDN',                'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 363                          'enable_accurate_pm_button'    => array('lang' => 'YES_ACCURATE_PM_BUTTON',    'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 364                          'allow_live_searches'    => array('lang' => 'ALLOW_LIVE_SEARCHES',    'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 365  
 366                          'legend3'                => 'CUSTOM_PROFILE_FIELDS',
 367                          'load_cpf_memberlist'    => array('lang' => 'LOAD_CPF_MEMBERLIST',    'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
 368                          'load_cpf_pm'            => array('lang' => 'LOAD_CPF_PM',            'validate' => 'bool',    'type' => 'radio:yes_no', 'explain'    => false),
 369                          'load_cpf_viewprofile'    => array('lang' => 'LOAD_CPF_VIEWPROFILE',    'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
 370                          'load_cpf_viewtopic'    => array('lang' => 'LOAD_CPF_VIEWTOPIC',    'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => false),
 371  
 372                          'legend4'                    => 'ACP_SUBMIT_CHANGES',
 373                      )
 374                  );
 375              break;
 376  
 377              case 'auth':
 378                  $display_vars = array(
 379                      'title'    => 'ACP_AUTH_SETTINGS',
 380                      'vars'    => array(
 381                          'legend1'        => 'ACP_AUTH_SETTINGS',
 382                          'auth_method'    => array('lang' => 'AUTH_METHOD',    'validate' => 'string',    'type' => 'select:1:toggable', 'method' => 'select_auth_method', 'explain' => false),
 383                      )
 384                  );
 385              break;
 386  
 387              case 'server':
 388                  $display_vars = array(
 389                      'title'    => 'ACP_SERVER_SETTINGS',
 390                      'vars'    => array(
 391                          'legend1'                => 'ACP_SERVER_SETTINGS',
 392                          'gzip_compress'            => array('lang' => 'ENABLE_GZIP',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 393                          'use_system_cron'        => array('lang' => 'USE_SYSTEM_CRON',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 394  
 395                          'legend2'                => 'PATH_SETTINGS',
 396                          'enable_mod_rewrite'    => array('lang' => 'MOD_REWRITE_ENABLE',    'validate' => 'bool',    'type' => 'custom', 'method' => 'enable_mod_rewrite', 'explain' => true),
 397                          'smilies_path'            => array('lang' => 'SMILIES_PATH',        'validate' => 'rpath',    'type' => 'text:20:255', 'explain' => true),
 398                          'icons_path'            => array('lang' => 'ICONS_PATH',        'validate' => 'rpath',    'type' => 'text:20:255', 'explain' => true),
 399                          'upload_icons_path'        => array('lang' => 'UPLOAD_ICONS_PATH',    'validate' => 'rpath',    'type' => 'text:20:255', 'explain' => true),
 400                          'ranks_path'            => array('lang' => 'RANKS_PATH',        'validate' => 'rpath',    'type' => 'text:20:255', 'explain' => true),
 401  
 402                          'legend3'                => 'SERVER_URL_SETTINGS',
 403                          'force_server_vars'        => array('lang' => 'FORCE_SERVER_VARS',    'validate' => 'bool',            'type' => 'radio:yes_no', 'explain' => true),
 404                          'server_protocol'        => array('lang' => 'SERVER_PROTOCOL',    'validate' => 'string',            'type' => 'text:10:10', 'explain' => true),
 405                          'server_name'            => array('lang' => 'SERVER_NAME',        'validate' => 'string',            'type' => 'text:40:255', 'explain' => true),
 406                          'server_port'            => array('lang' => 'SERVER_PORT',        'validate' => 'int:0:99999',            'type' => 'number:0:99999', 'explain' => true),
 407                          'script_path'            => array('lang' => 'SCRIPT_PATH',        'validate' => 'script_path',    'type' => 'text::255', 'explain' => true),
 408  
 409                          'legend4'                    => 'ACP_SUBMIT_CHANGES',
 410                      )
 411                  );
 412              break;
 413  
 414              case 'security':
 415                  $display_vars = array(
 416                      'title'    => 'ACP_SECURITY_SETTINGS',
 417                      'vars'    => array(
 418                          'legend1'                => 'ACP_SECURITY_SETTINGS',
 419                          'allow_autologin'        => array('lang' => 'ALLOW_AUTOLOGIN',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 420                          'allow_password_reset'    => array('lang' => 'ALLOW_PASSWORD_RESET',    'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 421                          'max_autologin_time'    => array('lang' => 'AUTOLOGIN_LENGTH',        'validate' => 'int:0:99999',    'type' => 'number:0:99999',    'explain' => true,    'append' => ' ' . $user->lang['DAYS']),
 422                          'ip_check'                => array('lang' => 'IP_VALID',                'validate' => 'int',    'type' => 'custom', 'method' => 'select_ip_check', 'explain' => true),
 423                          'browser_check'            => array('lang' => 'BROWSER_VALID',            'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 424                          'forwarded_for_check'    => array('lang' => 'FORWARDED_FOR_VALID',    'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 425                          'referer_validation'    => array('lang' => 'REFERRER_VALID',        'validate' => 'int:0:3','type' => 'custom', 'method' => 'select_ref_check', 'explain' => true),
 426                          'remote_upload_verify'    => array('lang' => 'UPLOAD_CERT_VALID',    'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 427                          'check_dnsbl'            => array('lang' => 'CHECK_DNSBL',            'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 428                          'email_check_mx'        => array('lang' => 'EMAIL_CHECK_MX',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 429                          'max_pass_chars'        => array('lang' => 'PASSWORD_LENGTH', 'validate' => 'int:8:255', 'type' => false, 'method' => false, 'explain' => false,),
 430                          'min_pass_chars'        => array('lang' => 'PASSWORD_LENGTH',    'validate' => 'int:1',    'type' => 'custom', 'method' => 'password_length', 'explain' => true),
 431                          'pass_complex'            => array('lang' => 'PASSWORD_TYPE',            'validate' => 'string',    'type' => 'select', 'method' => 'select_password_chars', 'explain' => true),
 432                          'chg_passforce'            => array('lang' => 'FORCE_PASS_CHANGE',        'validate' => 'int:0:999',    'type' => 'number:0:999', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']),
 433                          'max_login_attempts'    => array('lang' => 'MAX_LOGIN_ATTEMPTS',    'validate' => 'int:0:999',    'type' => 'number:0:999', 'explain' => true),
 434                          'ip_login_limit_max'    => array('lang' => 'IP_LOGIN_LIMIT_MAX',    'validate' => 'int:0:999',    'type' => 'number:0:999', 'explain' => true),
 435                          'ip_login_limit_time'    => array('lang' => 'IP_LOGIN_LIMIT_TIME',    'validate' => 'int:0:99999',    'type' => 'number:0:99999', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']),
 436                          'ip_login_limit_use_forwarded'    => array('lang' => 'IP_LOGIN_LIMIT_USE_FORWARDED',    'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 437                          'tpl_allow_php'            => array('lang' => 'TPL_ALLOW_PHP',            'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 438                          'form_token_lifetime'    => array('lang' => 'FORM_TIME_MAX',            'validate' => 'int:-1:99999',    'type' => 'number:-1:99999', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']),
 439                          'form_token_sid_guests'    => array('lang' => 'FORM_SID_GUESTS',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 440  
 441                      )
 442                  );
 443              break;
 444  
 445              case 'email':
 446                  $display_vars = array(
 447                      'title'    => 'ACP_EMAIL_SETTINGS',
 448                      'vars'    => array(
 449                          'legend1'                => 'GENERAL_SETTINGS',
 450                          'email_enable'            => array('lang' => 'ENABLE_EMAIL',            'validate' => 'bool',    'type' => 'radio:enabled_disabled', 'explain' => true),
 451                          'board_email_form'        => array('lang' => 'BOARD_EMAIL_FORM',        'validate' => 'bool',    'type' => 'radio:enabled_disabled', 'explain' => true),
 452                          'email_package_size'    => array('lang' => 'EMAIL_PACKAGE_SIZE',    'validate' => 'int:0',    'type' => 'number:0:99999', 'explain' => true),
 453                          'email_max_chunk_size'    => array('lang' => 'EMAIL_MAX_CHUNK_SIZE',    'validate' => 'int:1:99999',    'type' => 'number:1:99999', 'explain' => true),
 454                          'board_contact'            => array('lang' => 'CONTACT_EMAIL',            'validate' => 'email',    'type' => 'email:25:100', 'explain' => true),
 455                          'board_contact_name'    => array('lang' => 'CONTACT_EMAIL_NAME',    'validate' => 'string',    'type' => 'text:25:50', 'explain' => true),
 456                          'board_email'            => array('lang' => 'ADMIN_EMAIL',            'validate' => 'email',    'type' => 'email:25:100', 'explain' => true),
 457                          'email_force_sender'    => array('lang' => 'EMAIL_FORCE_SENDER',    'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 458                          'board_email_sig'        => array('lang' => 'EMAIL_SIG',                'validate' => 'string',    'type' => 'textarea:5:30', 'explain' => true),
 459                          'board_hide_emails'        => array('lang' => 'BOARD_HIDE_EMAILS',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 460                          'send_test_email'        => array('lang' => 'SEND_TEST_EMAIL',        'validate' => 'bool',    'type' => 'custom', 'method' => 'send_test_email', 'explain' => true),
 461  
 462                          'legend2'                => 'SMTP_SETTINGS',
 463                          'smtp_delivery'            => array('lang' => 'USE_SMTP',                'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 464                          'smtp_host'                => array('lang' => 'SMTP_SERVER',            'validate' => 'string',    'type' => 'text:25:50', 'explain' => true),
 465                          'smtp_port'                => array('lang' => 'SMTP_PORT',                'validate' => 'int:0:99999',    'type' => 'number:0:99999', 'explain' => true),
 466                          'smtp_auth_method'        => array('lang' => 'SMTP_AUTH_METHOD',        'validate' => 'string',    'type' => 'select', 'method' => 'mail_auth_select', 'explain' => true),
 467                          'smtp_username'            => array('lang' => 'SMTP_USERNAME',            'validate' => 'string',    'type' => 'text:25:255', 'explain' => true),
 468                          'smtp_password'            => array('lang' => 'SMTP_PASSWORD',            'validate' => 'string',    'type' => 'password:25:255', 'explain' => true),
 469                          'smtp_verify_peer'        => array('lang' => 'SMTP_VERIFY_PEER',        'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 470                          'smtp_verify_peer_name'    => array('lang' => 'SMTP_VERIFY_PEER_NAME',    'validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 471                          'smtp_allow_self_signed'=> array('lang' => 'SMTP_ALLOW_SELF_SIGNED','validate' => 'bool',    'type' => 'radio:yes_no', 'explain' => true),
 472  
 473                          'legend3'                    => 'ACP_SUBMIT_CHANGES',
 474                      )
 475                  );
 476              break;
 477  
 478              default:
 479                  trigger_error('NO_MODE', E_USER_ERROR);
 480              break;
 481          }
 482  
 483          /**
 484          * Event to add and/or modify acp_board configurations
 485          *
 486          * @event core.acp_board_config_edit_add
 487          * @var    array    display_vars    Array of config values to display and process
 488          * @var    string    mode            Mode of the config page we are displaying
 489          * @var    boolean    submit            Do we display the form or process the submission
 490          * @since 3.1.0-a4
 491          */
 492          $vars = array('display_vars', 'mode', 'submit');
 493          extract($phpbb_dispatcher->trigger_event('core.acp_board_config_edit_add', compact($vars)));
 494  
 495          if (isset($display_vars['lang']))
 496          {
 497              $user->add_lang($display_vars['lang']);
 498          }
 499  
 500          $this->new_config = clone $config;
 501          $cfg_array = (isset($_REQUEST['config'])) ? $request->variable('config', array('' => ''), true) : $this->new_config;
 502          $error = array();
 503  
 504          // We validate the complete config if wished
 505          validate_config_vars($display_vars['vars'], $cfg_array, $error);
 506  
 507          if ($submit && !check_form_key($form_key))
 508          {
 509              $error[] = $user->lang['FORM_INVALID'];
 510          }
 511          // Do not write values if there is an error
 512          if (count($error))
 513          {
 514              $submit = false;
 515          }
 516  
 517          // We go through the display_vars to make sure no one is trying to set variables he/she is not allowed to...
 518          foreach ($display_vars['vars'] as $config_name => $data)
 519          {
 520              if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false)
 521              {
 522                  continue;
 523              }
 524  
 525              if ($config_name == 'auth_method' || $config_name == 'feed_news_id' || $config_name == 'feed_exclude_id')
 526              {
 527                  continue;
 528              }
 529  
 530              if ($config_name == 'guest_style')
 531              {
 532                  if (isset($cfg_array[$config_name]))
 533                  {
 534                      $this->guest_style_set($cfg_array[$config_name]);
 535                  }
 536                  continue;
 537              }
 538  
 539              $this->new_config[$config_name] = $config_value = $cfg_array[$config_name];
 540  
 541              if ($submit)
 542              {
 543                  if (strpos($data['type'], 'password') === 0 && $config_value === '********')
 544                  {
 545                      // Do not update password fields if the content is ********,
 546                      // because that is the password replacement we use to not
 547                      // send the password to the output
 548                      continue;
 549                  }
 550                  $config->set($config_name, $config_value);
 551  
 552                  if ($config_name == 'allow_quick_reply' && isset($_POST['allow_quick_reply_enable']))
 553                  {
 554                      enable_bitfield_column_flag(FORUMS_TABLE, 'forum_flags', round(log(FORUM_FLAG_QUICK_REPLY, 2)));
 555                  }
 556              }
 557          }
 558  
 559          // Invalidate the text_formatter cache when posting options are changed
 560          if ($mode == 'post' && $submit)
 561          {
 562              $phpbb_container->get('text_formatter.cache')->invalidate();
 563          }
 564  
 565          // Store news and exclude ids
 566          if ($mode == 'feed' && $submit)
 567          {
 568              $cache->destroy('_feed_news_forum_ids');
 569              $cache->destroy('_feed_excluded_forum_ids');
 570  
 571              $this->store_feed_forums(FORUM_OPTION_FEED_NEWS, 'feed_news_id');
 572              $this->store_feed_forums(FORUM_OPTION_FEED_EXCLUDE, 'feed_exclude_id');
 573          }
 574  
 575          if ($mode == 'auth')
 576          {
 577              // Retrieve a list of auth plugins and check their config values
 578              /* @var $auth_providers \phpbb\auth\provider_collection */
 579              $auth_providers = $phpbb_container->get('auth.provider_collection');
 580  
 581              $updated_auth_settings = false;
 582              $old_auth_config = array();
 583              foreach ($auth_providers as $provider)
 584              {
 585                  /** @var \phpbb\auth\provider\provider_interface $provider */
 586                  if ($fields = $provider->acp())
 587                  {
 588                      // Check if we need to create config fields for this plugin and save config when submit was pressed
 589                      foreach ($fields as $field)
 590                      {
 591                          if (!isset($config[$field]))
 592                          {
 593                              $config->set($field, '');
 594                          }
 595  
 596                          if (!isset($cfg_array[$field]) || strpos($field, 'legend') !== false)
 597                          {
 598                              continue;
 599                          }
 600  
 601                          if (substr($field, -9) === '_password' && $cfg_array[$field] === '********')
 602                          {
 603                              // Do not update password fields if the content is ********,
 604                              // because that is the password replacement we use to not
 605                              // send the password to the output
 606                              continue;
 607                          }
 608  
 609                          $old_auth_config[$field] = $this->new_config[$field];
 610                          $config_value = $cfg_array[$field];
 611                          $this->new_config[$field] = $config_value;
 612  
 613                          if ($submit)
 614                          {
 615                              $updated_auth_settings = true;
 616                              $config->set($field, $config_value);
 617                          }
 618                      }
 619                  }
 620                  unset($fields);
 621              }
 622  
 623              if ($submit && (($cfg_array['auth_method'] != $this->new_config['auth_method']) || $updated_auth_settings))
 624              {
 625                  $method = basename($cfg_array['auth_method']);
 626                  if (array_key_exists('auth.provider.' . $method, $auth_providers))
 627                  {
 628                      $provider = $auth_providers['auth.provider.' . $method];
 629                      if ($error = $provider->init())
 630                      {
 631                          foreach ($old_auth_config as $config_name => $config_value)
 632                          {
 633                              $config->set($config_name, $config_value);
 634                          }
 635                          trigger_error($error . adm_back_link($this->u_action), E_USER_WARNING);
 636                      }
 637                      $config->set('auth_method', basename($cfg_array['auth_method']));
 638                  }
 639                  else
 640                  {
 641                      trigger_error('NO_AUTH_PLUGIN', E_USER_ERROR);
 642                  }
 643              }
 644          }
 645  
 646          if ($mode == 'email' && $request->is_set_post('send_test_email'))
 647          {
 648              if ($config['email_enable'])
 649              {
 650                  include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
 651  
 652                  $messenger = new messenger(false);
 653                  $messenger->template('test');
 654                  $messenger->set_addresses($user->data);
 655                  $messenger->anti_abuse_headers($config, $user);
 656                  $messenger->assign_vars(array(
 657                      'USERNAME'    => htmlspecialchars_decode($user->data['username']),
 658                  ));
 659                  $messenger->send(NOTIFY_EMAIL);
 660  
 661                  trigger_error($user->lang('TEST_EMAIL_SENT') . adm_back_link($this->u_action));
 662              }
 663              else
 664              {
 665                  $user->add_lang('memberlist');
 666                  trigger_error($user->lang('EMAIL_DISABLED') . adm_back_link($this->u_action), E_USER_WARNING);
 667              }
 668          }
 669  
 670          if ($submit)
 671          {
 672              $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_CONFIG_' . strtoupper($mode));
 673  
 674              $message = $user->lang('CONFIG_UPDATED');
 675              $message_type = E_USER_NOTICE;
 676              if (!$config['email_enable'] && in_array($mode, array('email', 'registration')) &&
 677                  in_array($config['require_activation'], array(USER_ACTIVATION_SELF, USER_ACTIVATION_ADMIN)))
 678              {
 679                  $message .= '<br /><br />' . $user->lang('ACC_ACTIVATION_WARNING');
 680                  $message_type = E_USER_WARNING;
 681              }
 682              trigger_error($message . adm_back_link($this->u_action), $message_type);
 683          }
 684  
 685          $this->tpl_name = 'acp_board';
 686          $this->page_title = $display_vars['title'];
 687  
 688          $template->assign_vars(array(
 689              'L_TITLE'            => $user->lang[$display_vars['title']],
 690              'L_TITLE_EXPLAIN'    => $user->lang[$display_vars['title'] . '_EXPLAIN'],
 691  
 692              'S_ERROR'            => (count($error)) ? true : false,
 693              'ERROR_MSG'            => implode('<br />', $error),
 694  
 695              'U_ACTION'            => $this->u_action)
 696          );
 697  
 698          // Output relevant page
 699          foreach ($display_vars['vars'] as $config_key => $vars)
 700          {
 701              if (!is_array($vars) && strpos($config_key, 'legend') === false)
 702              {
 703                  continue;
 704              }
 705  
 706              if (strpos($config_key, 'legend') !== false)
 707              {
 708                  $template->assign_block_vars('options', array(
 709                      'S_LEGEND'        => true,
 710                      'LEGEND'        => (isset($user->lang[$vars])) ? $user->lang[$vars] : $vars)
 711                  );
 712  
 713                  continue;
 714              }
 715  
 716              $type = explode(':', $vars['type']);
 717  
 718              $l_explain = '';
 719              if ($vars['explain'] && isset($vars['lang_explain']))
 720              {
 721                  $l_explain = (isset($user->lang[$vars['lang_explain']])) ? $user->lang[$vars['lang_explain']] : $vars['lang_explain'];
 722              }
 723              else if ($vars['explain'])
 724              {
 725                  $l_explain = (isset($user->lang[$vars['lang'] . '_EXPLAIN'])) ? $user->lang[$vars['lang'] . '_EXPLAIN'] : '';
 726              }
 727  
 728              $content = build_cfg_template($type, $config_key, $this->new_config, $config_key, $vars);
 729  
 730              if (empty($content))
 731              {
 732                  continue;
 733              }
 734  
 735              $template->assign_block_vars('options', array(
 736                  'KEY'            => $config_key,
 737                  'TITLE'            => (isset($user->lang[$vars['lang']])) ? $user->lang[$vars['lang']] : $vars['lang'],
 738                  'S_EXPLAIN'        => $vars['explain'] && !empty($l_explain),
 739                  'TITLE_EXPLAIN'    => $l_explain,
 740                  'CONTENT'        => $content,
 741                  )
 742              );
 743  
 744              unset($display_vars['vars'][$config_key]);
 745          }
 746  
 747          if ($mode == 'auth')
 748          {
 749              $template->assign_var('S_AUTH', true);
 750  
 751              foreach ($auth_providers as $provider)
 752              {
 753                  $auth_tpl = $provider->get_acp_template($this->new_config);
 754                  if ($auth_tpl)
 755                  {
 756                      if (array_key_exists('BLOCK_VAR_NAME', $auth_tpl))
 757                      {
 758                          foreach ($auth_tpl['BLOCK_VARS'] as $block_vars)
 759                          {
 760                              $template->assign_block_vars($auth_tpl['BLOCK_VAR_NAME'], $block_vars);
 761                          }
 762                      }
 763                      $template->assign_vars($auth_tpl['TEMPLATE_VARS']);
 764                      $template->assign_block_vars('auth_tpl', array(
 765                          'TEMPLATE_FILE'    => $auth_tpl['TEMPLATE_FILE'],
 766                      ));
 767                  }
 768              }
 769          }
 770      }
 771  
 772      /**
 773      * Select auth method
 774      */
 775  	function select_auth_method($selected_method, $key = '')
 776      {
 777          global $phpbb_container;
 778  
 779          /* @var $auth_providers \phpbb\auth\provider_collection */
 780          $auth_providers = $phpbb_container->get('auth.provider_collection');
 781          $auth_plugins = array();
 782  
 783          foreach ($auth_providers as $key => $value)
 784          {
 785              if (!($value instanceof \phpbb\auth\provider\provider_interface))
 786              {
 787                  continue;
 788              }
 789              $auth_plugins[] = str_replace('auth.provider.', '', $key);
 790          }
 791  
 792          sort($auth_plugins);
 793  
 794          $auth_select = '';
 795          foreach ($auth_plugins as $method)
 796          {
 797              $selected = ($selected_method == $method) ? ' selected="selected"' : '';
 798              $auth_select .= "<option value=\"$method\"$selected data-toggle-setting=\"#auth_{$method}_settings\">" . ucfirst($method) . '</option>';
 799          }
 800  
 801          return $auth_select;
 802      }
 803  
 804      /**
 805      * Select mail authentication method
 806      */
 807  	function mail_auth_select($selected_method, $key = '')
 808      {
 809          global $user;
 810  
 811          $auth_methods = array('PLAIN', 'LOGIN', 'CRAM-MD5', 'DIGEST-MD5', 'POP-BEFORE-SMTP');
 812          $s_smtp_auth_options = '';
 813  
 814          foreach ($auth_methods as $method)
 815          {
 816              $s_smtp_auth_options .= '<option value="' . $method . '"' . (($selected_method == $method) ? ' selected="selected"' : '') . '>' . $user->lang['SMTP_' . str_replace('-', '_', $method)] . '</option>';
 817          }
 818  
 819          return $s_smtp_auth_options;
 820      }
 821  
 822      /**
 823      * Select full folder action
 824      */
 825  	function full_folder_select($value, $key = '')
 826      {
 827          global $user;
 828  
 829          return '<option value="1"' . (($value == 1) ? ' selected="selected"' : '') . '>' . $user->lang['DELETE_OLDEST_MESSAGES'] . '</option><option value="2"' . (($value == 2) ? ' selected="selected"' : '') . '>' . $user->lang['HOLD_NEW_MESSAGES_SHORT'] . '</option>';
 830      }
 831  
 832      /**
 833      * Select ip validation
 834      */
 835  	function select_ip_check($value, $key = '')
 836      {
 837          $radio_ary = array(4 => 'ALL', 3 => 'CLASS_C', 2 => 'CLASS_B', 0 => 'NO_IP_VALIDATION');
 838  
 839          return h_radio('config[ip_check]', $radio_ary, $value, $key);
 840      }
 841  
 842      /**
 843      * Select referer validation
 844      */
 845  	function select_ref_check($value, $key = '')
 846      {
 847          $radio_ary = array(REFERER_VALIDATE_PATH => 'REF_PATH', REFERER_VALIDATE_HOST => 'REF_HOST', REFERER_VALIDATE_NONE => 'NO_REF_VALIDATION');
 848  
 849          return h_radio('config[referer_validation]', $radio_ary, $value, $key);
 850      }
 851  
 852      /**
 853      * Select account activation method
 854      */
 855  	function select_acc_activation($selected_value, $value)
 856      {
 857          global $user, $config;
 858  
 859          $act_ary = array(
 860              'ACC_DISABLE'    => array(true, USER_ACTIVATION_DISABLE),
 861              'ACC_NONE'        => array(true, USER_ACTIVATION_NONE),
 862              'ACC_USER'        => array($config['email_enable'], USER_ACTIVATION_SELF),
 863              'ACC_ADMIN'        => array($config['email_enable'], USER_ACTIVATION_ADMIN),
 864          );
 865  
 866          $act_options = '';
 867          foreach ($act_ary as $key => $data)
 868          {
 869              list($available, $value) = $data;
 870              $selected = ($selected_value == $value) ? ' selected="selected"' : '';
 871              $class = (!$available) ? ' class="disabled-option"' : '';
 872              $act_options .= '<option value="' . $value . '"' . $selected . $class . '>' . $user->lang($key) . '</option>';
 873          }
 874  
 875          return $act_options;
 876      }
 877  
 878      /**
 879      * Maximum/Minimum username length
 880      */
 881  	function username_length($value, $key = '')
 882      {
 883          global $user;
 884  
 885          return '<input id="' . $key . '" type="number" min="1" max="999" name="config[min_name_chars]" value="' . $value . '" /> ' . $user->lang['MIN_CHARS'] . '&nbsp;&nbsp;<input type="number" min="8" max="180" name="config[max_name_chars]" value="' . $this->new_config['max_name_chars'] . '" /> ' . $user->lang['MAX_CHARS'];
 886      }
 887  
 888      /**
 889      * Allowed chars in usernames
 890      */
 891  	function select_username_chars($selected_value, $key)
 892      {
 893          global $user;
 894  
 895          $user_char_ary = array('USERNAME_CHARS_ANY', 'USERNAME_ALPHA_ONLY', 'USERNAME_ALPHA_SPACERS', 'USERNAME_LETTER_NUM', 'USERNAME_LETTER_NUM_SPACERS', 'USERNAME_ASCII');
 896          $user_char_options = '';
 897          foreach ($user_char_ary as $user_type)
 898          {
 899              $selected = ($selected_value == $user_type) ? ' selected="selected"' : '';
 900              $user_char_options .= '<option value="' . $user_type . '"' . $selected . '>' . $user->lang[$user_type] . '</option>';
 901          }
 902  
 903          return $user_char_options;
 904      }
 905  
 906      /**
 907      * Maximum/Minimum password length
 908      */
 909  	function password_length($value, $key)
 910      {
 911          global $user;
 912  
 913          return '<input id="' . $key . '" type="number" min="1" max="999" name="config[min_pass_chars]" value="' . $value . '" /> ' . $user->lang['MIN_CHARS'] . '&nbsp;&nbsp;<input type="number" min="8" max="255" name="config[max_pass_chars]" value="' . $this->new_config['max_pass_chars'] . '" /> ' . $user->lang['MAX_CHARS'];
 914      }
 915  
 916      /**
 917      * Required chars in passwords
 918      */
 919  	function select_password_chars($selected_value, $key)
 920      {
 921          global $user;
 922  
 923          $pass_type_ary = array('PASS_TYPE_ANY', 'PASS_TYPE_CASE', 'PASS_TYPE_ALPHA', 'PASS_TYPE_SYMBOL');
 924          $pass_char_options = '';
 925          foreach ($pass_type_ary as $pass_type)
 926          {
 927              $selected = ($selected_value == $pass_type) ? ' selected="selected"' : '';
 928              $pass_char_options .= '<option value="' . $pass_type . '"' . $selected . '>' . $user->lang[$pass_type] . '</option>';
 929          }
 930  
 931          return $pass_char_options;
 932      }
 933  
 934      /**
 935      * Select bump interval
 936      */
 937  	function bump_interval($value, $key)
 938      {
 939          global $user;
 940  
 941          $s_bump_type = '';
 942          $types = array('m' => 'MINUTES', 'h' => 'HOURS', 'd' => 'DAYS');
 943          foreach ($types as $type => $lang)
 944          {
 945              $selected = ($this->new_config['bump_type'] == $type) ? ' selected="selected"' : '';
 946              $s_bump_type .= '<option value="' . $type . '"' . $selected . '>' . $user->lang[$lang] . '</option>';
 947          }
 948  
 949          return '<input id="' . $key . '" type="text" size="3" maxlength="4" name="config[bump_interval]" value="' . $value . '" />&nbsp;<select name="config[bump_type]">' . $s_bump_type . '</select>';
 950      }
 951  
 952      /**
 953      * Board disable option and message
 954      */
 955  	function board_disable($value, $key)
 956      {
 957          $radio_ary = array(1 => 'YES', 0 => 'NO');
 958  
 959          return h_radio('config[board_disable]', $radio_ary, $value) . '<br /><input id="' . $key . '" type="text" name="config[board_disable_msg]" maxlength="255" size="40" value="' . $this->new_config['board_disable_msg'] . '" />';
 960      }
 961  
 962      /**
 963      * Global quick reply enable/disable setting and button to enable in all forums
 964      */
 965  	function quick_reply($value, $key)
 966      {
 967          global $user;
 968  
 969          $radio_ary = array(1 => 'YES', 0 => 'NO');
 970  
 971          return h_radio('config[allow_quick_reply]', $radio_ary, $value) .
 972              '<br /><br /><input class="button2" type="submit" id="' . $key . '_enable" name="' . $key . '_enable" value="' . $user->lang['ALLOW_QUICK_REPLY_BUTTON'] . '" />';
 973      }
 974  
 975      /**
 976      * Select guest timezone
 977      */
 978  	function timezone_select($value, $key)
 979      {
 980          global $template, $user;
 981  
 982          $timezone_select = phpbb_timezone_select($template, $user, $value, true);
 983  
 984          return '<select name="config[' . $key . ']" id="' . $key . '">' . $timezone_select . '</select>';
 985      }
 986  
 987      /**
 988      * Get guest style
 989      */
 990  	public function guest_style_get()
 991      {
 992          global $db;
 993  
 994          $sql = 'SELECT user_style
 995              FROM ' . USERS_TABLE . '
 996              WHERE user_id = ' . ANONYMOUS;
 997          $result = $db->sql_query($sql);
 998  
 999          $style = (int) $db->sql_fetchfield('user_style');
1000          $db->sql_freeresult($result);
1001  
1002          return $style;
1003      }
1004  
1005      /**
1006      * Set guest style
1007      *
1008      * @param    int        $style_id    The style ID
1009      */
1010  	public function guest_style_set($style_id)
1011      {
1012          global $db;
1013  
1014          $sql = 'UPDATE ' . USERS_TABLE . '
1015              SET user_style = ' . (int) $style_id . '
1016              WHERE user_id = ' . ANONYMOUS;
1017          $db->sql_query($sql);
1018      }
1019  
1020      /**
1021      * Select default dateformat
1022      */
1023  	function dateformat_select($value, $key)
1024      {
1025          global $user, $config;
1026  
1027          // Let the format_date function operate with the acp values
1028          $old_tz = $user->timezone;
1029          try
1030          {
1031              $user->timezone = new DateTimeZone($config['board_timezone']);
1032          }
1033          catch (\Exception $e)
1034          {
1035              // If the board timezone is invalid, we just use the users timezone.
1036          }
1037  
1038          $dateformat_options = '';
1039  
1040          foreach ($user->lang['dateformats'] as $format => $null)
1041          {
1042              $dateformat_options .= '<option value="' . $format . '"' . (($format == $value) ? ' selected="selected"' : '') . '>';
1043              $dateformat_options .= $user->format_date(time(), $format, false) . ((strpos($format, '|') !== false) ? $user->lang['VARIANT_DATE_SEPARATOR'] . $user->format_date(time(), $format, true) : '');
1044              $dateformat_options .= '</option>';
1045          }
1046  
1047          $dateformat_options .= '<option value="custom"';
1048          if (!isset($user->lang['dateformats'][$value]))
1049          {
1050              $dateformat_options .= ' selected="selected"';
1051          }
1052          $dateformat_options .= '>' . $user->lang['CUSTOM_DATEFORMAT'] . '</option>';
1053  
1054          // Reset users date options
1055          $user->timezone = $old_tz;
1056  
1057          return "<select name=\"dateoptions\" id=\"dateoptions\" onchange=\"if (this.value == 'custom') { document.getElementById('" . addslashes($key) . "').value = '" . addslashes($value) . "'; } else { document.getElementById('" . addslashes($key) . "').value = this.value; }\">$dateformat_options</select>
1058          <input type=\"text\" name=\"config[$key]\" id=\"$key\" value=\"$value\" maxlength=\"64\" />";
1059      }
1060  
1061      /**
1062      * Select multiple forums
1063      */
1064  	function select_news_forums($value, $key)
1065      {
1066          $forum_list = make_forum_select(false, false, true, true, true, false, true);
1067  
1068          // Build forum options
1069          $s_forum_options = '<select id="' . $key . '" name="' . $key . '[]" multiple="multiple">';
1070          foreach ($forum_list as $f_id => $f_row)
1071          {
1072              $f_row['selected'] = phpbb_optionget(FORUM_OPTION_FEED_NEWS, $f_row['forum_options']);
1073  
1074              $s_forum_options .= '<option value="' . $f_id . '"' . (($f_row['selected']) ? ' selected="selected"' : '') . (($f_row['disabled']) ? ' disabled="disabled" class="disabled-option"' : '') . '>' . $f_row['padding'] . $f_row['forum_name'] . '</option>';
1075          }
1076          $s_forum_options .= '</select>';
1077  
1078          return $s_forum_options;
1079      }
1080  
1081  	function select_exclude_forums($value, $key)
1082      {
1083          $forum_list = make_forum_select(false, false, true, true, true, false, true);
1084  
1085          // Build forum options
1086          $s_forum_options = '<select id="' . $key . '" name="' . $key . '[]" multiple="multiple">';
1087          foreach ($forum_list as $f_id => $f_row)
1088          {
1089              $f_row['selected'] = phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $f_row['forum_options']);
1090  
1091              $s_forum_options .= '<option value="' . $f_id . '"' . (($f_row['selected']) ? ' selected="selected"' : '') . (($f_row['disabled']) ? ' disabled="disabled" class="disabled-option"' : '') . '>' . $f_row['padding'] . $f_row['forum_name'] . '</option>';
1092          }
1093          $s_forum_options .= '</select>';
1094  
1095          return $s_forum_options;
1096      }
1097  
1098  	function store_feed_forums($option, $key)
1099      {
1100          global $db, $cache, $request;
1101  
1102          // Get key
1103          $values = $request->variable($key, array(0 => 0));
1104  
1105          // Empty option bit for all forums
1106          $sql = 'UPDATE ' . FORUMS_TABLE . '
1107              SET forum_options = forum_options - ' . (1 << $option) . '
1108              WHERE ' . $db->sql_bit_and('forum_options', $option, '<> 0');
1109          $db->sql_query($sql);
1110  
1111          // Already emptied for all...
1112          if (count($values))
1113          {
1114              // Set for selected forums
1115              $sql = 'UPDATE ' . FORUMS_TABLE . '
1116                  SET forum_options = forum_options + ' . (1 << $option) . '
1117                  WHERE ' . $db->sql_in_set('forum_id', $values);
1118              $db->sql_query($sql);
1119          }
1120  
1121          // Empty sql cache for forums table because options changed
1122          $cache->destroy('sql', FORUMS_TABLE);
1123      }
1124  
1125      /**
1126      * Option to enable/disable removal of 'app.php' from URLs
1127      *
1128      * Note that if mod_rewrite is on, URLs without app.php will still work,
1129      * but any paths generated by the controller helper url() method will not
1130      * contain app.php.
1131      *
1132      * @param int $value The current config value
1133      * @param string $key The config key
1134      * @return string The HTML for the form field
1135      */
1136  	function enable_mod_rewrite($value, $key)
1137      {
1138          global $user;
1139  
1140          // Determine whether mod_rewrite is enabled on the server
1141          // NOTE: This only works on Apache servers on which PHP is NOT
1142          // installed as CGI. In that case, there is no way for PHP to
1143          // determine whether or not the Apache module is enabled.
1144          //
1145          // To be clear on the value of $mod_rewite:
1146          // null = Cannot determine whether or not the server has mod_rewrite
1147          //        enabled
1148          // false = Can determine that the server does NOT have mod_rewrite
1149          //         enabled
1150          // true = Can determine that the server DOES have mod_rewrite_enabled
1151          $mod_rewrite = null;
1152          if (function_exists('apache_get_modules'))
1153          {
1154              $mod_rewrite = (bool) in_array('mod_rewrite', apache_get_modules());
1155          }
1156  
1157          // If $message is false, mod_rewrite is enabled.
1158          // Otherwise, it is not and we need to:
1159          // 1) disable the form field
1160          // 2) make sure the config value is set to 0
1161          // 3) append the message to the return
1162          $value = ($mod_rewrite === false) ? 0 : $value;
1163          $message = $mod_rewrite === null ? 'MOD_REWRITE_INFORMATION_UNAVAILABLE' : ($mod_rewrite === false ? 'MOD_REWRITE_DISABLED' : false);
1164  
1165          // Let's do some friendly HTML injection if we want to disable the
1166          // form field because h_radio() has no pretty way of doing so
1167          $field_name = 'config[enable_mod_rewrite]' . ($message === 'MOD_REWRITE_DISABLED' ? '" disabled="disabled' : '');
1168  
1169          return h_radio($field_name, array(1 => 'YES', 0 => 'NO'), $value) .
1170              ($message !== false ? '<br /><span>' . $user->lang($message) . '</span>' : '');
1171      }
1172  
1173  	function send_test_email($value, $key)
1174      {
1175          global $user;
1176  
1177          return '<input class="button2" type="submit" id="' . $key . '" name="' . $key . '" value="' . $user->lang['SEND_TEST_EMAIL'] . '" />';
1178      }
1179  }


Generated: Sat Oct 26 11:28:42 2019 Cross-referenced by PHPXref 0.7.1