Blame Identity/Models/Html/phpBB/3.0.4/includes/acp/acp_board.php

d6e8d8
d6e8d8
/**
d6e8d8
*
d6e8d8
* @package acp
d6e8d8
* @version $Id: acp_board.php 8911 2008-09-23 13:03:33Z acydburn $
d6e8d8
* @copyright (c) 2005 phpBB Group
d6e8d8
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
d6e8d8
*
d6e8d8
* @todo add cron intervals to server settings? (database_gc, queue_interval, session_gc, search_gc, cache_gc, warnings_gc)
d6e8d8
*/
d6e8d8
d6e8d8
/**
d6e8d8
* @ignore
d6e8d8
*/
d6e8d8
if (!defined('IN_PHPBB'))
d6e8d8
{
d6e8d8
	exit;
d6e8d8
}
d6e8d8
d6e8d8
/**
d6e8d8
* @package acp
d6e8d8
*/
d6e8d8
class acp_board
d6e8d8
{
d6e8d8
	var $u_action;
d6e8d8
	var $new_config = array();
d6e8d8
d6e8d8
	function main($id, $mode)
d6e8d8
	{
d6e8d8
		global $db, $user, $auth, $template;
d6e8d8
		global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
d6e8d8
d6e8d8
		$user->add_lang('acp/board');
d6e8d8
d6e8d8
		$action	= request_var('action', '');
d6e8d8
		$submit = (isset($_POST['submit'])) ? true : false;
d6e8d8
d6e8d8
		$form_key = 'acp_board';
d6e8d8
		add_form_key($form_key);
d6e8d8
d6e8d8
		/**
d6e8d8
		*	Validation types are:
d6e8d8
		*		string, int, bool,
d6e8d8
		*		script_path (absolute path in url - beginning with / and no trailing slash),
d6e8d8
		*		rpath (relative), rwpath (realtive, writable), path (relative path, but able to escape the root), wpath (writable)
d6e8d8
		*/
d6e8d8
		switch ($mode)
d6e8d8
		{
d6e8d8
			case 'settings':
d6e8d8
				$display_vars = array(
d6e8d8
					'title'	=> 'ACP_BOARD_SETTINGS',
d6e8d8
					'vars'	=> array(
d6e8d8
						'legend1'				=> 'ACP_BOARD_SETTINGS',
d6e8d8
						'sitename'				=> array('lang' => 'SITE_NAME',				'validate' => 'string',	'type' => 'text:40:255', 'explain' => false),
d6e8d8
						'site_desc'				=> array('lang' => 'SITE_DESC',				'validate' => 'string',	'type' => 'text:40:255', 'explain' => false),
d6e8d8
						'board_disable'			=> array('lang' => 'DISABLE_BOARD',			'validate' => 'bool',	'type' => 'custom', 'method' => 'board_disable', 'explain' => true),
d6e8d8
						'board_disable_msg'		=> false,
d6e8d8
						'default_lang'			=> array('lang' => 'DEFAULT_LANGUAGE',		'validate' => 'lang',	'type' => 'select', 'function' => 'language_select', 'params' => array('{CONFIG_VALUE}'), 'explain' => false),
d6e8d8
						'default_dateformat'	=> array('lang' => 'DEFAULT_DATE_FORMAT',	'validate' => 'string',	'type' => 'custom', 'method' => 'dateformat_select', 'explain' => true),
d6e8d8
						'board_timezone'		=> array('lang' => 'SYSTEM_TIMEZONE',		'validate' => 'string',	'type' => 'select', 'function' => 'tz_select', 'params' => array('{CONFIG_VALUE}', 1), 'explain' => false),
d6e8d8
						'board_dst'				=> array('lang' => 'SYSTEM_DST',			'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'default_style'			=> array('lang' => 'DEFAULT_STYLE',			'validate' => 'int',	'type' => 'select', 'function' => 'style_select', 'params' => array('{CONFIG_VALUE}', false), 'explain' => false),
d6e8d8
						'override_user_style'	=> array('lang' => 'OVERRIDE_STYLE',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
d6e8d8
						'legend2'				=> 'WARNINGS',
d6e8d8
						'warnings_expire_days'	=> array('lang' => 'WARNINGS_EXPIRE',		'validate' => 'int',	'type' => 'text:3:4', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']),
d6e8d8
					)
d6e8d8
				);
d6e8d8
			break;
d6e8d8
d6e8d8
			case 'features':
d6e8d8
				$display_vars = array(
d6e8d8
					'title'	=> 'ACP_BOARD_FEATURES',
d6e8d8
					'vars'	=> array(
d6e8d8
						'legend1'				=> 'ACP_BOARD_FEATURES',
d6e8d8
						'allow_privmsg'			=> array('lang' => 'BOARD_PM',				'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
						'allow_topic_notify'	=> array('lang' => 'ALLOW_TOPIC_NOTIFY',	'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'allow_forum_notify'	=> array('lang' => 'ALLOW_FORUM_NOTIFY',	'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'allow_namechange'		=> array('lang' => 'ALLOW_NAME_CHANGE',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'allow_attachments'		=> array('lang' => 'ALLOW_ATTACHMENTS',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'allow_pm_attach'		=> array('lang' => 'ALLOW_PM_ATTACHMENTS',	'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'allow_bbcode'			=> array('lang' => 'ALLOW_BBCODE',			'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'allow_smilies'			=> array('lang' => 'ALLOW_SMILIES',			'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'allow_sig'				=> array('lang' => 'ALLOW_SIG',				'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'allow_nocensors'		=> array('lang' => 'ALLOW_NO_CENSORS',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
						'allow_bookmarks'		=> array('lang' => 'ALLOW_BOOKMARKS',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
						'allow_birthdays'		=> array('lang' => 'ALLOW_BIRTHDAYS',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
d6e8d8
						'legend2'				=> 'ACP_LOAD_SETTINGS',
d6e8d8
						'load_birthdays'		=> array('lang' => 'YES_BIRTHDAYS',			'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
						'load_moderators'		=> array('lang' => 'YES_MODERATORS',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'load_jumpbox'			=> array('lang' => 'YES_JUMPBOX',			'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'load_cpf_memberlist'	=> array('lang' => 'LOAD_CPF_MEMBERLIST',	'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'load_cpf_viewprofile'	=> array('lang' => 'LOAD_CPF_VIEWPROFILE',	'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'load_cpf_viewtopic'	=> array('lang' => 'LOAD_CPF_VIEWTOPIC',	'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
					)
d6e8d8
				);
d6e8d8
			break;
d6e8d8
d6e8d8
			case 'avatar':
d6e8d8
				$display_vars = array(
d6e8d8
					'title'	=> 'ACP_AVATAR_SETTINGS',
d6e8d8
					'vars'	=> array(
d6e8d8
						'legend1'				=> 'ACP_AVATAR_SETTINGS',
d6e8d8
d6e8d8
						'avatar_min_width'		=> array('lang' => 'MIN_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,),
d6e8d8
						'avatar_min_height'		=> array('lang' => 'MIN_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,),
d6e8d8
						'avatar_max_width'		=> array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,),
d6e8d8
						'avatar_max_height'		=> array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,),
d6e8d8
d6e8d8
						'allow_avatar_local'	=> array('lang' => 'ALLOW_LOCAL',			'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'allow_avatar_remote'	=> array('lang' => 'ALLOW_REMOTE',			'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
						'allow_avatar_upload'	=> array('lang' => 'ALLOW_UPLOAD',			'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'avatar_filesize'		=> array('lang' => 'MAX_FILESIZE',			'validate' => 'int:0',	'type' => 'text:4:10', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']),
d6e8d8
						'avatar_min'			=> array('lang' => 'MIN_AVATAR_SIZE',		'validate' => 'int:0',	'type' => 'dimension:3:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
d6e8d8
						'avatar_max'			=> array('lang' => 'MAX_AVATAR_SIZE',		'validate' => 'int:0',	'type' => 'dimension:3:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
d6e8d8
						'avatar_path'			=> array('lang' => 'AVATAR_STORAGE_PATH',	'validate' => 'rwpath',	'type' => 'text:20:255', 'explain' => true),
d6e8d8
						'avatar_gallery_path'	=> array('lang' => 'AVATAR_GALLERY_PATH',	'validate' => 'rpath',	'type' => 'text:20:255', 'explain' => true)
d6e8d8
					)
d6e8d8
				);
d6e8d8
			break;
d6e8d8
d6e8d8
			case 'message':
d6e8d8
				$display_vars = array(
d6e8d8
					'title'	=> 'ACP_MESSAGE_SETTINGS',
d6e8d8
					'lang'	=> 'ucp',
d6e8d8
					'vars'	=> array(
d6e8d8
						'legend1'				=> 'GENERAL_SETTINGS',
d6e8d8
						'allow_privmsg'			=> array('lang' => 'BOARD_PM',				'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
						'pm_max_boxes'			=> array('lang' => 'BOXES_MAX',				'validate' => 'int:0',	'type' => 'text:4:4', 'explain' => true),
d6e8d8
						'pm_max_msgs'			=> array('lang' => 'BOXES_LIMIT',			'validate' => 'int:0',	'type' => 'text:4:4', 'explain' => true),
d6e8d8
						'full_folder_action'	=> array('lang' => 'FULL_FOLDER_ACTION',	'validate' => 'int',	'type' => 'select', 'method' => 'full_folder_select', 'explain' => true),
d6e8d8
						'pm_edit_time'			=> array('lang' => 'PM_EDIT_TIME',			'validate' => 'int:0',	'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
d6e8d8
						'pm_max_recipients'		=> array('lang' => 'PM_MAX_RECIPIENTS',		'validate' => 'int:0',	'type' => 'text:5:5', 'explain' => true),
d6e8d8
d6e8d8
						'legend2'				=> 'GENERAL_OPTIONS',
d6e8d8
						'allow_mass_pm'			=> array('lang' => 'ALLOW_MASS_PM',			'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'auth_bbcode_pm'		=> array('lang' => 'ALLOW_BBCODE_PM',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'auth_smilies_pm'		=> array('lang' => 'ALLOW_SMILIES_PM',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'allow_pm_attach'		=> array('lang' => 'ALLOW_PM_ATTACHMENTS',	'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'allow_sig_pm'			=> array('lang' => 'ALLOW_SIG_PM',			'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'print_pm'				=> array('lang' => 'ALLOW_PRINT_PM',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'forward_pm'			=> array('lang' => 'ALLOW_FORWARD_PM',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'auth_img_pm'			=> array('lang' => 'ALLOW_IMG_PM',			'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'auth_flash_pm'			=> array('lang' => 'ALLOW_FLASH_PM',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
						'enable_pm_icons'		=> array('lang' => 'ENABLE_PM_ICONS',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false)
d6e8d8
					)
d6e8d8
				);
d6e8d8
			break;
d6e8d8
d6e8d8
			case 'post':
d6e8d8
				$display_vars = array(
d6e8d8
					'title'	=> 'ACP_POST_SETTINGS',
d6e8d8
					'vars'	=> array(
d6e8d8
						'legend1'				=> 'GENERAL_OPTIONS',
d6e8d8
						'allow_topic_notify'	=> array('lang' => 'ALLOW_TOPIC_NOTIFY',	'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'allow_forum_notify'	=> array('lang' => 'ALLOW_FORUM_NOTIFY',	'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'allow_bbcode'			=> array('lang' => 'ALLOW_BBCODE',			'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'allow_post_flash'		=> array('lang' => 'ALLOW_POST_FLASH',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
						'allow_smilies'			=> array('lang' => 'ALLOW_SMILIES',			'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'allow_post_links'		=> array('lang' => 'ALLOW_POST_LINKS',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
						'allow_nocensors'		=> array('lang' => 'ALLOW_NO_CENSORS',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
						'allow_bookmarks'		=> array('lang' => 'ALLOW_BOOKMARKS',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
						'enable_post_confirm'	=> array('lang' => 'VISUAL_CONFIRM_POST',	'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
d6e8d8
						'legend2'				=> 'POSTING',
d6e8d8
						'enable_queue_trigger'	=> array('lang' => 'ENABLE_QUEUE_TRIGGER',	'validate' => 'bool',		'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
						'queue_trigger_posts'	=> array('lang' => 'QUEUE_TRIGGER_POSTS',	'validate' => 'int:0:250',	'type' => 'text:4:4', 'explain' => true),
d6e8d8
						'bump_type'				=> false,
d6e8d8
						'edit_time'				=> array('lang' => 'EDIT_TIME',				'validate' => 'int:0',		'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
d6e8d8
						'display_last_edited'	=> array('lang' => 'DISPLAY_LAST_EDITED',	'validate' => 'bool',		'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
						'flood_interval'		=> array('lang' => 'FLOOD_INTERVAL',		'validate' => 'int:0',		'type' => 'text:3:10', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']),
d6e8d8
						'bump_interval'			=> array('lang' => 'BUMP_INTERVAL',			'validate' => 'int:0',		'type' => 'custom', 'method' => 'bump_interval', 'explain' => true),
d6e8d8
						'topics_per_page'		=> array('lang' => 'TOPICS_PER_PAGE',		'validate' => 'int:1',		'type' => 'text:3:4', 'explain' => false),
d6e8d8
						'posts_per_page'		=> array('lang' => 'POSTS_PER_PAGE',		'validate' => 'int:1',		'type' => 'text:3:4', 'explain' => false),
d6e8d8
						'hot_threshold'			=> array('lang' => 'HOT_THRESHOLD',			'validate' => 'int:0',		'type' => 'text:3:4', 'explain' => true),
d6e8d8
						'max_poll_options'		=> array('lang' => 'MAX_POLL_OPTIONS',		'validate' => 'int:2:127',	'type' => 'text:4:4', 'explain' => false),
d6e8d8
						'max_post_chars'		=> array('lang' => 'CHAR_LIMIT',			'validate' => 'int:0',		'type' => 'text:4:6', 'explain' => true),
d6e8d8
						'max_post_smilies'		=> array('lang' => 'SMILIES_LIMIT',			'validate' => 'int:0',		'type' => 'text:4:4', 'explain' => true),
d6e8d8
						'max_post_urls'			=> array('lang' => 'MAX_POST_URLS',			'validate' => 'int:0',		'type' => 'text:5:4', 'explain' => true),
d6e8d8
						'max_post_font_size'	=> array('lang' => 'MAX_POST_FONT_SIZE',	'validate' => 'int:0',		'type' => 'text:5:4', 'explain' => true, 'append' => ' %'),
d6e8d8
						'max_quote_depth'		=> array('lang' => 'QUOTE_DEPTH_LIMIT',		'validate' => 'int:0',		'type' => 'text:4:4', 'explain' => true),
d6e8d8
						'max_post_img_width'	=> array('lang' => 'MAX_POST_IMG_WIDTH',	'validate' => 'int:0',		'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
d6e8d8
						'max_post_img_height'	=> array('lang' => 'MAX_POST_IMG_HEIGHT',	'validate' => 'int:0',		'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
d6e8d8
					)
d6e8d8
				);
d6e8d8
			break;
d6e8d8
d6e8d8
			case 'signature':
d6e8d8
				$display_vars = array(
d6e8d8
					'title'	=> 'ACP_SIGNATURE_SETTINGS',
d6e8d8
					'vars'	=> array(
d6e8d8
						'legend1'				=> 'GENERAL_OPTIONS',
d6e8d8
						'allow_sig'				=> array('lang' => 'ALLOW_SIG',				'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'allow_sig_bbcode'		=> array('lang' => 'ALLOW_SIG_BBCODE',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'allow_sig_img'			=> array('lang' => 'ALLOW_SIG_IMG',			'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'allow_sig_flash'		=> array('lang' => 'ALLOW_SIG_FLASH',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'allow_sig_smilies'		=> array('lang' => 'ALLOW_SIG_SMILIES',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'allow_sig_links'		=> array('lang' => 'ALLOW_SIG_LINKS',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
d6e8d8
						'legend2'				=> 'GENERAL_SETTINGS',
d6e8d8
						'max_sig_chars'			=> array('lang' => 'MAX_SIG_LENGTH',		'validate' => 'int:0',	'type' => 'text:5:4', 'explain' => true),
d6e8d8
						'max_sig_urls'			=> array('lang' => 'MAX_SIG_URLS',			'validate' => 'int:0',	'type' => 'text:5:4', 'explain' => true),
d6e8d8
						'max_sig_font_size'		=> array('lang' => 'MAX_SIG_FONT_SIZE',		'validate' => 'int:0',	'type' => 'text:5:4', 'explain' => true, 'append' => ' %'),
d6e8d8
						'max_sig_smilies'		=> array('lang' => 'MAX_SIG_SMILIES',		'validate' => 'int:0',	'type' => 'text:5:4', 'explain' => true),
d6e8d8
						'max_sig_img_width'		=> array('lang' => 'MAX_SIG_IMG_WIDTH',		'validate' => 'int:0',	'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
d6e8d8
						'max_sig_img_height'	=> array('lang' => 'MAX_SIG_IMG_HEIGHT',	'validate' => 'int:0',	'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
d6e8d8
					)
d6e8d8
				);
d6e8d8
			break;
d6e8d8
d6e8d8
			case 'registration':
d6e8d8
				$display_vars = array(
d6e8d8
					'title'	=> 'ACP_REGISTER_SETTINGS',
d6e8d8
					'vars'	=> array(
d6e8d8
						'legend1'				=> 'GENERAL_SETTINGS',
d6e8d8
						'max_name_chars'		=> array('lang' => 'USERNAME_LENGTH', 'validate' => 'int:8:180', 'type' => false, 'method' => false, 'explain' => false,),
d6e8d8
						'max_pass_chars'		=> array('lang' => 'PASSWORD_LENGTH', 'validate' => 'int:8:255', 'type' => false, 'method' => false, 'explain' => false,),
d6e8d8
d6e8d8
						'require_activation'	=> array('lang' => 'ACC_ACTIVATION',	'validate' => 'int',	'type' => 'custom', 'method' => 'select_acc_activation', 'explain' => true),
d6e8d8
						'min_name_chars'		=> array('lang' => 'USERNAME_LENGTH',	'validate' => 'int:1',	'type' => 'custom:5:180', 'method' => 'username_length', 'explain' => true),
d6e8d8
						'min_pass_chars'		=> array('lang' => 'PASSWORD_LENGTH',	'validate' => 'int:1',	'type' => 'custom', 'method' => 'password_length', 'explain' => true),
d6e8d8
						'allow_name_chars'		=> array('lang' => 'USERNAME_CHARS',	'validate' => 'string',	'type' => 'select', 'method' => 'select_username_chars', 'explain' => true),
d6e8d8
						'pass_complex'			=> array('lang' => 'PASSWORD_TYPE',		'validate' => 'string',	'type' => 'select', 'method' => 'select_password_chars', 'explain' => true),
d6e8d8
						'chg_passforce'			=> array('lang' => 'FORCE_PASS_CHANGE',	'validate' => 'int:0',	'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']),
d6e8d8
d6e8d8
						'legend2'				=> 'GENERAL_OPTIONS',
d6e8d8
						'allow_namechange'		=> array('lang' => 'ALLOW_NAME_CHANGE',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'allow_emailreuse'		=> array('lang' => 'ALLOW_EMAIL_REUSE',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
						'enable_confirm'		=> array('lang' => 'VISUAL_CONFIRM_REG',	'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
						'max_login_attempts'	=> array('lang' => 'MAX_LOGIN_ATTEMPTS',	'validate' => 'int:0',	'type' => 'text:3:3', 'explain' => true),
d6e8d8
						'max_reg_attempts'		=> array('lang' => 'REG_LIMIT',				'validate' => 'int:0',	'type' => 'text:4:4', 'explain' => true),
d6e8d8
d6e8d8
						'legend3'			=> 'COPPA',
d6e8d8
						'coppa_enable'		=> array('lang' => 'ENABLE_COPPA',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
						'coppa_mail'		=> array('lang' => 'COPPA_MAIL',		'validate' => 'string',	'type' => 'textarea:5:40', 'explain' => true),
d6e8d8
						'coppa_fax'			=> array('lang' => 'COPPA_FAX',			'validate' => 'string',	'type' => 'text:25:100', 'explain' => false),
d6e8d8
					)
d6e8d8
				);
d6e8d8
			break;
d6e8d8
d6e8d8
			case 'cookie':
d6e8d8
				$display_vars = array(
d6e8d8
					'title'	=> 'ACP_COOKIE_SETTINGS',
d6e8d8
					'vars'	=> array(
d6e8d8
						'legend1'		=> 'ACP_COOKIE_SETTINGS',
d6e8d8
						'cookie_domain'	=> array('lang' => 'COOKIE_DOMAIN',	'validate' => 'string',	'type' => 'text::255', 'explain' => false),
d6e8d8
						'cookie_name'	=> array('lang' => 'COOKIE_NAME',	'validate' => 'string',	'type' => 'text::16', 'explain' => false),
d6e8d8
						'cookie_path'	=> array('lang'	=> 'COOKIE_PATH',	'validate' => 'string',	'type' => 'text::255', 'explain' => false),
d6e8d8
						'cookie_secure'	=> array('lang' => 'COOKIE_SECURE',	'validate' => 'bool',	'type' => 'radio:disabled_enabled', 'explain' => true)
d6e8d8
					)
d6e8d8
				);
d6e8d8
			break;
d6e8d8
d6e8d8
			case 'load':
d6e8d8
				$display_vars = array(
d6e8d8
					'title'	=> 'ACP_LOAD_SETTINGS',
d6e8d8
					'vars'	=> array(
d6e8d8
						'legend1'			=> 'GENERAL_SETTINGS',
d6e8d8
						'limit_load'		=> array('lang' => 'LIMIT_LOAD',		'validate' => 'string',	'type' => 'text:4:4', 'explain' => true),
d6e8d8
						'session_length'	=> array('lang' => 'SESSION_LENGTH',	'validate' => 'int:60',	'type' => 'text:5:10', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']),
d6e8d8
						'active_sessions'	=> array('lang' => 'LIMIT_SESSIONS',	'validate' => 'int:0',	'type' => 'text:4:4', 'explain' => true),
d6e8d8
						'load_online_time'	=> array('lang' => 'ONLINE_LENGTH',		'validate' => 'int:0',	'type' => 'text:4:3', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
d6e8d8
d6e8d8
						'legend2'				=> 'GENERAL_OPTIONS',
d6e8d8
						'load_db_track'			=> array('lang' => 'YES_POST_MARKING',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
						'load_db_lastread'		=> array('lang' => 'YES_READ_MARKING',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
						'load_anon_lastread'	=> array('lang' => 'YES_ANON_READ_MARKING',	'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
						'load_online'			=> array('lang' => 'YES_ONLINE',			'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
						'load_online_guests'	=> array('lang' => 'YES_ONLINE_GUESTS',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
						'load_onlinetrack'		=> array('lang' => 'YES_ONLINE_TRACK',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
						'load_birthdays'		=> array('lang' => 'YES_BIRTHDAYS',			'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
						'load_moderators'		=> array('lang' => 'YES_MODERATORS',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'load_jumpbox'			=> array('lang' => 'YES_JUMPBOX',			'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'load_user_activity'	=> array('lang' => 'LOAD_USER_ACTIVITY',	'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
						'load_tplcompile'		=> array('lang' => 'RECOMPILE_STYLES',	'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
d6e8d8
						'legend3'				=> 'CUSTOM_PROFILE_FIELDS',
d6e8d8
						'load_cpf_memberlist'	=> array('lang' => 'LOAD_CPF_MEMBERLIST',	'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'load_cpf_viewprofile'	=> array('lang' => 'LOAD_CPF_VIEWPROFILE',	'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
						'load_cpf_viewtopic'	=> array('lang' => 'LOAD_CPF_VIEWTOPIC',	'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
d6e8d8
					)
d6e8d8
				);
d6e8d8
			break;
d6e8d8
d6e8d8
			case 'auth':
d6e8d8
				$display_vars = array(
d6e8d8
					'title'	=> 'ACP_AUTH_SETTINGS',
d6e8d8
					'vars'	=> array(
d6e8d8
						'legend1'		=> 'ACP_AUTH_SETTINGS',
d6e8d8
						'auth_method'	=> array('lang' => 'AUTH_METHOD',	'validate' => 'string',	'type' => 'select', 'method' => 'select_auth_method', 'explain' => false)
d6e8d8
					)
d6e8d8
				);
d6e8d8
			break;
d6e8d8
d6e8d8
			case 'server':
d6e8d8
				$display_vars = array(
d6e8d8
					'title'	=> 'ACP_SERVER_SETTINGS',
d6e8d8
					'vars'	=> array(
d6e8d8
						'legend1'				=> 'ACP_SERVER_SETTINGS',
d6e8d8
						'gzip_compress'			=> array('lang' => 'ENABLE_GZIP',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
d6e8d8
						'legend2'				=> 'PATH_SETTINGS',
d6e8d8
						'smilies_path'			=> array('lang' => 'SMILIES_PATH',		'validate' => 'rpath',	'type' => 'text:20:255', 'explain' => true),
d6e8d8
						'icons_path'			=> array('lang' => 'ICONS_PATH',		'validate' => 'rpath',	'type' => 'text:20:255', 'explain' => true),
d6e8d8
						'upload_icons_path'		=> array('lang' => 'UPLOAD_ICONS_PATH',	'validate' => 'rpath',	'type' => 'text:20:255', 'explain' => true),
d6e8d8
						'ranks_path'			=> array('lang' => 'RANKS_PATH',		'validate' => 'rpath',	'type' => 'text:20:255', 'explain' => true),
d6e8d8
d6e8d8
						'legend3'				=> 'SERVER_URL_SETTINGS',
d6e8d8
						'force_server_vars'		=> array('lang' => 'FORCE_SERVER_VARS',	'validate' => 'bool',			'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
						'server_protocol'		=> array('lang' => 'SERVER_PROTOCOL',	'validate' => 'string',			'type' => 'text:10:10', 'explain' => true),
d6e8d8
						'server_name'			=> array('lang' => 'SERVER_NAME',		'validate' => 'string',			'type' => 'text:40:255', 'explain' => true),
d6e8d8
						'server_port'			=> array('lang' => 'SERVER_PORT',		'validate' => 'int:0',			'type' => 'text:5:5', 'explain' => true),
d6e8d8
						'script_path'			=> array('lang' => 'SCRIPT_PATH',		'validate' => 'script_path',	'type' => 'text::255', 'explain' => true),
d6e8d8
					)
d6e8d8
				);
d6e8d8
			break;
d6e8d8
d6e8d8
			case 'security':
d6e8d8
				$display_vars = array(
d6e8d8
					'title'	=> 'ACP_SECURITY_SETTINGS',
d6e8d8
					'vars'	=> array(
d6e8d8
						'legend1'				=> 'ACP_SECURITY_SETTINGS',
d6e8d8
						'allow_autologin'		=> array('lang' => 'ALLOW_AUTOLOGIN',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
						'max_autologin_time'	=> array('lang' => 'AUTOLOGIN_LENGTH',		'validate' => 'int:0',	'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']),
d6e8d8
						'ip_check'				=> array('lang' => 'IP_VALID',				'validate' => 'int',	'type' => 'custom', 'method' => 'select_ip_check', 'explain' => true),
d6e8d8
						'browser_check'			=> array('lang' => 'BROWSER_VALID',			'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
						'forwarded_for_check'	=> array('lang' => 'FORWARDED_FOR_VALID',	'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
						'referer_validation'	=> array('lang' => 'REFERER_VALID',		'validate' => 'int:0:3','type' => 'custom', 'method' => 'select_ref_check', 'explain' => true),
d6e8d8
						'check_dnsbl'			=> array('lang' => 'CHECK_DNSBL',			'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
						'email_check_mx'		=> array('lang' => 'EMAIL_CHECK_MX',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
						'pass_complex'			=> array('lang' => 'PASSWORD_TYPE',			'validate' => 'string',	'type' => 'select', 'method' => 'select_password_chars', 'explain' => true),
d6e8d8
						'chg_passforce'			=> array('lang' => 'FORCE_PASS_CHANGE',		'validate' => 'int:0',	'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']),
d6e8d8
						'max_login_attempts'	=> array('lang' => 'MAX_LOGIN_ATTEMPTS',	'validate' => 'int:0',	'type' => 'text:3:3', 'explain' => true),
d6e8d8
						'tpl_allow_php'			=> array('lang' => 'TPL_ALLOW_PHP',			'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
						'form_token_lifetime'	=> array('lang' => 'FORM_TIME_MAX',			'validate' => 'int:-1',	'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']),
d6e8d8
						'form_token_sid_guests'	=> array('lang' => 'FORM_SID_GUESTS',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
d6e8d8
					)
d6e8d8
				);
d6e8d8
			break;
d6e8d8
d6e8d8
			case 'email':
d6e8d8
				$display_vars = array(
d6e8d8
					'title'	=> 'ACP_EMAIL_SETTINGS',
d6e8d8
					'vars'	=> array(
d6e8d8
						'legend1'				=> 'GENERAL_SETTINGS',
d6e8d8
						'email_enable'			=> array('lang' => 'ENABLE_EMAIL',			'validate' => 'bool',	'type' => 'radio:enabled_disabled', 'explain' => true),
d6e8d8
						'board_email_form'		=> array('lang' => 'BOARD_EMAIL_FORM',		'validate' => 'bool',	'type' => 'radio:enabled_disabled', 'explain' => true),
d6e8d8
						'email_function_name'	=> array('lang' => 'EMAIL_FUNCTION_NAME',	'validate' => 'string',	'type' => 'text:20:50', 'explain' => true),
d6e8d8
						'email_package_size'	=> array('lang' => 'EMAIL_PACKAGE_SIZE',	'validate' => 'int:0',	'type' => 'text:5:5', 'explain' => true),
d6e8d8
						'board_contact'			=> array('lang' => 'CONTACT_EMAIL',			'validate' => 'string',	'type' => 'text:25:100', 'explain' => true),
d6e8d8
						'board_email'			=> array('lang' => 'ADMIN_EMAIL',			'validate' => 'string',	'type' => 'text:25:100', 'explain' => true),
d6e8d8
						'board_email_sig'		=> array('lang' => 'EMAIL_SIG',				'validate' => 'string',	'type' => 'textarea:5:30', 'explain' => true),
d6e8d8
						'board_hide_emails'		=> array('lang' => 'BOARD_HIDE_EMAILS',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
d6e8d8
						'legend2'				=> 'SMTP_SETTINGS',
d6e8d8
						'smtp_delivery'			=> array('lang' => 'USE_SMTP',				'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
d6e8d8
						'smtp_host'				=> array('lang' => 'SMTP_SERVER',			'validate' => 'string',	'type' => 'text:25:50', 'explain' => false),
d6e8d8
						'smtp_port'				=> array('lang' => 'SMTP_PORT',				'validate' => 'int:0',	'type' => 'text:4:5', 'explain' => true),
d6e8d8
						'smtp_auth_method'		=> array('lang' => 'SMTP_AUTH_METHOD',		'validate' => 'string',	'type' => 'select', 'method' => 'mail_auth_select', 'explain' => true),
d6e8d8
						'smtp_username'			=> array('lang' => 'SMTP_USERNAME',			'validate' => 'string',	'type' => 'text:25:255', 'explain' => true),
d6e8d8
						'smtp_password'			=> array('lang' => 'SMTP_PASSWORD',			'validate' => 'string',	'type' => 'password:25:255', 'explain' => true)
d6e8d8
					)
d6e8d8
				);
d6e8d8
			break;
d6e8d8
d6e8d8
			default:
d6e8d8
				trigger_error('NO_MODE', E_USER_ERROR);
d6e8d8
			break;
d6e8d8
		}
d6e8d8
d6e8d8
		if (isset($display_vars['lang']))
d6e8d8
		{
d6e8d8
			$user->add_lang($display_vars['lang']);
d6e8d8
		}
d6e8d8
d6e8d8
		$this->new_config = $config;
d6e8d8
		$cfg_array = (isset($_REQUEST['config'])) ? utf8_normalize_nfc(request_var('config', array('' => ''), true)) : $this->new_config;
d6e8d8
		$error = array();
d6e8d8
d6e8d8
		// We validate the complete config if whished
d6e8d8
		validate_config_vars($display_vars['vars'], $cfg_array, $error);
d6e8d8
d6e8d8
		if ($submit && !check_form_key($form_key))
d6e8d8
		{
d6e8d8
			$error[] = $user->lang['FORM_INVALID'];
d6e8d8
		}
d6e8d8
		// Do not write values if there is an error
d6e8d8
		if (sizeof($error))
d6e8d8
		{
d6e8d8
			$submit = false;
d6e8d8
		}
d6e8d8
d6e8d8
		// We go through the display_vars to make sure no one is trying to set variables he/she is not allowed to...
d6e8d8
		foreach ($display_vars['vars'] as $config_name => $null)
d6e8d8
		{
d6e8d8
			if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false)
d6e8d8
			{
d6e8d8
				continue;
d6e8d8
			}
d6e8d8
d6e8d8
			if ($config_name == 'auth_method')
d6e8d8
			{
d6e8d8
				continue;
d6e8d8
			}
d6e8d8
d6e8d8
			$this->new_config[$config_name] = $config_value = $cfg_array[$config_name];
d6e8d8
d6e8d8
			if ($config_name == 'email_function_name')
d6e8d8
			{
d6e8d8
				$this->new_config['email_function_name'] = trim(str_replace(array('(', ')'), array('', ''), $this->new_config['email_function_name']));
d6e8d8
				$this->new_config['email_function_name'] = (empty($this->new_config['email_function_name']) || !function_exists($this->new_config['email_function_name'])) ? 'mail' : $this->new_config['email_function_name'];
d6e8d8
				$config_value = $this->new_config['email_function_name'];
d6e8d8
			}
d6e8d8
d6e8d8
			if ($submit)
d6e8d8
			{
d6e8d8
				set_config($config_name, $config_value);
d6e8d8
			}
d6e8d8
		}
d6e8d8
d6e8d8
		if ($mode == 'auth')
d6e8d8
		{
d6e8d8
			// Retrieve a list of auth plugins and check their config values
d6e8d8
			$auth_plugins = array();
d6e8d8
d6e8d8
			$dp = @opendir($phpbb_root_path . 'includes/auth');
d6e8d8
d6e8d8
			if ($dp)
d6e8d8
			{
d6e8d8
				while (($file = readdir($dp)) !== false)
d6e8d8
				{
d6e8d8
					if (preg_match('#^auth_(.*?)\.' . $phpEx . '$#', $file))
d6e8d8
					{
d6e8d8
						$auth_plugins[] = basename(preg_replace('#^auth_(.*?)\.' . $phpEx . '$#', '\1', $file));
d6e8d8
					}
d6e8d8
				}
d6e8d8
				closedir($dp);
d6e8d8
d6e8d8
				sort($auth_plugins);
d6e8d8
			}
d6e8d8
d6e8d8
			$updated_auth_settings = false;
d6e8d8
			$old_auth_config = array();
d6e8d8
			foreach ($auth_plugins as $method)
d6e8d8
			{
d6e8d8
				if ($method && file_exists($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx))
d6e8d8
				{
d6e8d8
					include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
d6e8d8
d6e8d8
					$method = 'acp_' . $method;
d6e8d8
					if (function_exists($method))
d6e8d8
					{
d6e8d8
						if ($fields = $method($this->new_config))
d6e8d8
						{
d6e8d8
							// Check if we need to create config fields for this plugin and save config when submit was pressed
d6e8d8
							foreach ($fields['config'] as $field)
d6e8d8
							{
d6e8d8
								if (!isset($config[$field]))
d6e8d8
								{
d6e8d8
									set_config($field, '');
d6e8d8
								}
d6e8d8
d6e8d8
								if (!isset($cfg_array[$field]) || strpos($field, 'legend') !== false)
d6e8d8
								{
d6e8d8
									continue;
d6e8d8
								}
d6e8d8
d6e8d8
								$old_auth_config[$field] = $this->new_config[$field];
d6e8d8
								$config_value = $cfg_array[$field];
d6e8d8
								$this->new_config[$field] = $config_value;
d6e8d8
d6e8d8
								if ($submit)
d6e8d8
								{
d6e8d8
									$updated_auth_settings = true;
d6e8d8
									set_config($field, $config_value);
d6e8d8
								}
d6e8d8
							}
d6e8d8
						}
d6e8d8
						unset($fields);
d6e8d8
					}
d6e8d8
				}
d6e8d8
			}
d6e8d8
d6e8d8
			if ($submit && (($cfg_array['auth_method'] != $this->new_config['auth_method']) || $updated_auth_settings))
d6e8d8
			{
d6e8d8
				$method = basename($cfg_array['auth_method']);
d6e8d8
				if ($method && in_array($method, $auth_plugins))
d6e8d8
				{
d6e8d8
					include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
d6e8d8
d6e8d8
					$method = 'init_' . $method;
d6e8d8
					if (function_exists($method))
d6e8d8
					{
d6e8d8
						if ($error = $method())
d6e8d8
						{
d6e8d8
							foreach ($old_auth_config as $config_name => $config_value)
d6e8d8
							{
d6e8d8
								set_config($config_name, $config_value);
d6e8d8
							}
d6e8d8
							trigger_error($error . adm_back_link($this->u_action), E_USER_WARNING);
d6e8d8
						}
d6e8d8
					}
d6e8d8
					set_config('auth_method', basename($cfg_array['auth_method']));
d6e8d8
				}
d6e8d8
				else
d6e8d8
				{
d6e8d8
					trigger_error('NO_AUTH_PLUGIN', E_USER_ERROR);
d6e8d8
				}
d6e8d8
			}
d6e8d8
		}
d6e8d8
d6e8d8
		if ($submit)
d6e8d8
		{
d6e8d8
			add_log('admin', 'LOG_CONFIG_' . strtoupper($mode));
d6e8d8
d6e8d8
			trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
d6e8d8
		}
d6e8d8
d6e8d8
		$this->tpl_name = 'acp_board';
d6e8d8
		$this->page_title = $display_vars['title'];
d6e8d8
d6e8d8
		$template->assign_vars(array(
d6e8d8
			'L_TITLE'			=> $user->lang[$display_vars['title']],
d6e8d8
			'L_TITLE_EXPLAIN'	=> $user->lang[$display_vars['title'] . '_EXPLAIN'],
d6e8d8
d6e8d8
			'S_ERROR'			=> (sizeof($error)) ? true : false,
d6e8d8
			'ERROR_MSG'			=> implode('
', $error),
d6e8d8
d6e8d8
			'U_ACTION'			=> $this->u_action)
d6e8d8
		);
d6e8d8
d6e8d8
		// Output relevant page
d6e8d8
		foreach ($display_vars['vars'] as $config_key => $vars)
d6e8d8
		{
d6e8d8
			if (!is_array($vars) && strpos($config_key, 'legend') === false)
d6e8d8
			{
d6e8d8
				continue;
d6e8d8
			}
d6e8d8
d6e8d8
			if (strpos($config_key, 'legend') !== false)
d6e8d8
			{
d6e8d8
				$template->assign_block_vars('options', array(
d6e8d8
					'S_LEGEND'		=> true,
d6e8d8
					'LEGEND'		=> (isset($user->lang[$vars])) ? $user->lang[$vars] : $vars)
d6e8d8
				);
d6e8d8
d6e8d8
				continue;
d6e8d8
			}
d6e8d8
d6e8d8
			$type = explode(':', $vars['type']);
d6e8d8
d6e8d8
			$l_explain = '';
d6e8d8
			if ($vars['explain'] && isset($vars['lang_explain']))
d6e8d8
			{
d6e8d8
				$l_explain = (isset($user->lang[$vars['lang_explain']])) ? $user->lang[$vars['lang_explain']] : $vars['lang_explain'];
d6e8d8
			}
d6e8d8
			else if ($vars['explain'])
d6e8d8
			{
d6e8d8
				$l_explain = (isset($user->lang[$vars['lang'] . '_EXPLAIN'])) ? $user->lang[$vars['lang'] . '_EXPLAIN'] : '';
d6e8d8
			}
d6e8d8
d6e8d8
			$content = build_cfg_template($type, $config_key, $this->new_config, $config_key, $vars);
d6e8d8
d6e8d8
			if (empty($content))
d6e8d8
			{
d6e8d8
				continue;
d6e8d8
			}
d6e8d8
d6e8d8
			$template->assign_block_vars('options', array(
d6e8d8
				'KEY'			=> $config_key,
d6e8d8
				'TITLE'			=> (isset($user->lang[$vars['lang']])) ? $user->lang[$vars['lang']] : $vars['lang'],
d6e8d8
				'S_EXPLAIN'		=> $vars['explain'],
d6e8d8
				'TITLE_EXPLAIN'	=> $l_explain,
d6e8d8
				'CONTENT'		=> $content,
d6e8d8
				)
d6e8d8
			);
d6e8d8
d6e8d8
			unset($display_vars['vars'][$config_key]);
d6e8d8
		}
d6e8d8
d6e8d8
		if ($mode == 'auth')
d6e8d8
		{
d6e8d8
			$template->assign_var('S_AUTH', true);
d6e8d8
d6e8d8
			foreach ($auth_plugins as $method)
d6e8d8
			{
d6e8d8
				if ($method && file_exists($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx))
d6e8d8
				{
d6e8d8
					$method = 'acp_' . $method;
d6e8d8
					if (function_exists($method))
d6e8d8
					{
d6e8d8
						$fields = $method($this->new_config);
d6e8d8
d6e8d8
						if ($fields['tpl'])
d6e8d8
						{
d6e8d8
							$template->assign_block_vars('auth_tpl', array(
d6e8d8
								'TPL'	=> $fields['tpl'])
d6e8d8
							);
d6e8d8
						}
d6e8d8
						unset($fields);
d6e8d8
					}
d6e8d8
				}
d6e8d8
			}
d6e8d8
		}
d6e8d8
	}
d6e8d8
d6e8d8
	/**
d6e8d8
	* Select auth method
d6e8d8
	*/
d6e8d8
	function select_auth_method($selected_method, $key = '')
d6e8d8
	{
d6e8d8
		global $phpbb_root_path, $phpEx;
d6e8d8
d6e8d8
		$auth_plugins = array();
d6e8d8
d6e8d8
		$dp = @opendir($phpbb_root_path . 'includes/auth');
d6e8d8
d6e8d8
		if (!$dp)
d6e8d8
		{
d6e8d8
			return '';
d6e8d8
		}
d6e8d8
d6e8d8
		while (($file = readdir($dp)) !== false)
d6e8d8
		{
d6e8d8
			if (preg_match('#^auth_(.*?)\.' . $phpEx . '$#', $file))
d6e8d8
			{
d6e8d8
				$auth_plugins[] = preg_replace('#^auth_(.*?)\.' . $phpEx . '$#', '\1', $file);
d6e8d8
			}
d6e8d8
		}
d6e8d8
		closedir($dp);
d6e8d8
d6e8d8
		sort($auth_plugins);
d6e8d8
d6e8d8
		$auth_select = '';
d6e8d8
		foreach ($auth_plugins as $method)
d6e8d8
		{
d6e8d8
			$selected = ($selected_method == $method) ? ' selected="selected"' : '';
d6e8d8
			$auth_select .= '<option value="' . $method . '"' . $selected . '>' . ucfirst($method) . '</option>';
d6e8d8
		}
d6e8d8
d6e8d8
		return $auth_select;
d6e8d8
	}
d6e8d8
d6e8d8
	/**
d6e8d8
	* Select mail authentication method
d6e8d8
	*/
d6e8d8
	function mail_auth_select($selected_method, $key = '')
d6e8d8
	{
d6e8d8
		global $user;
d6e8d8
d6e8d8
		$auth_methods = array('PLAIN', 'LOGIN', 'CRAM-MD5', 'DIGEST-MD5', 'POP-BEFORE-SMTP');
d6e8d8
		$s_smtp_auth_options = '';
d6e8d8
d6e8d8
		foreach ($auth_methods as $method)
d6e8d8
		{
d6e8d8
			$s_smtp_auth_options .= '<option value="' . $method . '"' . (($selected_method == $method) ? ' selected="selected"' : '') . '>' . $user->lang['SMTP_' . str_replace('-', '_', $method)] . '</option>';
d6e8d8
		}
d6e8d8
d6e8d8
		return $s_smtp_auth_options;
d6e8d8
	}
d6e8d8
d6e8d8
	/**
d6e8d8
	* Select full folder action
d6e8d8
	*/
d6e8d8
	function full_folder_select($value, $key = '')
d6e8d8
	{
d6e8d8
		global $user;
d6e8d8
d6e8d8
		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>';
d6e8d8
	}
d6e8d8
d6e8d8
	/**
d6e8d8
	* Select ip validation
d6e8d8
	*/
d6e8d8
	function select_ip_check($value, $key = '')
d6e8d8
	{
d6e8d8
		$radio_ary = array(4 => 'ALL', 3 => 'CLASS_C', 2 => 'CLASS_B', 0 => 'NO_IP_VALIDATION');
d6e8d8
d6e8d8
		return h_radio('config[ip_check]', $radio_ary, $value, $key);
d6e8d8
	}
d6e8d8
d6e8d8
	/**
d6e8d8
	* Select referer validation
d6e8d8
	*/
d6e8d8
	function select_ref_check($value, $key = '')
d6e8d8
	{
d6e8d8
		$radio_ary = array(REFERER_VALIDATE_PATH => 'REF_PATH', REFERER_VALIDATE_HOST => 'REF_HOST', REFERER_VALIDATE_NONE => 'NO_REF_VALIDATION');
d6e8d8
d6e8d8
		return h_radio('config[referer_validation]', $radio_ary, $value, $key);
d6e8d8
	}
d6e8d8
d6e8d8
	/**
d6e8d8
	* Select account activation method
d6e8d8
	*/
d6e8d8
	function select_acc_activation($value, $key = '')
d6e8d8
	{
d6e8d8
		global $user, $config;
d6e8d8
d6e8d8
		$radio_ary = array(USER_ACTIVATION_DISABLE => 'ACC_DISABLE', USER_ACTIVATION_NONE => 'ACC_NONE');
d6e8d8
		if ($config['email_enable'])
d6e8d8
		{
d6e8d8
			$radio_ary += array(USER_ACTIVATION_SELF => 'ACC_USER', USER_ACTIVATION_ADMIN => 'ACC_ADMIN');
d6e8d8
		}
d6e8d8
d6e8d8
		return h_radio('config[require_activation]', $radio_ary, $value, $key);
d6e8d8
	}
d6e8d8
d6e8d8
	/**
d6e8d8
	* Maximum/Minimum username length
d6e8d8
	*/
d6e8d8
	function username_length($value, $key = '')
d6e8d8
	{
d6e8d8
		global $user;
d6e8d8
d6e8d8
		return '<input id="' . $key . '" type="text" size="3" maxlength="3" name="config[min_name_chars]" value="' . $value . '" /> ' . $user->lang['MIN_CHARS'] . '  <input type="text" size="3" maxlength="3" name="config[max_name_chars]" value="' . $this->new_config['max_name_chars'] . '" /> ' . $user->lang['MAX_CHARS'];
d6e8d8
	}
d6e8d8
d6e8d8
	/**
d6e8d8
	* Allowed chars in usernames
d6e8d8
	*/
d6e8d8
	function select_username_chars($selected_value, $key)
d6e8d8
	{
d6e8d8
		global $user;
d6e8d8
d6e8d8
		$user_char_ary = array('USERNAME_CHARS_ANY', 'USERNAME_ALPHA_ONLY', 'USERNAME_ALPHA_SPACERS', 'USERNAME_LETTER_NUM', 'USERNAME_LETTER_NUM_SPACERS', 'USERNAME_ASCII');
d6e8d8
		$user_char_options = '';
d6e8d8
		foreach ($user_char_ary as $user_type)
d6e8d8
		{
d6e8d8
			$selected = ($selected_value == $user_type) ? ' selected="selected"' : '';
d6e8d8
			$user_char_options .= '<option value="' . $user_type . '"' . $selected . '>' . $user->lang[$user_type] . '</option>';
d6e8d8
		}
d6e8d8
d6e8d8
		return $user_char_options;
d6e8d8
	}
d6e8d8
d6e8d8
	/**
d6e8d8
	* Maximum/Minimum password length
d6e8d8
	*/
d6e8d8
	function password_length($value, $key)
d6e8d8
	{
d6e8d8
		global $user;
d6e8d8
d6e8d8
		return '<input id="' . $key . '" type="text" size="3" maxlength="3" name="config[min_pass_chars]" value="' . $value . '" /> ' . $user->lang['MIN_CHARS'] . '  <input type="text" size="3" maxlength="3" name="config[max_pass_chars]" value="' . $this->new_config['max_pass_chars'] . '" /> ' . $user->lang['MAX_CHARS'];
d6e8d8
	}
d6e8d8
d6e8d8
	/**
d6e8d8
	* Required chars in passwords
d6e8d8
	*/
d6e8d8
	function select_password_chars($selected_value, $key)
d6e8d8
	{
d6e8d8
		global $user;
d6e8d8
d6e8d8
		$pass_type_ary = array('PASS_TYPE_ANY', 'PASS_TYPE_CASE', 'PASS_TYPE_ALPHA', 'PASS_TYPE_SYMBOL');
d6e8d8
		$pass_char_options = '';
d6e8d8
		foreach ($pass_type_ary as $pass_type)
d6e8d8
		{
d6e8d8
			$selected = ($selected_value == $pass_type) ? ' selected="selected"' : '';
d6e8d8
			$pass_char_options .= '<option value="' . $pass_type . '"' . $selected . '>' . $user->lang[$pass_type] . '</option>';
d6e8d8
		}
d6e8d8
d6e8d8
		return $pass_char_options;
d6e8d8
	}
d6e8d8
d6e8d8
	/**
d6e8d8
	* Select bump interval
d6e8d8
	*/
d6e8d8
	function bump_interval($value, $key)
d6e8d8
	{
d6e8d8
		global $user;
d6e8d8
d6e8d8
		$s_bump_type = '';
d6e8d8
		$types = array('m' => 'MINUTES', 'h' => 'HOURS', 'd' => 'DAYS');
d6e8d8
		foreach ($types as $type => $lang)
d6e8d8
		{
d6e8d8
			$selected = ($this->new_config['bump_type'] == $type) ? ' selected="selected"' : '';
d6e8d8
			$s_bump_type .= '<option value="' . $type . '"' . $selected . '>' . $user->lang[$lang] . '</option>';
d6e8d8
		}
d6e8d8
d6e8d8
		return '<input id="' . $key . '" type="text" size="3" maxlength="4" name="config[bump_interval]" value="' . $value . '" /> <select name="config[bump_type]">' . $s_bump_type . '</select>';
d6e8d8
	}
d6e8d8
d6e8d8
	/**
d6e8d8
	* Board disable option and message
d6e8d8
	*/
d6e8d8
	function board_disable($value, $key)
d6e8d8
	{
d6e8d8
		global $user;
d6e8d8
d6e8d8
		$radio_ary = array(1 => 'YES', 0 => 'NO');
d6e8d8
d6e8d8
		return h_radio('config[board_disable]', $radio_ary, $value) . '
<input id="' . $key . '" type="text" name="config[board_disable_msg]" maxlength="255" size="40" value="' . $this->new_config['board_disable_msg'] . '" />';
d6e8d8
	}
d6e8d8
d6e8d8
	/**
d6e8d8
	* Select default dateformat
d6e8d8
	*/
d6e8d8
	function dateformat_select($value, $key)
d6e8d8
	{
d6e8d8
		global $user, $config;
d6e8d8
d6e8d8
		// Let the format_date function operate with the acp values
d6e8d8
		$old_tz = $user->timezone;
d6e8d8
		$old_dst = $user->dst;
d6e8d8
d6e8d8
		$user->timezone = $config['board_timezone'];
d6e8d8
		$user->dst = $config['board_dst'];
d6e8d8
d6e8d8
		$dateformat_options = '';
d6e8d8
d6e8d8
		foreach ($user->lang['dateformats'] as $format => $null)
d6e8d8
		{
d6e8d8
			$dateformat_options .= '<option value="' . $format . '"' . (($format == $value) ? ' selected="selected"' : '') . '>';
d6e8d8
			$dateformat_options .= $user->format_date(time(), $format, false) . ((strpos($format, '|') !== false) ? $user->lang['VARIANT_DATE_SEPARATOR'] . $user->format_date(time(), $format, true) : '');
d6e8d8
			$dateformat_options .= '</option>';
d6e8d8
		}
d6e8d8
d6e8d8
		$dateformat_options .= '
d6e8d8
		if (!isset($user->lang['dateformats'][$value]))
d6e8d8
		{
d6e8d8
			$dateformat_options .= ' selected="selected"';
d6e8d8
		}
d6e8d8
		$dateformat_options .= '>' . $user->lang['CUSTOM_DATEFORMAT'] . '</option>';
d6e8d8
d6e8d8
		// Reset users date options
d6e8d8
		$user->timezone = $old_tz;
d6e8d8
		$user->dst = $old_dst;
d6e8d8
d6e8d8
		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>
d6e8d8
		<input type=\"text\" name=\"config[$key]\" id=\"$key\" value=\"$value\" maxlength=\"30\" />";
d6e8d8
	}
d6e8d8
}
d6e8d8
d6e8d8
?>