From b776d02682492077a4fafd8835d7c4a17e50762d Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Tue, 2 Jun 2009 14:12:23 +0000 Subject: Okay, a first ci of the new captcha plugins. We'll add dynamic template includes later, as well as documentation on how to use this. I'm prepared to get yelled at for bugs (oh, I know that there are plenty); but please blame spammers for broken styles and MODs. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9524 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_captcha.php | 177 ++++++++++++++++++++----------------- 1 file changed, 95 insertions(+), 82 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_captcha.php b/phpBB/includes/acp/acp_captcha.php index 93505e1590..ed2ccf6ccc 100644 --- a/phpBB/includes/acp/acp_captcha.php +++ b/phpBB/includes/acp/acp_captcha.php @@ -10,6 +10,8 @@ /** * @ignore */ + + if (!defined('IN_PHPBB')) { exit; @@ -28,108 +30,119 @@ class acp_captcha global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; $user->add_lang('acp/board'); - $captcha_vars = array( - 'captcha_gd_x_grid' => 'CAPTCHA_GD_X_GRID', - 'captcha_gd_y_grid' => 'CAPTCHA_GD_Y_GRID', - 'captcha_gd_foreground_noise' => 'CAPTCHA_GD_FOREGROUND_NOISE', - 'captcha_gd' => 'CAPTCHA_GD_PREVIEWED', - 'captcha_gd_wave' => 'CAPTCHA_GD_WAVE', - 'captcha_gd_3d_noise' => 'CAPTCHA_GD_3D_NOISE', - 'captcha_gd_fonts' => 'CAPTCHA_GD_FONTS', - ); + include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx); - if (isset($_GET['demo'])) + $selected = request_var('select_captcha', $config['captcha_plugin']); + $configure = request_var('configure', false); + + // Oh, they are just here for the view + if (isset($_GET['captcha_demo'])) { - $captcha_vars = array_keys($captcha_vars); - - foreach ($captcha_vars as $captcha_var) - { - $config[$captcha_var] = (isset($_REQUEST[$captcha_var])) ? request_var($captcha_var, 0) : $config[$captcha_var]; - } - - if ($config['captcha_gd']) - { - include($phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx); - } - else - { - include($phpbb_root_path . 'includes/captcha/captcha_non_gd.' . $phpEx); - } - - $captcha = new captcha(); - $captcha->execute(gen_rand_string(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS)), time()); - exit; + $this->deliver_demo($selected); } - - $config_vars = array( - 'enable_confirm' => 'REG_ENABLE', - 'enable_post_confirm' => 'POST_ENABLE', - 'confirm_refresh' => 'CONFIRM_REFRESH', - 'captcha_gd' => 'CAPTCHA_GD', - ); - - $this->tpl_name = 'acp_captcha'; - $this->page_title = 'ACP_VC_SETTINGS'; - $form_key = 'acp_captcha'; - add_form_key($form_key); - - $submit = request_var('submit', ''); - - if ($submit && check_form_key($form_key)) + + // Delegate + if ($configure) { - $config_vars = array_keys($config_vars); + $config_captcha = phpbb_captcha_factory::get_instance($selected); + $config_captcha->acp_page($id, $this); + add_log('admin', 'LOG_CONFIG_VISUAL'); + } + else + { + $captchas = phpbb_captcha_factory::get_captcha_types(); + $config_vars = array( + 'enable_confirm' => 'REG_ENABLE', + 'enable_post_confirm' => 'POST_ENABLE', + 'confirm_refresh' => 'CONFIRM_REFRESH', + ); - foreach ($config_vars as $config_var) - { - set_config($config_var, request_var($config_var, '')); - } + $this->tpl_name = 'acp_captcha'; + $this->page_title = 'ACP_VC_SETTINGS'; + $form_key = 'acp_captcha'; + add_form_key($form_key); - $captcha_vars = array_keys($captcha_vars); + $submit = request_var('main_submit', false); - foreach ($captcha_vars as $captcha_var) + if ($submit && check_form_key($form_key)) { - $value = request_var($captcha_var, 0); - if ($value >= 0) + $config_vars = array_keys($config_vars); + foreach ($config_vars as $config_var) { - set_config($captcha_var, $value); + set_config($config_var, request_var($config_var, false)); } + if ($selected !== $config['captcha_plugin']) + { + // sanity check + if (isset($captchas['available'][$selected])) + { + $old_captcha = phpbb_captcha_factory::get_instance($config['captcha_plugin']); + $old_captcha->uninstall(); + set_config('captcha_plugin', $selected); + $new_captcha = phpbb_captcha_factory::get_instance($config['captcha_plugin']); + $old_captcha->install(); + add_log('admin', 'LOG_CONFIG_VISUAL'); + } + else + { + trigger_error($user->lang['CAPTCHA_UNAVAILABLE'] . adm_back_link($this->u_action)); + } + } + trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action)); } - - add_log('admin', 'LOG_CONFIG_VISUAL'); - trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action)); - } - else if ($submit) - { - trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action)); - } - else - { - $preview_image_src = append_sid(append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&demo=demo")); - - if (@extension_loaded('gd')) + else if ($submit) { - $template->assign_var('GD', true); + trigger_error($user->lang['FORM_INVALID'] . adm_back_link()); } - - foreach ($config_vars as $config_var => $template_var) + else { - $template->assign_var($template_var, (isset($_REQUEST[$config_var])) ? request_var($config_var, '') : $config[$config_var]) ; - } + $captcha_select = ''; + foreach ($captchas['available'] as $value => $title) + { + $current = ($selected !== false && $value == $selected) ? ' selected="selected"' : ''; + $captcha_select .= ''; + } + foreach ($captchas['unavailable'] as $value => $title) + { + $current = ($selected !== false && $value == $selected) ? ' selected="selected"' : ''; + $captcha_select .= ''; + } - foreach ($captcha_vars as $captcha_var => $template_var) - { - $var = (isset($_REQUEST[$captcha_var])) ? request_var($captcha_var, 0) : $config[$captcha_var]; - $template->assign_var($template_var, $var); - $preview_image_src .= "&$captcha_var=" . $var; + $demo_captcha = phpbb_captcha_factory::get_instance($selected); + + foreach ($config_vars as $config_var => $template_var) + { + $template->assign_var($template_var, (isset($_REQUEST[$config_var])) ? request_var($config_var, '') : $config[$config_var]) ; + } + + $template->assign_vars(array( + 'CAPTCHA_PREVIEW' => $demo_captcha->get_demo_template($id), + 'CAPTCHA_SELECT' => $captcha_select, + )); } - $template->assign_vars(array( - 'CAPTCHA_PREVIEW' => $preview_image_src, - 'PREVIEW' => isset($_POST['preview']), - )); } } + + + /** + * Entry point for delivering image CAPTCHAs in the ACP. + */ + function deliver_demo($selected) + { + global $db, $user, $config; + + $captcha = phpbb_captcha_factory::get_instance($selected); + $captcha->init(CONFIRM_REG); + $captcha->execute_demo(); + garbage_collection(); + exit_handler(); + } + + + + } ?> \ No newline at end of file -- cgit v1.2.1 From be8457d3c418441317177bfcdf7378410ac28d55 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Wed, 3 Jun 2009 10:19:17 +0000 Subject: Correctly determine writable status of files on Windows operating system. #39035 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9528 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_main.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index 8a92c06e04..365290e909 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -504,7 +504,7 @@ class acp_main $template->assign_var('S_REMOVE_INSTALL', true); } - if (!defined('PHPBB_DISABLE_CONFIG_CHECK') && file_exists($phpbb_root_path . 'config.' . $phpEx) && is_writable($phpbb_root_path . 'config.' . $phpEx)) + if (!defined('PHPBB_DISABLE_CONFIG_CHECK') && file_exists($phpbb_root_path . 'config.' . $phpEx) && phpbb_is_writable($phpbb_root_path . 'config.' . $phpEx)) { // World-Writable? (000x) $template->assign_var('S_WRITABLE_CONFIG', (bool) (@fileperms($phpbb_root_path . 'config.' . $phpEx) & 0x0002)); -- cgit v1.2.1 From a539fca62b10f53a5f5dadf07f9ab07340fdabf9 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 7 Jun 2009 11:34:01 +0000 Subject: some corrections, only very minor things. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9554 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_captcha.php | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_captcha.php b/phpBB/includes/acp/acp_captcha.php index ed2ccf6ccc..7c7a5acc9f 100644 --- a/phpBB/includes/acp/acp_captcha.php +++ b/phpBB/includes/acp/acp_captcha.php @@ -10,8 +10,6 @@ /** * @ignore */ - - if (!defined('IN_PHPBB')) { exit; @@ -35,13 +33,13 @@ class acp_captcha $selected = request_var('select_captcha', $config['captcha_plugin']); $configure = request_var('configure', false); - + // Oh, they are just here for the view if (isset($_GET['captcha_demo'])) { $this->deliver_demo($selected); } - + // Delegate if ($configure) { @@ -52,6 +50,7 @@ class acp_captcha else { $captchas = phpbb_captcha_factory::get_captcha_types(); + $config_vars = array( 'enable_confirm' => 'REG_ENABLE', 'enable_post_confirm' => 'POST_ENABLE', @@ -68,10 +67,12 @@ class acp_captcha if ($submit && check_form_key($form_key)) { $config_vars = array_keys($config_vars); + foreach ($config_vars as $config_var) { set_config($config_var, request_var($config_var, false)); } + if ($selected !== $config['captcha_plugin']) { // sanity check @@ -79,9 +80,11 @@ class acp_captcha { $old_captcha = phpbb_captcha_factory::get_instance($config['captcha_plugin']); $old_captcha->uninstall(); + set_config('captcha_plugin', $selected); $new_captcha = phpbb_captcha_factory::get_instance($config['captcha_plugin']); - $old_captcha->install(); + $new_captcha->install(); + add_log('admin', 'LOG_CONFIG_VISUAL'); } else @@ -103,14 +106,15 @@ class acp_captcha $current = ($selected !== false && $value == $selected) ? ' selected="selected"' : ''; $captcha_select .= ''; } + foreach ($captchas['unavailable'] as $value => $title) { $current = ($selected !== false && $value == $selected) ? ' selected="selected"' : ''; - $captcha_select .= ''; + $captcha_select .= ''; } $demo_captcha = phpbb_captcha_factory::get_instance($selected); - + foreach ($config_vars as $config_var => $template_var) { $template->assign_var($template_var, (isset($_REQUEST[$config_var])) ? request_var($config_var, '') : $config[$config_var]) ; @@ -121,28 +125,23 @@ class acp_captcha 'CAPTCHA_SELECT' => $captcha_select, )); } - } } - - + /** * Entry point for delivering image CAPTCHAs in the ACP. */ function deliver_demo($selected) { global $db, $user, $config; - + $captcha = phpbb_captcha_factory::get_instance($selected); $captcha->init(CONFIRM_REG); $captcha->execute_demo(); + garbage_collection(); exit_handler(); } - - - - } ?> \ No newline at end of file -- cgit v1.2.1 From 2af8393d0f5fa08b95df989ab879ce1b7d4cab21 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 8 Jun 2009 22:33:30 +0000 Subject: Fix bug #45705 - Show error in the ACP when template folder is not readable. Authorised by: acydburn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9565 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_attachments.php | 2 +- phpBB/includes/acp/acp_styles.php | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index ef20b48cec..de4092036e 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -694,7 +694,7 @@ class acp_attachments $imglist = filelist($phpbb_root_path . $img_path); - if (sizeof($imglist)) + if (!empty($imglist[''])) { $imglist = array_values($imglist); $imglist = $imglist[0]; diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 184c40f218..48802c79df 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -827,6 +827,11 @@ parse_css_file = {PARSE_CSS_FILE} unset($file_info); } + if (empty($filelist[''])) + { + trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING); + } + // Now create the categories $filelist_cats[''] = array(); foreach ($filelist as $pathfile => $file_ary) -- cgit v1.2.1 From 863d7a7614a09dac545d3c3201e67c3beddb3960 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 12 Jun 2009 14:41:03 +0000 Subject: First ATOM Feed commit/integration - Idea and original RSS Feed 2.0 MOD (Version 1.0.8/9) by leviatan21 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9575 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_board.php | 105 +++++++++++++++++++++++++++++++++- phpBB/includes/acp/info/acp_board.php | 1 + 2 files changed, 103 insertions(+), 3 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index bce35ee68f..1b812a9c8f 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -64,6 +64,8 @@ class acp_board 'legend2' => 'WARNINGS', 'warnings_expire_days' => array('lang' => 'WARNINGS_EXPIRE', 'validate' => 'int', 'type' => 'text:3:4', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']), + + 'legend3' => 'ACP_SUBMIT_CHANGES', ) ); break; @@ -93,6 +95,8 @@ class acp_board 'load_cpf_memberlist' => array('lang' => 'LOAD_CPF_MEMBERLIST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'load_cpf_viewprofile' => array('lang' => 'LOAD_CPF_VIEWPROFILE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'load_cpf_viewtopic' => array('lang' => 'LOAD_CPF_VIEWTOPIC', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + + 'legend3' => 'ACP_SUBMIT_CHANGES', ) ); break; @@ -143,7 +147,9 @@ class acp_board 'forward_pm' => array('lang' => 'ALLOW_FORWARD_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'auth_img_pm' => array('lang' => 'ALLOW_IMG_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'auth_flash_pm' => array('lang' => 'ALLOW_FLASH_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), - 'enable_pm_icons' => array('lang' => 'ENABLE_PM_ICONS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false) + 'enable_pm_icons' => array('lang' => 'ENABLE_PM_ICONS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + + 'legend3' => 'ACP_SUBMIT_CHANGES', ) ); break; @@ -182,6 +188,8 @@ class acp_board 'max_quote_depth' => array('lang' => 'QUOTE_DEPTH_LIMIT', 'validate' => 'int:0', 'type' => 'text:4:4', 'explain' => true), 'max_post_img_width' => array('lang' => 'MAX_POST_IMG_WIDTH', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']), 'max_post_img_height' => array('lang' => 'MAX_POST_IMG_HEIGHT', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']), + + 'legend3' => 'ACP_SUBMIT_CHANGES', ) ); break; @@ -205,6 +213,8 @@ class acp_board 'max_sig_smilies' => array('lang' => 'MAX_SIG_SMILIES', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true), 'max_sig_img_width' => array('lang' => 'MAX_SIG_IMG_WIDTH', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']), 'max_sig_img_height' => array('lang' => 'MAX_SIG_IMG_HEIGHT', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']), + + 'legend3' => 'ACP_SUBMIT_CHANGES', ) ); break; @@ -235,6 +245,28 @@ class acp_board 'coppa_enable' => array('lang' => 'ENABLE_COPPA', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'coppa_mail' => array('lang' => 'COPPA_MAIL', 'validate' => 'string', 'type' => 'textarea:5:40', 'explain' => true), 'coppa_fax' => array('lang' => 'COPPA_FAX', 'validate' => 'string', 'type' => 'text:25:100', 'explain' => false), + + 'legend4' => 'ACP_SUBMIT_CHANGES', + ) + ); + break; + + case 'feed': + $display_vars = array( + 'title' => 'ACP_FEED_MANAGEMENT', + 'vars' => array( + 'legend1' => 'ACP_FEED_GENERAL', + 'feed_enable' => array('lang' => 'ACP_FEED_ENABLE', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true ), + 'feed_item_statistics' => array('lang' => 'ACP_FEED_ITEM_STATISTICS', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), + 'feed_limit' => array('lang' => 'ACP_FEED_LIMIT', 'validate' => 'int:5', 'type' => 'text:3:4', 'explain' => true), + 'feed_overall_forums' => array('lang' => 'ACP_FEED_OVERALL_FORUMS', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true ), + 'feed_overall_forums_limit' => array('lang' => 'ACP_FEED_OVERALL_FORUMS_LIMIT', 'validate' => 'int:5', 'type' => 'text:3:4', 'explain' => false), + 'feed_overall_topics' => array('lang' => 'ACP_FEED_OVERALL_TOPIC', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true ), + 'feed_overall_topics_limit' => array('lang' => 'ACP_FEED_OVERALL_TOPIC_LIMIT', 'validate' => 'int:5', 'type' => 'text:3:4', 'explain' => false), + 'feed_forum' => array('lang' => 'ACP_FEED_FORUM', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true ), + 'feed_topic' => array('lang' => 'ACP_FEED_TOPIC', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true ), + 'feed_news_id' => array('lang' => 'ACP_FEED_NEWS', 'validate' => 'string', 'type' => 'select_multiple', 'method' => 'select_news_forums', 'explain' => true ), + 'feed_exclude_id' => array('lang' => 'ACP_FEED_EXCLUDE_ID', 'validate' => 'string', 'type' => 'select_multiple', 'method' => 'select_exclude_forums', 'explain' => true), ) ); break; @@ -279,6 +311,8 @@ class acp_board 'load_cpf_memberlist' => array('lang' => 'LOAD_CPF_MEMBERLIST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'load_cpf_viewprofile' => array('lang' => 'LOAD_CPF_VIEWPROFILE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'load_cpf_viewtopic' => array('lang' => 'LOAD_CPF_VIEWTOPIC', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + + 'legend4' => 'ACP_SUBMIT_CHANGES', ) ); break; @@ -312,6 +346,8 @@ class acp_board 'server_name' => array('lang' => 'SERVER_NAME', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true), 'server_port' => array('lang' => 'SERVER_PORT', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true), 'script_path' => array('lang' => 'SCRIPT_PATH', 'validate' => 'script_path', 'type' => 'text::255', 'explain' => true), + + 'legend4' => 'ACP_SUBMIT_CHANGES', ) ); break; @@ -360,7 +396,9 @@ class acp_board 'smtp_port' => array('lang' => 'SMTP_PORT', 'validate' => 'int:0', 'type' => 'text:4:5', 'explain' => true), 'smtp_auth_method' => array('lang' => 'SMTP_AUTH_METHOD', 'validate' => 'string', 'type' => 'select', 'method' => 'mail_auth_select', 'explain' => true), 'smtp_username' => array('lang' => 'SMTP_USERNAME', 'validate' => 'string', 'type' => 'text:25:255', 'explain' => true), - 'smtp_password' => array('lang' => 'SMTP_PASSWORD', 'validate' => 'string', 'type' => 'password:25:255', 'explain' => true) + 'smtp_password' => array('lang' => 'SMTP_PASSWORD', 'validate' => 'string', 'type' => 'password:25:255', 'explain' => true), + + 'legend3' => 'ACP_SUBMIT_CHANGES', ) ); break; @@ -395,7 +433,7 @@ class acp_board // We go through the display_vars to make sure no one is trying to set variables he/she is not allowed to... foreach ($display_vars['vars'] as $config_name => $null) { - if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false) + if ($null === false || strpos($config_name, 'legend') !== false) { continue; } @@ -405,6 +443,26 @@ class acp_board continue; } + // If not set, then this is a valid entry and needs to be emptied (select_multiple, checkbox) + if (!isset($cfg_array[$config_name])) + { + $cfg_array[$config_name] = ''; + } + + + // Erm, we spotted an array + if ($null['type'] == 'select_multiple' && $submit && isset($_REQUEST['config'][$config_name])) + { + // Get config *array* + $cfg_ = utf8_normalize_nfc(request_var('config', array('' => array('')), true)); + + // Check if the variable is set and an array + if (isset($cfg_[$config_name]) && is_array($cfg_[$config_name])) + { + $cfg_array[$config_name] = trim(serialize($cfg_[$config_name])); + } + } + $this->new_config[$config_name] = $config_value = $cfg_array[$config_name]; if ($config_name == 'email_function_name') @@ -830,6 +888,47 @@ class acp_board return " "; } + + /** + * Select multiple forums + */ + function select_news_forums($value, $key) + { + global $user, $config; + + // Determine ids to be selected + $select_ids = (sizeof($value)) ? $value : false; + + $forum_list = make_forum_select($select_ids, false, true, true, true, false, true); + + // Build forum options + $s_forum_options = ''; + foreach ($forum_list as $f_id => $f_row) + { + $s_forum_options .= ''; + } + + return $s_forum_options; + } + + function select_exclude_forums($value, $key) + { + global $user, $config; + + // Determine ids to be selected + $select_ids = (sizeof($value)) ? $value : false; + + $forum_list = make_forum_select($select_ids, false, true, false, false, false, true); + + // Build forum options + $s_forum_options = ''; + foreach ($forum_list as $f_id => $f_row) + { + $s_forum_options .= ''; + } + + return $s_forum_options; + } } ?> \ No newline at end of file diff --git a/phpBB/includes/acp/info/acp_board.php b/phpBB/includes/acp/info/acp_board.php index 72d86676a6..58b650650c 100644 --- a/phpBB/includes/acp/info/acp_board.php +++ b/phpBB/includes/acp/info/acp_board.php @@ -26,6 +26,7 @@ class acp_board_info 'message' => array('title' => 'ACP_MESSAGE_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION', 'ACP_MESSAGES')), 'post' => array('title' => 'ACP_POST_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')), 'signature' => array('title' => 'ACP_SIGNATURE_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')), + 'feed' => array('title' => 'ACP_FEED_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')), 'registration' => array('title' => 'ACP_REGISTER_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')), 'auth' => array('title' => 'ACP_AUTH_SETTINGS', 'auth' => 'acl_a_server', 'cat' => array('ACP_CLIENT_COMMUNICATION')), -- cgit v1.2.1 From 11dc41063313d62b100c16bceb289b12c7c3bf2b Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Sat, 13 Jun 2009 14:09:51 +0000 Subject: Oh right. PHP4 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9581 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_captcha.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_captcha.php b/phpBB/includes/acp/acp_captcha.php index 7c7a5acc9f..74e0521e12 100644 --- a/phpBB/includes/acp/acp_captcha.php +++ b/phpBB/includes/acp/acp_captcha.php @@ -43,7 +43,7 @@ class acp_captcha // Delegate if ($configure) { - $config_captcha = phpbb_captcha_factory::get_instance($selected); + $config_captcha =& phpbb_captcha_factory::get_instance($selected); $config_captcha->acp_page($id, $this); add_log('admin', 'LOG_CONFIG_VISUAL'); } @@ -78,11 +78,11 @@ class acp_captcha // sanity check if (isset($captchas['available'][$selected])) { - $old_captcha = phpbb_captcha_factory::get_instance($config['captcha_plugin']); + $old_captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']); $old_captcha->uninstall(); set_config('captcha_plugin', $selected); - $new_captcha = phpbb_captcha_factory::get_instance($config['captcha_plugin']); + $new_captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']); $new_captcha->install(); add_log('admin', 'LOG_CONFIG_VISUAL'); @@ -113,7 +113,7 @@ class acp_captcha $captcha_select .= ''; } - $demo_captcha = phpbb_captcha_factory::get_instance($selected); + $demo_captcha =& phpbb_captcha_factory::get_instance($selected); foreach ($config_vars as $config_var => $template_var) { @@ -135,7 +135,7 @@ class acp_captcha { global $db, $user, $config; - $captcha = phpbb_captcha_factory::get_instance($selected); + $captcha =& phpbb_captcha_factory::get_instance($selected); $captcha->init(CONFIRM_REG); $captcha->execute_demo(); -- cgit v1.2.1 From 2d30e880899d7a15c0cac5c1f03c951fb0ceb5be Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 13 Jun 2009 14:23:04 +0000 Subject: use same method to update custom profile fields in UCP and ACP (and then i am able to debug what is wrong with the oracle code) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9582 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_users.php | 49 +--------------------------------------- 1 file changed, 1 insertion(+), 48 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index e5f83faec3..11bfe12354 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1136,54 +1136,7 @@ class acp_users $db->sql_query($sql); // Update Custom Fields - if (sizeof($cp_data)) - { - switch ($db->sql_layer) - { - case 'oracle': - case 'firebird': - case 'postgres': - $right_delim = $left_delim = '"'; - break; - - case 'sqlite': - case 'mssql': - case 'mssql_odbc': - $right_delim = ']'; - $left_delim = '['; - break; - - case 'mysql': - case 'mysql4': - case 'mysqli': - $right_delim = $left_delim = '`'; - break; - } - - foreach ($cp_data as $key => $value) - { - // Firebird is case sensitive with delimiter - $cp_data[$left_delim . (($db->sql_layer == 'firebird') ? strtoupper($key) : $key) . $right_delim] = $value; - unset($cp_data[$key]); - } - - $sql = 'UPDATE ' . PROFILE_FIELDS_DATA_TABLE . ' - SET ' . $db->sql_build_array('UPDATE', $cp_data) . " - WHERE user_id = $user_id"; - $db->sql_query($sql); - - if (!$db->sql_affectedrows()) - { - $cp_data['user_id'] = (int) $user_id; - - $db->sql_return_on_error(true); - - $sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $cp_data); - $db->sql_query($sql); - - $db->sql_return_on_error(false); - } - } + $cp->update_profile_field_data($user_id, $cp_data); trigger_error($user->lang['USER_PROFILE_UPDATED'] . adm_back_link($this->u_action . '&u=' . $user_id)); } -- cgit v1.2.1 From ce144ab0baaafa10bf3e37812e2f5875680de499 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 16 Jun 2009 14:14:07 +0000 Subject: Fix Oracle database backup (Bug #46715) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9598 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_database.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index 856b867c9a..1182e224cf 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -1854,7 +1854,8 @@ class oracle_extractor extends base_extractor // Build the SQL statement to recreate the data. for ($i = 0; $i < $i_num_fields; $i++) { - $str_val = $row[$ary_name[$i]]; + // Oracle uses uppercase - we use lowercase + $str_val = $row[strtolower($ary_name[$i])]; if (preg_match('#char|text|bool|raw#i', $ary_type[$i])) { @@ -1885,7 +1886,7 @@ class oracle_extractor extends base_extractor } $schema_vals[$i] = $str_quote . $str_val . $str_quote; - $schema_fields[$i] = '"' . $ary_name[$i] . "'"; + $schema_fields[$i] = '"' . $ary_name[$i] . '"'; } // Take the ordered fields and their associated data and build it -- cgit v1.2.1 From ef0eed4d9ef83d7dfbcdd1c78f812ef5e135f279 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 16 Jun 2009 16:13:53 +0000 Subject: Fix bug #46145 - Template cache error for files of template-subfolders Authorised by: acydburn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9600 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_styles.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 48802c79df..4c33aa1edb 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -1029,12 +1029,12 @@ parse_css_file = {PARSE_CSS_FILE} foreach ($file_ary as $file) { - $file = str_replace('/', '.', $file); + $file = str_replace('/', '.', $file); // perform some dirty guessing to get the path right. // We assume that three dots in a row were '../' - $tpl_file = str_replace('.', '/', $file); - $tpl_file = str_replace('///', '../', $tpl_file); + $tpl_file = str_replace('.', '/', $file); + $tpl_file = str_replace('///', '../', $tpl_file); $filename = "{$cache_prefix}_$file.html.$phpEx"; @@ -1066,6 +1066,11 @@ parse_css_file = {PARSE_CSS_FILE} } } + // Correct the filename if it is stored in database and the file is in a subfolder. + if ($template_row['template_storedb']) + { + $file = str_replace('.', '/', $file); + } $template->assign_block_vars('file', array( 'U_VIEWSOURCE' => $this->u_action . "&action=cache&id=$template_id&source=$file", @@ -1073,7 +1078,7 @@ parse_css_file = {PARSE_CSS_FILE} 'CACHED' => $user->format_date(filemtime("{$phpbb_root_path}cache/$filename")), 'FILENAME' => $file, 'FILENAME_PATH' => $file_tpl, - 'FILESIZE' => sprintf('%.1f ' . $user->lang['KIB'], filesize("{$phpbb_root_path}cache/$filename") / 1024), + 'FILESIZE' => get_formatted_filesize(filesize("{$phpbb_root_path}cache/$filename")), 'MODIFIED' => $user->format_date((!$template_row['template_storedb']) ? filemtime($file_tpl) : $filemtime[$file . '.html'])) ); } @@ -1271,7 +1276,6 @@ parse_css_file = {PARSE_CSS_FILE} ); } - /** * Edit imagesets * @@ -2409,7 +2413,6 @@ parse_css_file = {PARSE_CSS_FILE} } } - if ($mode == 'template') { $super = array(); @@ -3209,7 +3212,6 @@ parse_css_file = {PARSE_CSS_FILE} $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - if ($row) { // If it exist, we just use the style on installation @@ -3260,7 +3262,6 @@ parse_css_file = {PARSE_CSS_FILE} $inherit_bf = false; } - if (sizeof($error)) { return false; @@ -3530,7 +3531,6 @@ parse_css_file = {PARSE_CSS_FILE} break; } - $sql = "SELECT {$mode}_inherits_id FROM $sql_from WHERE {$mode}_id = " . (int) $id; -- cgit v1.2.1 From 0e5cc91d6bdcef2e50fd8f04b4d5fe2249015f24 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 17 Jun 2009 12:17:19 +0000 Subject: Fix bug #22665 - Display and highlight already used rank images while assigning new rank Authorised by: acydburn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9607 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_ranks.php | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_ranks.php b/phpBB/includes/acp/acp_ranks.php index 41ed5b0fba..a1a10545ef 100644 --- a/phpBB/includes/acp/acp_ranks.php +++ b/phpBB/includes/acp/acp_ranks.php @@ -168,25 +168,22 @@ class acp_ranks { $img = $path . $img; - if (!in_array($img, $existing_imgs) || $action == 'edit') + if ($ranks && $img == $ranks['rank_image']) { - if ($ranks && $img == $ranks['rank_image']) - { - $selected = ' selected="selected"'; - $edit_img = $img; - } - else - { - $selected = ''; - } - - if (strlen($img) > 255) - { - continue; - } - - $filename_list .= ''; + $selected = ' selected="selected"'; + $edit_img = $img; } + else + { + $selected = ''; + } + + if (strlen($img) > 255) + { + continue; + } + + $filename_list .= ''; } } -- cgit v1.2.1 From d7d96223e7bae7cd60b13c6e7896d95838c3633c Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 19 Jun 2009 09:51:50 +0000 Subject: - Display coloured usernames in ACP groups management screens - Changed behaviour of group_create() function to support specifying additional group columns - New groups option to excempt group leaders from group permissions git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9625 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_groups.php | 38 ++++++++++++++++++++++++---------- phpBB/includes/acp/acp_permissions.php | 1 + 2 files changed, 28 insertions(+), 11 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index 2ee5ded01d..3df61ff4e2 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -309,6 +309,7 @@ class acp_groups 'message_limit' => request_var('group_message_limit', 0), 'max_recipients' => request_var('group_max_recipients', 0), 'founder_manage' => 0, + 'skip_auth' => request_var('group_skip_auth', 0), ); if ($user->data['user_type'] == USER_FOUNDER) @@ -400,11 +401,26 @@ class acp_groups // were made. $group_attributes = array(); - $test_variables = array('rank', 'colour', 'avatar', 'avatar_type', 'avatar_width', 'avatar_height', 'receive_pm', 'legend', 'message_limit', 'max_recipients', 'founder_manage'); - foreach ($test_variables as $test) + $test_variables = array( + 'rank' => 'int', + 'colour' => 'string', + 'avatar' => 'string', + 'avatar_type' => 'int', + 'avatar_width' => 'int', + 'avatar_height' => 'int', + 'receive_pm' => 'int', + 'legend' => 'int', + 'message_limit' => 'int', + 'max_recipients'=> 'int', + 'founder_manage'=> 'int', + 'skip_auth' => 'int', + ); + + foreach ($test_variables as $test => $type) { if (isset($submit_ary[$test]) && ($action == 'add' || $group_row['group_' . $test] != $submit_ary[$test])) { + settype($submit_ary[$test], $type); $group_attributes['group_' . $test] = $group_row['group_' . $test] = $submit_ary[$test]; } } @@ -562,7 +578,7 @@ class acp_groups 'GROUP_MESSAGE_LIMIT' => (isset($group_row['group_message_limit'])) ? $group_row['group_message_limit'] : 0, 'GROUP_MAX_RECIPIENTS' => (isset($group_row['group_max_recipients'])) ? $group_row['group_max_recipients'] : 0, 'GROUP_COLOUR' => (isset($group_row['group_colour'])) ? $group_row['group_colour'] : '', - + 'GROUP_SKIP_AUTH' => (!empty($group_row['group_skip_auth'])) ? ' checked="checked"' : '', 'S_DESC_BBCODE_CHECKED' => $group_desc_data['allow_bbcode'], 'S_DESC_URLS_CHECKED' => $group_desc_data['allow_urls'], @@ -591,8 +607,7 @@ class acp_groups 'U_SWATCH' => append_sid("{$phpbb_admin_path}swatch.$phpEx", 'form=settings&name=group_colour'), 'U_ACTION' => "{$this->u_action}&action=$action&g=$group_id", 'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], round($config['avatar_filesize'] / 1024)), - ) - ); + )); return; break; @@ -607,7 +622,7 @@ class acp_groups $this->page_title = 'GROUP_MEMBERS'; // Grab the leaders - always, on every page... - $sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_regdate, u.user_posts, u.group_id, ug.group_leader, ug.user_pending + $sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_regdate, u.user_colour, u.user_posts, u.group_id, ug.group_leader, ug.user_pending FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . " ug WHERE ug.group_id = $group_id AND u.user_id = ug.user_id @@ -621,11 +636,12 @@ class acp_groups 'U_USER_EDIT' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&action=edit&u={$row['user_id']}"), 'USERNAME' => $row['username'], + 'USERNAME_COLOUR' => $row['user_colour'], 'S_GROUP_DEFAULT' => ($row['group_id'] == $group_id) ? true : false, 'JOINED' => ($row['user_regdate']) ? $user->format_date($row['user_regdate']) : ' - ', 'USER_POSTS' => $row['user_posts'], - 'USER_ID' => $row['user_id']) - ); + 'USER_ID' => $row['user_id'], + )); } $db->sql_freeresult($result); @@ -662,7 +678,7 @@ class acp_groups )); // Grab the members - $sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_regdate, u.user_posts, u.group_id, ug.group_leader, ug.user_pending + $sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_colour, u.user_regdate, u.user_posts, u.group_id, ug.group_leader, ug.user_pending FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . " ug WHERE ug.group_id = $group_id AND u.user_id = ug.user_id @@ -687,6 +703,7 @@ class acp_groups 'U_USER_EDIT' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&action=edit&u={$row['user_id']}"), 'USERNAME' => $row['username'], + 'USERNAME_COLOUR' => $row['user_colour'], 'S_GROUP_DEFAULT' => ($row['group_id'] == $group_id) ? true : false, 'JOINED' => ($row['user_regdate']) ? $user->format_date($row['user_regdate']) : ' - ', 'USER_POSTS' => $row['user_posts'], @@ -763,8 +780,7 @@ class acp_groups 'GROUP_NAME' => $group_name, 'TOTAL_MEMBERS' => $row['total_members'], - ) - ); + )); } } } diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php index 164970b5d5..1dab6febdd 100644 --- a/phpBB/includes/acp/acp_permissions.php +++ b/phpBB/includes/acp/acp_permissions.php @@ -963,6 +963,7 @@ class acp_permissions LEFT JOIN ' . USER_GROUP_TABLE . ' ug ON (ug.group_id = g.group_id) WHERE ug.user_id = ' . $user_id . ' AND ug.user_pending = 0 + AND NOT (ug.group_leader = 1 AND g.group_skip_auth = 1) ORDER BY g.group_type DESC, g.group_id DESC'; $result = $db->sql_query($sql); -- cgit v1.2.1 From 7cebffe72fcdbbbad70ccc926192d63a92e426ce Mon Sep 17 00:00:00 2001 From: Gabriel Vazquez Date: Fri, 19 Jun 2009 14:58:21 +0000 Subject: Fixed bug #14304 Authorised by: AcydBurn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9629 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_styles.php | 41 ++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 14 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 4c33aa1edb..16b1852cd6 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -210,23 +210,36 @@ parse_css_file = {PARSE_CSS_FILE} trigger_error($user->lang['DEACTIVATE_DEFAULT'] . adm_back_link($this->u_action), E_USER_WARNING); } - $sql = 'UPDATE ' . STYLES_TABLE . ' - SET style_active = ' . (($action == 'activate') ? 1 : 0) . ' - WHERE style_id = ' . $style_id; - $db->sql_query($sql); - - // Set style to default for any member using deactivated style - if ($action == 'deactivate') + if (($action == 'deactivate' && confirm_box(true)) || $action == 'activate') { - $sql = 'UPDATE ' . USERS_TABLE . ' - SET user_style = ' . $config['default_style'] . " - WHERE user_style = $style_id"; + $sql = 'UPDATE ' . STYLES_TABLE . ' + SET style_active = ' . (($action == 'activate') ? 1 : 0) . ' + WHERE style_id = ' . $style_id; $db->sql_query($sql); - $sql = 'UPDATE ' . FORUMS_TABLE . ' - SET forum_style = 0 - WHERE forum_style = ' . $style_id; - $db->sql_query($sql); + // Set style to default for any member using deactivated style + if ($action == 'deactivate') + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_style = ' . $config['default_style'] . " + WHERE user_style = $style_id"; + $db->sql_query($sql); + + $sql = 'UPDATE ' . FORUMS_TABLE . ' + SET forum_style = 0 + WHERE forum_style = ' . $style_id; + $db->sql_query($sql); + } + } + elseif ( $action == 'deactivate' ) + { + $s_hidden_fields = array( + 'i' => $id, + 'mode' => $mode, + 'action' => $action, + 'style_id' => $style_id, + ); + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields($s_hidden_fields)); } break; } -- cgit v1.2.1 From d85a5ad036b2088fe742de29d9464678d2e19e23 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 19 Jun 2009 22:03:19 +0000 Subject: Fix bug #46785 - Hide avatars if type disabled and give global option to turn on/off Authorised by: acydburn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9632 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_board.php | 1 + phpBB/includes/acp/acp_users.php | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 1b812a9c8f..9349dab5f6 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -112,6 +112,7 @@ class acp_board 'avatar_max_width' => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,), 'avatar_max_height' => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,), + 'allow_avatar' => array('lang' => 'ALLOW_AVATARS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'allow_avatar_local' => array('lang' => 'ALLOW_LOCAL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'allow_avatar_remote' => array('lang' => 'ALLOW_REMOTE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'allow_avatar_upload' => array('lang' => 'ALLOW_UPLOAD', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 11bfe12354..cb3ffe5720 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1429,8 +1429,19 @@ class acp_users $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error); } + if (!$config['allow_avatar'] && $user_row['user_avatar_type']) + { + $error[] = $user->lang['USER_AVATAR_NOT_ALLOWED']; + } + else if ((($user_row['user_avatar_type'] == AVATAR_UPLOAD) && !$config['allow_avatar_upload']) || + (($user_row['user_avatar_type'] == AVATAR_REMOTE) && !$config['allow_avatar_remote']) || + (($user_row['user_avatar_type'] == AVATAR_GALLERY) && !$config['allow_avatar_local'])) + { + $error[] = $user->lang['USER_AVATAR_TYPE_NOT_ALLOWED']; + } + // Generate users avatar - $avatar_img = ($user_row['user_avatar']) ? get_user_avatar($user_row['user_avatar'], $user_row['user_avatar_type'], $user_row['user_avatar_width'], $user_row['user_avatar_height']) : ''; + $avatar_img = ($user_row['user_avatar']) ? get_user_avatar($user_row['user_avatar'], $user_row['user_avatar_type'], $user_row['user_avatar_width'], $user_row['user_avatar_height'], 'USER_AVATAR', true) : ''; $display_gallery = (isset($_POST['display_gallery'])) ? true : false; $avatar_select = basename(request_var('avatar_select', '')); -- cgit v1.2.1 From 433de350c0fa2e1e09c23e6f5f29f118222d2df8 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 20 Jun 2009 18:45:16 +0000 Subject: - [Feature] New "Newly Registered Users" group for assigning permissions to newly registered users. They will be removed from this group once they reach a defineable amount of posts. - [Feature] Ability to define if the "Newly Registered Users" group will be assigned as the default group to newly registered users. As a coincidence also Bug #46535 got fixed. Additionally the error message displayed with trigger_error() if accessing the private message tab in the ucp is now displayed inline in addition to a slightly different message for newly registered users to let them know that access permissions may be lifted over time. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9636 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_board.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 9349dab5f6..7866b1b81f 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -171,8 +171,6 @@ class acp_board 'enable_post_confirm' => array('lang' => 'VISUAL_CONFIRM_POST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'legend2' => 'POSTING', - 'enable_queue_trigger' => array('lang' => 'ENABLE_QUEUE_TRIGGER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), - 'queue_trigger_posts' => array('lang' => 'QUEUE_TRIGGER_POSTS', 'validate' => 'int:0:250', 'type' => 'text:4:4', 'explain' => true), 'bump_type' => false, 'edit_time' => array('lang' => 'EDIT_TIME', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']), 'display_last_edited' => array('lang' => 'DISPLAY_LAST_EDITED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), @@ -229,6 +227,8 @@ class acp_board 'max_pass_chars' => array('lang' => 'PASSWORD_LENGTH', 'validate' => 'int:8:255', 'type' => false, 'method' => false, 'explain' => false,), 'require_activation' => array('lang' => 'ACC_ACTIVATION', 'validate' => 'int', 'type' => 'custom', 'method' => 'select_acc_activation', 'explain' => true), + 'new_member_post_limit' => array('lang' => 'NEW_MEMBER_POST_LIMIT', 'validate' => 'int:0:255', 'type' => 'text:4:4', 'explain' => true, 'append' => ' ' . $user->lang['POSTS']), + 'new_member_group_default'=> array('lang' => 'NEW_MEMBER_GROUP_DEFAULT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'min_name_chars' => array('lang' => 'USERNAME_LENGTH', 'validate' => 'int:1', 'type' => 'custom:5:180', 'method' => 'username_length', 'explain' => true), 'min_pass_chars' => array('lang' => 'PASSWORD_LENGTH', 'validate' => 'int:1', 'type' => 'custom', 'method' => 'password_length', 'explain' => true), 'allow_name_chars' => array('lang' => 'USERNAME_CHARS', 'validate' => 'string', 'type' => 'select', 'method' => 'select_username_chars', 'explain' => true), -- cgit v1.2.1 From c3da86afc6be7183cdf320fe6ff0f6f5ffe46c28 Mon Sep 17 00:00:00 2001 From: Gabriel Vazquez Date: Sat, 20 Jun 2009 19:23:02 +0000 Subject: Fixed bug #45735 Authorised by: AcydBurn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9637 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_language.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php index 71970b4b50..3eee702b1d 100644 --- a/phpBB/includes/acp/acp_language.php +++ b/phpBB/includes/acp/acp_language.php @@ -1254,7 +1254,7 @@ $lang = array_merge($lang, array( $keys = func_get_args(); $non_static = array_shift($keys); - $value = array_shift($keys); + $value = utf8_normalize_nfc(array_shift($keys)); if (!$non_static) { -- cgit v1.2.1 From 794e122cfa01539e912786455da59e25d459a56f Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Sun, 21 Jun 2009 14:31:00 +0000 Subject: add quicktool to remove users from the newly registered special group. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9646 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_users.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index cb3ffe5720..fd64025565 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -650,6 +650,28 @@ class acp_users trigger_error($user->lang['USER_POSTS_MOVED'] . adm_back_link($this->u_action . '&u=' . $user_id)); break; + + case 'leave_nr': + + if (confirm_box(true)) + { + remove_newly_registered($user_id, $user_row); + + add_log('admin', 'LOG_USER_REMOVED_NR', $user_row['username']); + trigger_error($user->lang['USER_LIFTED_NR'] . adm_back_link($this->u_action . '&u=' . $user_id)); + } + else + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'u' => $user_id, + 'i' => $id, + 'mode' => $mode, + 'action' => $action, + 'update' => true)) + ); + } + + break; } // Handle registration info updates @@ -821,6 +843,10 @@ class acp_users if ($user_id == $user->data['user_id']) { $quick_tool_ary = array('delsig' => 'DEL_SIG', 'delavatar' => 'DEL_AVATAR', 'moveposts' => 'MOVE_POSTS', 'delposts' => 'DEL_POSTS', 'delattach' => 'DEL_ATTACH'); + if ($user_row['user_new']) + { + $quick_tool_ary['leave_nr'] = 'LEAVE_NR'; + } } else { @@ -842,6 +868,10 @@ class acp_users { $quick_tool_ary['reactivate'] = 'FORCE'; } + if ($user_row['user_new']) + { + $quick_tool_ary['leave_nr'] = 'LEAVE_NR'; + } } $s_action_options = ''; -- cgit v1.2.1 From 588dd7337fd87719b21cf2ec85671713e925acb9 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 22 Jun 2009 09:43:01 +0000 Subject: Fix bug #13673 - Add confirm-box when deleting permissions Authorised by: acydburn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9652 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_permissions.php | 60 ++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 21 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php index 1dab6febdd..077a3d7c83 100644 --- a/phpBB/includes/acp/acp_permissions.php +++ b/phpBB/includes/acp/acp_permissions.php @@ -217,43 +217,61 @@ class acp_permissions trigger_error($user->lang['WRONG_PERMISSION_TYPE'] . adm_back_link($this->u_action), E_USER_WARNING); } - // Handle actions if (strpos($mode, 'setting_') === 0 && $action) { switch ($action) { case 'delete': - - if (!check_form_key($form_name)) + if (confirm_box(true)) { - trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING); - } - // All users/groups selected? - $all_users = (isset($_POST['all_users'])) ? true : false; - $all_groups = (isset($_POST['all_groups'])) ? true : false; + // All users/groups selected? + $all_users = (isset($_POST['all_users'])) ? true : false; + $all_groups = (isset($_POST['all_groups'])) ? true : false; - if ($all_users || $all_groups) - { - $items = $this->retrieve_defined_user_groups($permission_scope, $forum_id, $permission_type); + if ($all_users || $all_groups) + { + $items = $this->retrieve_defined_user_groups($permission_scope, $forum_id, $permission_type); + + if ($all_users && sizeof($items['user_ids'])) + { + $user_id = $items['user_ids']; + } + else if ($all_groups && sizeof($items['group_ids'])) + { + $group_id = $items['group_ids']; + } + } - if ($all_users && sizeof($items['user_ids'])) + if (sizeof($user_id) || sizeof($group_id)) { - $user_id = $items['user_ids']; + $this->remove_permissions($mode, $permission_type, $auth_admin, $user_id, $group_id, $forum_id); } - else if ($all_groups && sizeof($items['group_ids'])) + else { - $group_id = $items['group_ids']; + trigger_error($user->lang['NO_USER_GROUP_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING); } } - - if (sizeof($user_id) || sizeof($group_id)) - { - $this->remove_permissions($mode, $permission_type, $auth_admin, $user_id, $group_id, $forum_id); - } else { - trigger_error($user->lang['NO_USER_GROUP_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING); + $s_hidden_fields = array( + 'i' => $id, + 'mode' => $mode, + 'action' => array($action => 1), + 'user_id' => $user_id, + 'group_id' => $group_id, + 'forum_id' => $forum_id, + 'type' => $permission_type, + ); + if (isset($_POST['all_users'])) + { + $s_hidden_fields['all_users'] = 1; + } + if (isset($_POST['all_groups'])) + { + $s_hidden_fields['all_groups'] = 1; + } + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields($s_hidden_fields)); } break; -- cgit v1.2.1 From b1584a8d5c709c4c909826e23286ca6aa438cf41 Mon Sep 17 00:00:00 2001 From: Ruslan Uzdenov Date: Mon, 22 Jun 2009 16:16:04 +0000 Subject: Fix bug #46965 - File named install in php directory Authorised by: acydburn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9654 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_main.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index 365290e909..5d6bd40681 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -499,7 +499,7 @@ class acp_main } // Warn if install is still present - if (file_exists($phpbb_root_path . 'install')) + if (file_exists($phpbb_root_path . 'install') && !is_file($phpbb_root_path . 'install')) { $template->assign_var('S_REMOVE_INSTALL', true); } -- cgit v1.2.1 From c32f49679f635175d43de7264ee09782c56c628e Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 23 Jun 2009 10:48:53 +0000 Subject: - add options for quick reply (forum-based and board-wide) - add option for minimum post chars (which is a required setting for quick reply, therefore we introduce it here) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9656 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_board.php | 3 +++ phpBB/includes/acp/acp_forums.php | 5 +++++ 2 files changed, 8 insertions(+) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 7866b1b81f..41849b909a 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -87,6 +87,7 @@ class acp_board 'allow_nocensors' => array('lang' => 'ALLOW_NO_CENSORS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'allow_bookmarks' => array('lang' => 'ALLOW_BOOKMARKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'allow_birthdays' => array('lang' => 'ALLOW_BIRTHDAYS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'allow_quick_reply' => array('lang' => 'ALLOW_QUICK_REPLY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'legend2' => 'ACP_LOAD_SETTINGS', 'load_birthdays' => array('lang' => 'YES_BIRTHDAYS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), @@ -169,6 +170,7 @@ class acp_board 'allow_nocensors' => array('lang' => 'ALLOW_NO_CENSORS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'allow_bookmarks' => array('lang' => 'ALLOW_BOOKMARKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'enable_post_confirm' => array('lang' => 'VISUAL_CONFIRM_POST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'allow_quick_reply' => array('lang' => 'ALLOW_QUICK_REPLY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'legend2' => 'POSTING', 'bump_type' => false, @@ -181,6 +183,7 @@ class acp_board 'hot_threshold' => array('lang' => 'HOT_THRESHOLD', 'validate' => 'int:0', 'type' => 'text:3:4', 'explain' => true), 'max_poll_options' => array('lang' => 'MAX_POLL_OPTIONS', 'validate' => 'int:2:127', 'type' => 'text:4:4', 'explain' => false), 'max_post_chars' => array('lang' => 'CHAR_LIMIT', 'validate' => 'int:0', 'type' => 'text:4:6', 'explain' => true), + 'min_post_chars' => array('lang' => 'MIN_CHAR_LIMIT', 'validate' => 'int:0', 'type' => 'text:4:6', 'explain' => true), 'max_post_smilies' => array('lang' => 'SMILIES_LIMIT', 'validate' => 'int:0', 'type' => 'text:4:4', 'explain' => true), 'max_post_urls' => array('lang' => 'MAX_POST_URLS', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true), 'max_post_font_size' => array('lang' => 'MAX_POST_FONT_SIZE', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true, 'append' => ' %'), diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index bf5242ace6..810caa62d5 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -139,6 +139,7 @@ class acp_forums 'enable_icons' => request_var('enable_icons', false), 'enable_prune' => request_var('enable_prune', false), 'enable_post_review' => request_var('enable_post_review', true), + 'enable_quick_reply' => request_var('enable_quick_reply', false), 'prune_days' => request_var('prune_days', 7), 'prune_viewed' => request_var('prune_viewed', 7), 'prune_freq' => request_var('prune_freq', 1), @@ -423,6 +424,7 @@ class acp_forums $forum_data['forum_flags'] += (request_var('prune_sticky', false)) ? FORUM_FLAG_PRUNE_STICKY : 0; $forum_data['forum_flags'] += ($forum_data['show_active']) ? FORUM_FLAG_ACTIVE_TOPICS : 0; $forum_data['forum_flags'] += (request_var('enable_post_review', true)) ? FORUM_FLAG_POST_REVIEW : 0; + $forum_data['forum_flags'] += (request_var('enable_quick_reply', false)) ? FORUM_FLAG_QUICK_REPLY : 0; } // Show form to create/modify a forum @@ -682,6 +684,7 @@ class acp_forums 'S_PRUNE_STICKY' => ($forum_data['forum_flags'] & FORUM_FLAG_PRUNE_STICKY) ? true : false, 'S_DISPLAY_ACTIVE_TOPICS' => ($forum_data['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS) ? true : false, 'S_ENABLE_POST_REVIEW' => ($forum_data['forum_flags'] & FORUM_FLAG_POST_REVIEW) ? true : false, + 'S_ENABLE_QUICK_REPLY' => ($forum_data['forum_flags'] & FORUM_FLAG_QUICK_REPLY) ? true : false, 'S_CAN_COPY_PERMISSIONS' => ($action != 'edit' || empty($forum_id) || ($auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth'))) ? true : false, )); @@ -941,6 +944,7 @@ class acp_forums $forum_data['forum_flags'] += ($forum_data['prune_sticky']) ? FORUM_FLAG_PRUNE_STICKY : 0; $forum_data['forum_flags'] += ($forum_data['show_active']) ? FORUM_FLAG_ACTIVE_TOPICS : 0; $forum_data['forum_flags'] += ($forum_data['enable_post_review']) ? FORUM_FLAG_POST_REVIEW : 0; + $forum_data['forum_flags'] += ($forum_data['enable_quick_reply']) ? FORUM_FLAG_QUICK_REPLY : 0; // Unset data that are not database fields $forum_data_sql = $forum_data; @@ -951,6 +955,7 @@ class acp_forums unset($forum_data_sql['prune_sticky']); unset($forum_data_sql['show_active']); unset($forum_data_sql['enable_post_review']); + unset($forum_data_sql['enable_quick_reply']); unset($forum_data_sql['forum_password_confirm']); // What are we going to do tonight Brain? The same thing we do everynight, -- cgit v1.2.1 From 4279658e1ffeab6cf4c5989ba5a88685a6927c4b Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Tue, 23 Jun 2009 13:22:05 +0000 Subject: meh git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9660 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_captcha.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_captcha.php b/phpBB/includes/acp/acp_captcha.php index 74e0521e12..2fc8fe7486 100644 --- a/phpBB/includes/acp/acp_captcha.php +++ b/phpBB/includes/acp/acp_captcha.php @@ -121,8 +121,8 @@ class acp_captcha } $template->assign_vars(array( - 'CAPTCHA_PREVIEW' => $demo_captcha->get_demo_template($id), - 'CAPTCHA_SELECT' => $captcha_select, + 'CAPTCHA_PREVIEW_TPL' => $demo_captcha->get_demo_template($id), + 'CAPTCHA_SELECT' => $captcha_select, )); } } -- cgit v1.2.1 From 08a88fcf33693d4349d3fb478ce4704d70ba3111 Mon Sep 17 00:00:00 2001 From: Gabriel Vazquez Date: Wed, 24 Jun 2009 13:31:04 +0000 Subject: [Feature] Add confirmation for deactivating language packs Authorised by: AcydBurn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9669 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_language.php | 43 ++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 15 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php index 3eee702b1d..8ca45a27f6 100644 --- a/phpBB/includes/acp/acp_language.php +++ b/phpBB/includes/acp/acp_language.php @@ -766,28 +766,41 @@ class acp_language trigger_error($user->lang['NO_REMOVE_DEFAULT_LANG'] . adm_back_link($this->u_action), E_USER_WARNING); } - $db->sql_query('DELETE FROM ' . LANG_TABLE . ' WHERE lang_id = ' . $lang_id); + if (confirm_box(true)) + { + $db->sql_query('DELETE FROM ' . LANG_TABLE . ' WHERE lang_id = ' . $lang_id); - $sql = 'UPDATE ' . USERS_TABLE . " - SET user_lang = '" . $db->sql_escape($config['default_lang']) . "' - WHERE user_lang = '" . $db->sql_escape($row['lang_iso']) . "'"; - $db->sql_query($sql); + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_lang = '" . $db->sql_escape($config['default_lang']) . "' + WHERE user_lang = '" . $db->sql_escape($row['lang_iso']) . "'"; + $db->sql_query($sql); - // We also need to remove the translated entries for custom profile fields - we want clean tables, don't we? - $sql = 'DELETE FROM ' . PROFILE_LANG_TABLE . ' WHERE lang_id = ' . $lang_id; - $db->sql_query($sql); + // We also need to remove the translated entries for custom profile fields - we want clean tables, don't we? + $sql = 'DELETE FROM ' . PROFILE_LANG_TABLE . ' WHERE lang_id = ' . $lang_id; + $db->sql_query($sql); - $sql = 'DELETE FROM ' . PROFILE_FIELDS_LANG_TABLE . ' WHERE lang_id = ' . $lang_id; - $db->sql_query($sql); + $sql = 'DELETE FROM ' . PROFILE_FIELDS_LANG_TABLE . ' WHERE lang_id = ' . $lang_id; + $db->sql_query($sql); - $sql = 'DELETE FROM ' . STYLES_IMAGESET_DATA_TABLE . " WHERE image_lang = '" . $db->sql_escape($row['lang_iso']) . "'"; - $result = $db->sql_query($sql); + $sql = 'DELETE FROM ' . STYLES_IMAGESET_DATA_TABLE . " WHERE image_lang = '" . $db->sql_escape($row['lang_iso']) . "'"; + $result = $db->sql_query($sql); - $cache->destroy('sql', STYLES_IMAGESET_DATA_TABLE); + $cache->destroy('sql', STYLES_IMAGESET_DATA_TABLE); - add_log('admin', 'LOG_LANGUAGE_PACK_DELETED', $row['lang_english_name']); + add_log('admin', 'LOG_LANGUAGE_PACK_DELETED', $row['lang_english_name']); - trigger_error(sprintf($user->lang['LANGUAGE_PACK_DELETED'], $row['lang_english_name']) . adm_back_link($this->u_action)); + trigger_error(sprintf($user->lang['LANGUAGE_PACK_DELETED'], $row['lang_english_name']) . adm_back_link($this->u_action)); + } + else + { + $s_hidden_fields = array( + 'i' => $id, + 'mode' => $mode, + 'action' => $action, + 'id' => $lang_id, + ); + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields($s_hidden_fields)); + } break; case 'install': -- cgit v1.2.1 From 7ca31ace1a023c910470208abec219b1c03923ac Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 25 Jun 2009 10:39:36 +0000 Subject: fix r9652 Authorised by: AcydBurn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9673 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_permissions.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php index 077a3d7c83..8e03a7fa52 100644 --- a/phpBB/includes/acp/acp_permissions.php +++ b/phpBB/includes/acp/acp_permissions.php @@ -254,6 +254,16 @@ class acp_permissions } else { + if (isset($_POST['cancel'])) + { + $u_redirect = $this->u_action . '&type=' . $permission_type; + foreach ($forum_id as $fid) + { + $u_redirect .= '&forum_id[]=' . $fid; + } + redirect($u_redirect); + } + $s_hidden_fields = array( 'i' => $id, 'mode' => $mode, -- cgit v1.2.1 From 5d6dca16a7b7e9c043570139c90b97c83a01bb5e Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 26 Jun 2009 10:47:19 +0000 Subject: Fix bug #47345 - Check if template file is empty before trying to read from it. Authorised by: acydburn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9682 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_styles.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 16b1852cd6..ab9ddc0b6f 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -2556,9 +2556,22 @@ parse_css_file = {PARSE_CSS_FILE} { trigger_error("Could not open {$phpbb_root_path}styles/$template_path$pathfile$file", E_USER_ERROR); } - $template_data = fread($fp, filesize("{$phpbb_root_path}styles/$template_path$pathfile$file")); + + $filesize = filesize("{$phpbb_root_path}styles/$template_path$pathfile$file"); + + if ($filesize) + { + $template_data = fread($fp, $filesize); + } + fclose($fp); + if (!$filesize) + { + // File is empty + continue; + } + if (preg_match_all('##is', $template_data, $matches)) { foreach ($matches[1] as $match) -- cgit v1.2.1 From adaeec1ec9f7cd55522a5c4d0bf0538dbc0c6f99 Mon Sep 17 00:00:00 2001 From: Ruslan Uzdenov Date: Sat, 27 Jun 2009 08:36:40 +0000 Subject: Fixed Bug #45115 - Signature parsing flags are not stored in DB Authorised by: AcydBurn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9696 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_users.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index fd64025565..c663103e17 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1545,9 +1545,9 @@ class acp_users include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx); include_once($phpbb_root_path . 'includes/functions_display.' . $phpEx); - $enable_bbcode = ($config['allow_sig_bbcode']) ? ((request_var('disable_bbcode', !$user->optionget('bbcode'))) ? false : true) : false; - $enable_smilies = ($config['allow_sig_smilies']) ? ((request_var('disable_smilies', !$user->optionget('smilies'))) ? false : true) : false; - $enable_urls = ($config['allow_sig_links']) ? ((request_var('disable_magic_url', false)) ? false : true) : false; + $enable_bbcode = ($config['allow_sig_bbcode']) ? (bool) $this->optionget($user_row, 'sig_bbcode') : false; + $enable_smilies = ($config['allow_sig_smilies']) ? (bool) $this->optionget($user_row, 'sig_smilies') : false; + $enable_urls = ($config['allow_sig_links']) ? (bool) $this->optionget($user_row, 'sig_links') : false; $signature = utf8_normalize_nfc(request_var('signature', (string) $user_row['user_sig'], true)); $preview = (isset($_POST['preview'])) ? true : false; @@ -1556,6 +1556,10 @@ class acp_users { include_once($phpbb_root_path . 'includes/message_parser.' . $phpEx); + $enable_bbcode = ($config['allow_sig_bbcode']) ? ((request_var('disable_bbcode', false)) ? false : true) : false; + $enable_smilies = ($config['allow_sig_smilies']) ? ((request_var('disable_smilies', false)) ? false : true) : false; + $enable_urls = ($config['allow_sig_links']) ? ((request_var('disable_magic_url', false)) ? false : true) : false; + $message_parser = new parse_message($signature); // Allowing Quote BBCode @@ -1573,8 +1577,13 @@ class acp_users if (!sizeof($error) && $submit) { + $this->optionset($user_row, 'sig_bbcode', $enable_bbcode); + $this->optionset($user_row, 'sig_smilies', $enable_smilies); + $this->optionset($user_row, 'sig_links', $enable_urls); + $sql_ary = array( 'user_sig' => (string) $message_parser->message, + 'user_options' => $user_row['user_options'], 'user_sig_bbcode_uid' => (string) $message_parser->bbcode_uid, 'user_sig_bbcode_bitfield' => (string) $message_parser->bbcode_bitfield ); -- cgit v1.2.1 From 6273718dc5a7812b980ca45b20d123e5e0908026 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sat, 27 Jun 2009 20:56:49 +0000 Subject: acp module for submitting statistical information to phpBB git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9698 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_ranks.php | 2 +- phpBB/includes/acp/acp_send_statistics.php | 93 +++++++++++++++++++++++++ phpBB/includes/acp/info/acp_send_statistics.php | 37 ++++++++++ 3 files changed, 131 insertions(+), 1 deletion(-) create mode 100644 phpBB/includes/acp/acp_send_statistics.php create mode 100644 phpBB/includes/acp/info/acp_send_statistics.php (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_ranks.php b/phpBB/includes/acp/acp_ranks.php index a1a10545ef..fcfef2a61e 100644 --- a/phpBB/includes/acp/acp_ranks.php +++ b/phpBB/includes/acp/acp_ranks.php @@ -39,7 +39,7 @@ class acp_ranks $this->tpl_name = 'acp_ranks'; $this->page_title = 'ACP_MANAGE_RANKS'; - $form_name = 'acp_prune'; + $form_name = 'acp_ranks'; add_form_key($form_name); switch ($action) diff --git a/phpBB/includes/acp/acp_send_statistics.php b/phpBB/includes/acp/acp_send_statistics.php new file mode 100644 index 0000000000..4bfacfdb50 --- /dev/null +++ b/phpBB/includes/acp/acp_send_statistics.php @@ -0,0 +1,93 @@ +tpl_name = 'acp_send_statistics'; + $this->page_title = 'ACP_SEND_STATISTICS'; + + $c = new Questionnaire_Data_Collector(); + $c->addDataProvider(new Questionnaire_PHP_Data_Provider()); + $c->addDataProvider(new Questionnaire_System_Data_Provider()); + $c->addDataProvider(new questionnaire_phpbb_data_provider($config)); + + $template->assign_vars(array( + 'U_COLLECT_STATS' => $collect_url, + 'RAW_DATA' => $c->getDataForForm(), + )); + + $raw = $c->getDataRaw(); + + foreach ($raw as $provider => $data) + { + $template->assign_block_vars('providers', array( + 'NAME' => htmlentities($provider), + )); + + foreach ($data as $key => $value) + { + if (is_array($value)) + { + $value = utf8_wordwrap(serialize($value), 75, "\n", true); + } + + $template->assign_block_vars('providers.values', array( + 'KEY' => htmlentities($key), + 'VALUE' => htmlentities($value), + )); + } + } + } + + /** + * Output the data as an HTML Definition List. + * + * @param mixed + * @param string + * @param string + * @return void + */ + function data_printer($value, $key) + { + echo '
', htmlentities($key), '
', $ident, "\t", '
'; + if (is_array($value)) + { + $value = htmlentities(serialize($value)); + echo '
'; + echo '
'; + } else { + echo htmlentities($value); + } + echo '
'; + } +} + +?> \ No newline at end of file diff --git a/phpBB/includes/acp/info/acp_send_statistics.php b/phpBB/includes/acp/info/acp_send_statistics.php new file mode 100644 index 0000000000..33e66ecd26 --- /dev/null +++ b/phpBB/includes/acp/info/acp_send_statistics.php @@ -0,0 +1,37 @@ + 'acp_send_statistics', + 'title' => 'ACP_SEND_STATISTICS', + 'version' => '1.0.0', + 'modes' => array( + 'questionnaire' => array('title' => 'ACP_SEND_STATISTICS', 'auth' => 'acl_a_server', 'cat' => array('ACP_SERVER_CONFIGURATION')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} + +?> \ No newline at end of file -- cgit v1.2.1 From b07b30f55d872b8e7450fe954964ebf534ac2092 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sat, 27 Jun 2009 21:08:42 +0000 Subject: did not have auto props on this machine - removed an unused function from the new acp file git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9699 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_send_statistics.php | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_send_statistics.php b/phpBB/includes/acp/acp_send_statistics.php index 4bfacfdb50..1549157041 100644 --- a/phpBB/includes/acp/acp_send_statistics.php +++ b/phpBB/includes/acp/acp_send_statistics.php @@ -2,7 +2,7 @@ /** * * @package acp -* @version $Id: acp_ranks.php 8479 2008-03-29 00:22:48Z naderman $ +* @version $Id$ * @copyright (c) 2005 phpBB Group * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @@ -66,28 +66,6 @@ class acp_send_statistics } } } - - /** - * Output the data as an HTML Definition List. - * - * @param mixed - * @param string - * @param string - * @return void - */ - function data_printer($value, $key) - { - echo '
', htmlentities($key), '
', $ident, "\t", '
'; - if (is_array($value)) - { - $value = htmlentities(serialize($value)); - echo '
'; - echo '
'; - } else { - echo htmlentities($value); - } - echo '
'; - } } ?> \ No newline at end of file -- cgit v1.2.1 From 1c5e724e5ecbf3a9e36d3e34dd50f4cd3134f696 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Mon, 29 Jun 2009 14:36:05 +0000 Subject: undoing change from #9575, as it broke the board disabled message git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9704 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_board.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 41849b909a..008594a319 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -437,7 +437,7 @@ class acp_board // We go through the display_vars to make sure no one is trying to set variables he/she is not allowed to... foreach ($display_vars['vars'] as $config_name => $null) { - if ($null === false || strpos($config_name, 'legend') !== false) + if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false) { continue; } -- cgit v1.2.1 From 3f7ab4b8a6759374bc48c2ee5b8c88d1b695f0eb Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Mon, 6 Jul 2009 13:10:05 +0000 Subject: Add a purge option for the session table to the acp. Seems that many boards get unusable due to styles not embedding the cron image and/or extremely long session timeout settings and/or DOS attacks. This new button can be a stopgap measure in those cases. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9714 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_main.php | 42 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index 5d6bd40681..42f6aa0b8e 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -97,6 +97,10 @@ class acp_main $confirm = true; $confirm_lang = 'PURGE_CACHE_CONFIRM'; break; + case 'purge_sessions': + $confirm = true; + $confirm_lang = 'PURGE_SESSIONS_CONFIRM'; + break; default: $confirm = true; @@ -341,6 +345,44 @@ class acp_main add_log('admin', 'LOG_PURGE_CACHE'); break; + + case 'purge_sessions': + if ((int) $user->data['user_type'] !== USER_FOUNDER) + { + trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $tables = array(CONFIRM_TABLE, SESSIONS_TABLE); + + // DELETE would probably take a lot longer if we're dealing with a runaway table + foreach ($tables as $table) + { + $sql = "TRUNCATE TABLE $table"; + $db->sql_query($sql); + } + + // let's restore the admin session + $reinsert_ary = array( + 'session_id' => (string) $user->session_id, + 'session_page' => (string) substr($user->page['page'], 0, 199), + 'session_forum_id' => $user->page['forum'], + 'session_user_id' => (int) $user->data['user_id'], + 'session_start' => (int) $user->data['session_start'], + 'session_last_visit' => (int) $user->data['session_last_visit'], + 'session_time' => (int) $user->time_now, + 'session_browser' => (string) trim(substr($user->browser, 0, 149)), + 'session_forwarded_for' => (string) $user->forwarded_for, + 'session_ip' => (string) $user->ip, + 'session_autologin' => (int) $user->data['session_autologin'], + 'session_admin' => 1, + 'session_viewonline' => (int) $user->data['session_viewonline'], + ); + + $sql = 'INSERT INTO ' . SESSIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $reinsert_ary); + $db->sql_query($sql); + + add_log('admin', 'LOG_PURGE_SESSIONS'); + break; } } } -- cgit v1.2.1 From fa84400d288374f9c702757cc619db815a65fefb Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Tue, 7 Jul 2009 09:22:01 +0000 Subject: restore firebird/sqlite support. TODO - the DBAL should handle this git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9718 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_main.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index 42f6aa0b8e..e0d6a3f01c 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -354,11 +354,19 @@ class acp_main $tables = array(CONFIRM_TABLE, SESSIONS_TABLE); - // DELETE would probably take a lot longer if we're dealing with a runaway table foreach ($tables as $table) { - $sql = "TRUNCATE TABLE $table"; - $db->sql_query($sql); + switch ($db->sql_layer) + { + case 'sqlite': + case 'firebird': + $db->sql_query("DELETE FROM $table"); + break; + + default: + $db->sql_query("TRUNCATE TABLE $table"); + break; + } } // let's restore the admin session -- cgit v1.2.1 From 59a5278c69250adf1b8459df45b7873613240a09 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 7 Jul 2009 09:29:00 +0000 Subject: merged questioinnaire and questionnaire_phpbb and adjusted all files to our coding guidelines... if we want to allow dropping in other providers we could add provider files to the questionnaire directory (and grab them), if not it is best to remove the questionnaire directory and put the file under includes/ git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9719 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_send_statistics.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_send_statistics.php b/phpBB/includes/acp/acp_send_statistics.php index 1549157041..6c29b9fbb5 100644 --- a/phpBB/includes/acp/acp_send_statistics.php +++ b/phpBB/includes/acp/acp_send_statistics.php @@ -15,8 +15,8 @@ if (!defined('IN_PHPBB')) { exit; } -include($phpbb_root_path . 'includes/questionnaire/questionnaire_phpbb.' . $phpEx); +include($phpbb_root_path . 'includes/questionnaire/questionnaire.' . $phpEx); /** * @package acp @@ -34,22 +34,24 @@ class acp_send_statistics $this->tpl_name = 'acp_send_statistics'; $this->page_title = 'ACP_SEND_STATISTICS'; - $c = new Questionnaire_Data_Collector(); - $c->addDataProvider(new Questionnaire_PHP_Data_Provider()); - $c->addDataProvider(new Questionnaire_System_Data_Provider()); - $c->addDataProvider(new questionnaire_phpbb_data_provider($config)); + $collector = new phpbb_questionnaire_data_collector(); + + // Add data provider + $collector->add_data_provider(new phpbb_questionnaire_php_data_provider()); + $collector->add_data_provider(new phpbb_questionnaire_system_data_provider()); + $collector->add_data_provider(new phpbb_questionnaire_phpbb_data_provider($config)); $template->assign_vars(array( 'U_COLLECT_STATS' => $collect_url, - 'RAW_DATA' => $c->getDataForForm(), + 'RAW_DATA' => $collector->get_data_for_form(), )); - $raw = $c->getDataRaw(); + $raw = $collector->get_data_raw(); foreach ($raw as $provider => $data) { $template->assign_block_vars('providers', array( - 'NAME' => htmlentities($provider), + 'NAME' => htmlspecialchars($provider), )); foreach ($data as $key => $value) @@ -60,8 +62,8 @@ class acp_send_statistics } $template->assign_block_vars('providers.values', array( - 'KEY' => htmlentities($key), - 'VALUE' => htmlentities($value), + 'KEY' => utf8_htmlspecialchars($key), + 'VALUE' => utf8_htmlspecialchars($value), )); } } -- cgit v1.2.1 From 2e8d14004f9fc7083fcd7b377b86ea5cef7d55db Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Tue, 7 Jul 2009 10:52:59 +0000 Subject: Coding guidelines in r9629 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9720 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_styles.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index ab9ddc0b6f..166ad11d3e 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -231,7 +231,7 @@ parse_css_file = {PARSE_CSS_FILE} $db->sql_query($sql); } } - elseif ( $action == 'deactivate' ) + else if ($action == 'deactivate') { $s_hidden_fields = array( 'i' => $id, -- cgit v1.2.1 From fd667f9932f5420815396291c2b13238dc2944a1 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 7 Jul 2009 13:33:53 +0000 Subject: Fix bug #47815 - View end of ban in MCP and ACP when user is banned by duration - Patch by Pyramide Authorised by: AcydBurn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9727 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_ban.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_ban.php b/phpBB/includes/acp/acp_ban.php index 77fb44dda9..542ed47f3b 100644 --- a/phpBB/includes/acp/acp_ban.php +++ b/phpBB/includes/acp/acp_ban.php @@ -181,7 +181,22 @@ class acp_ban $banned_options .= '' . $row[$field] . ''; $time_length = ($row['ban_end']) ? ($row['ban_end'] - $row['ban_start']) / 60 : 0; - $ban_length[$row['ban_id']] = (isset($ban_end_text[$time_length])) ? $ban_end_text[$time_length] : $user->lang['UNTIL'] . ' -> ' . $user->format_date($row['ban_end']); + + if ($time_length == 0) + { + // Banned permanently + $ban_length[$row['ban_id']] = $user->lang['PERMANENT']; + } + else if (isset($ban_end_text[$time_length])) + { + // Banned for a given duration + $ban_length[$row['ban_id']] = sprintf($user->lang['BANNED_UNTIL_DURATION'], $ban_end_text[$time_length], $user->format_date($row['ban_end'], false, true)); + } + else + { + // Banned until given date + $ban_length[$row['ban_id']] = sprintf($user->lang['BANNED_UNTIL_DATE'], $user->format_date($row['ban_end'], false, true)); + } $ban_reasons[$row['ban_id']] = $row['ban_reason']; $ban_give_reasons[$row['ban_id']] = $row['ban_give_reason']; -- cgit v1.2.1 From 61453bb2aba7c1acfedab0ea600c9d13ee751976 Mon Sep 17 00:00:00 2001 From: Ruslan Uzdenov Date: Wed, 8 Jul 2009 14:30:01 +0000 Subject: Fixed Bug #24075 - GZIP status is not showed up correctly in debug mode Authorised by: AcydBurn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9737 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_main.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index e0d6a3f01c..f9d611f8db 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -485,7 +485,7 @@ class acp_main 'UPLOAD_DIR_SIZE' => $upload_dir_size, 'TOTAL_ORPHAN' => $total_orphan, 'S_TOTAL_ORPHAN' => ($total_orphan === false) ? false : true, - 'GZIP_COMPRESSION' => ($config['gzip_compress']) ? $user->lang['ON'] : $user->lang['OFF'], + 'GZIP_COMPRESSION' => ($config['gzip_compress'] && @extension_loaded('zlib')) ? $user->lang['ON'] : $user->lang['OFF'], 'DATABASE_INFO' => $db->sql_server_info(), 'BOARD_VERSION' => $config['version'], -- cgit v1.2.1 From 54ee31972af4f84e09ad5b12ca512e5712bbd87a Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sat, 11 Jul 2009 10:05:20 +0000 Subject: Fix bug #47775 - Properly convert and show filesize information Authorised by: naderman git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9748 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_attachments.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index de4092036e..0fc0fe0848 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -684,8 +684,9 @@ class acp_attachments $ext_group_row['max_filesize'] = (int) $config['max_filesize']; } - $size_format = ($ext_group_row['max_filesize'] >= 1048576) ? 'mb' : (($ext_group_row['max_filesize'] >= 1024) ? 'kb' : 'b'); - $ext_group_row['max_filesize'] = get_formatted_filesize($ext_group_row['max_filesize'], false); + $max_filesize = get_formatted_filesize($ext_group_row['max_filesize'], false, array('mb', 'kb', 'b')); + $size_format = $max_filesize['si_identifier']; + $ext_group_row['max_filesize'] = $max_filesize['value']; $img_path = $config['upload_icons_path']; @@ -1429,8 +1430,9 @@ class acp_attachments function max_filesize($value, $key = '') { // Determine size var and adjust the value accordingly - $size_var = ($value >= 1048576) ? 'mb' : (($value >= 1024) ? 'kb' : 'b'); - $value = get_formatted_filesize($value, false); + $filesize = get_formatted_filesize($value, false, array('mb', 'kb', 'b')); + $size_var = $filesize['si_identifier']; + $value = $filesize['value']; return ' '; } -- cgit v1.2.1 From 5cbf5d4b16a41ea2599cb7f56836d5b963ab4000 Mon Sep 17 00:00:00 2001 From: Ruslan Uzdenov Date: Tue, 14 Jul 2009 12:02:11 +0000 Subject: Fix bug #44295 - Cannot prune users who never logged in Authorised by: AcydBurn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9754 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_prune.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php index a82a438db7..7eeb37133f 100644 --- a/phpBB/includes/acp/acp_prune.php +++ b/phpBB/includes/acp/acp_prune.php @@ -406,7 +406,12 @@ class acp_prune $where_sql .= (sizeof($joined)) ? " AND user_regdate " . $key_match[$joined_select] . ' ' . gmmktime(0, 0, 0, (int) $joined[1], (int) $joined[2], (int) $joined[0]) : ''; $where_sql .= ($count !== '') ? " AND user_posts " . $key_match[$count_select] . ' ' . (int) $count . ' ' : ''; - if (sizeof($active) && $active_select != 'lt') + // First handle pruning of users who never logged in, last active date is 0000-00-00 + if (sizeof($active) && (int) $active[0] == 0 && (int) $active[1] == 0 && (int) $active[2] == 0) + { + $where_sql .= ' AND user_lastvisit = 0'; + } + else if (sizeof($active) && $active_select != 'lt') { $where_sql .= ' AND user_lastvisit ' . $key_match[$active_select] . ' ' . gmmktime(0, 0, 0, (int) $active[1], (int) $active[2], (int) $active[0]); } -- cgit v1.2.1 From 0b2979c6bab97297f839937606635fd4cc6b1eae Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 14 Jul 2009 20:25:41 +0000 Subject: Feature Bug #45375 - Add option to disable remote upload avatars Authorised by: AcydBurn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9757 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_board.php | 1 + phpBB/includes/acp/acp_users.php | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 008594a319..a4a2572c0f 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -117,6 +117,7 @@ class acp_board 'allow_avatar_local' => array('lang' => 'ALLOW_LOCAL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'allow_avatar_remote' => array('lang' => 'ALLOW_REMOTE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'allow_avatar_upload' => array('lang' => 'ALLOW_UPLOAD', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_avatar_remote_upload'=> array('lang' => 'ALLOW_REMOTE_UPLOAD', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'avatar_filesize' => array('lang' => 'MAX_FILESIZE', 'validate' => 'int:0', 'type' => 'text:4:10', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']), 'avatar_min' => array('lang' => 'MIN_AVATAR_SIZE', 'validate' => 'int:0', 'type' => 'dimension:3:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']), 'avatar_max' => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int:0', 'type' => 'dimension:3:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']), diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index c663103e17..1cd7a405d5 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1484,10 +1484,11 @@ class acp_users $template->assign_vars(array( 'S_AVATAR' => true, - 'S_CAN_UPLOAD' => ($can_upload && $config['allow_avatar_upload']) ? true : false, - 'S_ALLOW_REMOTE' => ($config['allow_avatar_remote']) ? true : false, - 'S_DISPLAY_GALLERY' => ($config['allow_avatar_local'] && !$display_gallery) ? true : false, - 'S_IN_GALLERY' => ($config['allow_avatar_local'] && $display_gallery) ? true : false, + 'S_UPLOAD_FILE' => ($config['allow_avatar'] && $can_upload && $config['allow_avatar_upload']) ? true : false, + 'S_REMOTE_UPLOAD' => ($config['allow_avatar'] && $can_upload && $config['allow_avatar_remote_upload']) ? true : false, + 'S_ALLOW_REMOTE' => ($config['allow_avatar'] && $config['allow_avatar_remote']) ? true : false, + 'S_DISPLAY_GALLERY' => ($config['allow_avatar'] && $config['allow_avatar_local'] && !$display_gallery) ? true : false, + 'S_IN_GALLERY' => ($config['allow_avatar'] && $config['allow_avatar_local'] && $display_gallery) ? true : false, 'AVATAR_IMAGE' => $avatar_img, 'AVATAR_MAX_FILESIZE' => $config['avatar_filesize'], -- cgit v1.2.1 From e3866c939d78b925844cd61d6ad567988f24e42d Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 14 Jul 2009 20:35:53 +0000 Subject: Feature Bug #43375 - Ability to delete warnings and keep warnings permanently Authorised by: AcydBurn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9758 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_users.php | 142 ++++++++++++++++++++++++++++++++++ phpBB/includes/acp/info/acp_users.php | 1 + 2 files changed, 143 insertions(+) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 1cd7a405d5..d8fef3f547 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1065,6 +1065,148 @@ class acp_users break; + case 'warnings': + $user->add_lang('mcp'); + + // Set up general vars + $start = request_var('start', 0); + $deletemark = (isset($_POST['delmarked'])) ? true : false; + $deleteall = (isset($_POST['delall'])) ? true : false; + $confirm = (isset($_POST['confirm'])) ? true : false; + $marked = request_var('mark', array(0)); + $message = utf8_normalize_nfc(request_var('message', '', true)); + + // Sort keys + $sort_days = request_var('st', 0); + $sort_key = request_var('sk', 't'); + $sort_dir = request_var('sd', 'd'); + + // Delete entries if requested and able + if ($deletemark || $deleteall || $confirm) + { + if (confirm_box(true)) + { + $where_sql = ''; + $deletemark = request_var('delmarked', 0); + $deleteall = request_var('delall', 0); + if ($deletemark && $marked) + { + $sql_in = array(); + foreach ($marked as $mark) + { + $sql_in[] = $mark; + } + $where_sql = ' AND ' . $db->sql_in_set('warning_id', $sql_in); + unset($sql_in); + } + + if ($where_sql || $deleteall) + { + $sql = 'DELETE FROM ' . WARNINGS_TABLE . " + WHERE user_id = $user_id + $where_sql"; + $db->sql_query($sql); + + if ($deleteall) + { + $deleted_warnings = '0'; + } + else + { + $deleted_warnings = ' user_warnings - ' . $db->sql_affectedrows(); + } + + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_warnings = $deleted_warnings + WHERE user_id = $user_id"; + $db->sql_query($sql); + + add_log('admin', 'LOG_WARNING_DELETED', $user_row['username']); + } + } + else + { + $s_hidden_fields = array( + 'i' => $id, + 'mode' => $mode, + 'u' => $user_id, + 'mark' => $marked, + ); + if (isset($_POST['delmarked'])) + { + $s_hidden_fields['delmarked'] = 1; + } + if (isset($_POST['delall'])) + { + $s_hidden_fields['delall'] = 1; + } + if (isset($_POST['delall']) || (isset($_POST['delmarked']) && sizeof($marked))) + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields($s_hidden_fields)); + } + } + } + + $sql = 'SELECT w.warning_id, w.warning_time, w.post_id, l.log_operation, l.log_data, l.user_id AS mod_user_id, m.username AS mod_username, m.user_colour AS mod_user_colour + FROM ' . WARNINGS_TABLE . ' w + LEFT JOIN ' . LOG_TABLE . ' l + ON (w.log_id = l.log_id) + LEFT JOIN ' . USERS_TABLE . ' m + ON (l.user_id = m.user_id) + WHERE w.user_id = ' . $user_id . ' + ORDER BY w.warning_time DESC'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if (!$row['log_operation']) + { + // We do not have a log-entry anymore, so there is no data available + $row['action'] = $user->lang['USER_WARNING_LOG_DELETED']; + } + else + { + $row['action'] = (isset($user->lang[$row['log_operation']])) ? $user->lang[$row['log_operation']] : '{' . ucfirst(str_replace('_', ' ', $row['log_operation'])) . '}'; + if (!empty($row['log_data'])) + { + $log_data_ary = @unserialize($row['log_data']); + $log_data_ary = ($log_data_ary === false) ? array() : $log_data_ary; + + if (isset($user->lang[$row['log_operation']])) + { + // Check if there are more occurrences of % than arguments, if there are we fill out the arguments array + // It doesn't matter if we add more arguments than placeholders + if ((substr_count($row['action'], '%') - sizeof($log_data_ary)) > 0) + { + $log_data_ary = array_merge($log_data_ary, array_fill(0, substr_count($row['action'], '%') - sizeof($log_data_ary), '')); + } + $row['action'] = vsprintf($row['action'], $log_data_ary); + $row['action'] = bbcode_nl2br(censor_text($row['action'])); + } + else if (!empty($log_data_ary)) + { + $row['action'] .= '
' . implode('', $log_data_ary); + } + } + } + + + $template->assign_block_vars('warn', array( + 'ID' => $row['warning_id'], + 'USERNAME' => ($row['log_operation']) ? get_username_string('full', $row['mod_user_id'], $row['mod_username'], $row['mod_user_colour']) : '-', + 'ACTION' => make_clickable($row['action']), + 'DATE' => $user->format_date($row['warning_time']), + )); + } + $db->sql_freeresult($result); + + $template->assign_vars(array( + 'S_WARNINGS' => true, + 'S_CLEARLOGS' => $auth->acl_get('a_clearlogs'), + )); + + break; + case 'profile': include($phpbb_root_path . 'includes/functions_user.' . $phpEx); diff --git a/phpBB/includes/acp/info/acp_users.php b/phpBB/includes/acp/info/acp_users.php index 0cd5f7ae97..10081ac870 100644 --- a/phpBB/includes/acp/info/acp_users.php +++ b/phpBB/includes/acp/info/acp_users.php @@ -22,6 +22,7 @@ class acp_users_info 'modes' => array( 'overview' => array('title' => 'ACP_MANAGE_USERS', 'auth' => 'acl_a_user', 'cat' => array('ACP_CAT_USERS')), 'feedback' => array('title' => 'ACP_USER_FEEDBACK', 'auth' => 'acl_a_user', 'display' => false, 'cat' => array('ACP_CAT_USERS')), + 'warnings' => array('title' => 'ACP_USER_WARNINGS', 'auth' => 'acl_a_user', 'display' => false, 'cat' => array('ACP_CAT_USERS')), 'profile' => array('title' => 'ACP_USER_PROFILE', 'auth' => 'acl_a_user', 'display' => false, 'cat' => array('ACP_CAT_USERS')), 'prefs' => array('title' => 'ACP_USER_PREFS', 'auth' => 'acl_a_user', 'display' => false, 'cat' => array('ACP_CAT_USERS')), 'avatar' => array('title' => 'ACP_USER_AVATAR', 'auth' => 'acl_a_user', 'display' => false, 'cat' => array('ACP_CAT_USERS')), -- cgit v1.2.1 From 33033ad12555377a9b50cfbeb72b683ddd56b893 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 14 Jul 2009 20:40:45 +0000 Subject: Fix Bug #45675 - Do not allow setting group as default group for pending user Authorised by: AcydBurn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9759 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_users.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index d8fef3f547..c27c259b46 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -2017,6 +2017,29 @@ class acp_users } break; + + case 'approve': + + if (confirm_box(true)) + { + if (!$group_id) + { + trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + group_user_attributes($action, $group_id, $user_id); + } + else + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'u' => $user_id, + 'i' => $id, + 'mode' => $mode, + 'action' => $action, + 'g' => $group_id)) + ); + } + + break; } // Add user to group? @@ -2109,10 +2132,12 @@ class acp_users 'U_DEFAULT' => $this->u_action . "&action=default&u=$user_id&g=" . $data['group_id'], 'U_DEMOTE_PROMOTE' => $this->u_action . '&action=' . (($data['group_leader']) ? 'demote' : 'promote') . "&u=$user_id&g=" . $data['group_id'], 'U_DELETE' => $this->u_action . "&action=delete&u=$user_id&g=" . $data['group_id'], + 'U_APPROVE' => ($group_type == 'pending') ? $this->u_action . "&action=approve&u=$user_id&g=" . $data['group_id'] : '', 'GROUP_NAME' => ($group_type == 'special') ? $user->lang['G_' . $data['group_name']] : $data['group_name'], 'L_DEMOTE_PROMOTE' => ($data['group_leader']) ? $user->lang['GROUP_DEMOTE'] : $user->lang['GROUP_PROMOTE'], + 'S_IS_MEMBER' => ($group_type != 'pending') ? true : false, 'S_NO_DEFAULT' => ($user_row['group_id'] != $data['group_id']) ? true : false, 'S_SPECIAL_GROUP' => ($group_type == 'special') ? true : false, ) -- cgit v1.2.1 From a7776919945450eb2c0a37af30b35695f93fae51 Mon Sep 17 00:00:00 2001 From: "Marek A. R" Date: Thu, 16 Jul 2009 17:57:05 +0000 Subject: - Add pagination for icons and smilies in the ACP and smilies in the smiley popup git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9763 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_board.php | 1 + phpBB/includes/acp/acp_icons.php | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index a4a2572c0f..5966d5a4b2 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -181,6 +181,7 @@ class acp_board 'bump_interval' => array('lang' => 'BUMP_INTERVAL', 'validate' => 'int:0', 'type' => 'custom', 'method' => 'bump_interval', 'explain' => true), 'topics_per_page' => array('lang' => 'TOPICS_PER_PAGE', 'validate' => 'int:1', 'type' => 'text:3:4', 'explain' => false), 'posts_per_page' => array('lang' => 'POSTS_PER_PAGE', 'validate' => 'int:1', 'type' => 'text:3:4', 'explain' => false), + 'smilies_per_page' => array('lang' => 'SMILIES_PER_PAGE', 'validate' => 'int:1', 'type' => 'text:3:4', 'explain' => false), 'hot_threshold' => array('lang' => 'HOT_THRESHOLD', 'validate' => 'int:0', 'type' => 'text:3:4', 'explain' => true), 'max_poll_options' => array('lang' => 'MAX_POLL_OPTIONS', 'validate' => 'int:2:127', 'type' => 'text:4:4', 'explain' => false), 'max_post_chars' => array('lang' => 'CHAR_LIMIT', 'validate' => 'int:0', 'type' => 'text:4:6', 'explain' => true), diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php index a88090cb25..cd26d46044 100644 --- a/phpBB/includes/acp/acp_icons.php +++ b/phpBB/includes/acp/acp_icons.php @@ -173,7 +173,7 @@ class acp_icons FROM $table ORDER BY {$fields}_order " . (($icon_id || $action == 'add') ? 'DESC' : 'ASC'); $result = $db->sql_query($sql); - + $data = array(); $after = false; $display = 0; @@ -835,12 +835,20 @@ class acp_icons ); $spacer = false; + + $sql = "SELECT COUNT(*) AS count + FROM $table"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + $item_count = $row['count']; $sql = "SELECT * FROM $table ORDER BY {$fields}_order ASC"; - $result = $db->sql_query($sql); + $result = $db->sql_query_limit($sql, $config['smilies_per_page'], request_var('start', 0)); + $pagination_start = request_var('start', 0); while ($row = $db->sql_fetchrow($result)) { $alt_text = ($mode == 'smilies') ? $row['code'] : ''; @@ -855,9 +863,9 @@ class acp_icons 'EMOTION' => (isset($row['emotion'])) ? $row['emotion'] : '', 'U_EDIT' => $this->u_action . '&action=edit&id=' . $row[$fields . '_id'], 'U_DELETE' => $this->u_action . '&action=delete&id=' . $row[$fields . '_id'], - 'U_MOVE_UP' => $this->u_action . '&action=move_up&id=' . $row[$fields . '_id'], - 'U_MOVE_DOWN' => $this->u_action . '&action=move_down&id=' . $row[$fields . '_id']) - ); + 'U_MOVE_UP' => $this->u_action . '&action=move_up&id=' . $row[$fields . '_id'] . '&start=' . $pagination_start, + 'U_MOVE_DOWN' => $this->u_action . '&action=move_down&id=' . $row[$fields . '_id'] . '&start=' . $pagination_start, + )); if (!$spacer && !$row['display_on_posting']) { @@ -865,6 +873,8 @@ class acp_icons } } $db->sql_freeresult($result); + $template->assign_var('PAGINATION', generate_pagination( + $this->u_action, $item_count, $config['smilies_per_page'], $pagination_start, true)); } } -- cgit v1.2.1 From dce2a9b039184a8c5dddf4825cf0b6b3081bc3fd Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 17 Jul 2009 09:05:09 +0000 Subject: A small correction to #r9763 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9764 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_icons.php | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php index cd26d46044..e261a6cbf0 100644 --- a/phpBB/includes/acp/acp_icons.php +++ b/phpBB/includes/acp/acp_icons.php @@ -168,7 +168,7 @@ class acp_icons } } } - + $sql = "SELECT * FROM $table ORDER BY {$fields}_order " . (($icon_id || $action == 'add') ? 'DESC' : 'ASC'); @@ -180,7 +180,7 @@ class acp_icons $order_lists = array('', ''); $add_order_lists = array('', ''); $display_count = 0; - + while ($row = $db->sql_fetchrow($result)) { if ($action == 'add') @@ -234,12 +234,12 @@ class acp_icons $colspan = (($mode == 'smilies') ? '7' : '5'); $colspan += ($icon_id) ? 1 : 0; $colspan += ($action == 'add') ? 2 : 0; - + $template->assign_vars(array( 'S_EDIT' => true, 'S_SMILIES' => ($mode == 'smilies') ? true : false, 'S_ADD' => ($action == 'add') ? true : false, - + 'S_ORDER_LIST_DISPLAY' => $order_list . $order_lists[1], 'S_ORDER_LIST_UNDISPLAY' => $order_list . $order_lists[0], 'S_ORDER_LIST_DISPLAY_COUNT' => $display_count + 1, @@ -286,10 +286,10 @@ class acp_icons 'S_ADD_CODE' => true, 'S_IMG_OPTIONS' => $smiley_options, - + 'S_ADD_ORDER_LIST_DISPLAY' => $add_order_list . $add_order_lists[1], 'S_ADD_ORDER_LIST_UNDISPLAY' => $add_order_list . $add_order_lists[0], - + 'IMG_SRC' => $phpbb_root_path . $img_path . '/' . $default_row['smiley_url'], 'IMG_PATH' => $img_path, 'PHPBB_ROOT_PATH' => $phpbb_root_path, @@ -303,7 +303,7 @@ class acp_icons } return; - + break; case 'create': @@ -311,7 +311,7 @@ class acp_icons // Get items to create/modify $images = (isset($_POST['image'])) ? array_keys(request_var('image', array('' => 0))) : array(); - + // Now really get the items $image_id = (isset($_POST['id'])) ? request_var('id', array('' => 0)) : array(); $image_order = (isset($_POST['order'])) ? request_var('order', array('' => 0)) : array(); @@ -426,13 +426,13 @@ class acp_icons $db->sql_query($sql); $icons_updated++; } - + } } - + $cache->destroy('_icons'); $cache->destroy('sql', $table); - + $level = E_USER_NOTICE; switch ($icons_updated) { @@ -440,11 +440,11 @@ class acp_icons $suc_lang = "{$lang}_NONE"; $level = E_USER_WARNING; break; - + case 1: $suc_lang = "{$lang}_ONE"; break; - + default: $suc_lang = $lang; } @@ -835,20 +835,19 @@ class acp_icons ); $spacer = false; - + $pagination_start = request_var('start', 0); + $sql = "SELECT COUNT(*) AS count FROM $table"; $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); + $item_count = (int) $db->sql_fetchfield('count'); $db->sql_freeresult($result); - $item_count = $row['count']; $sql = "SELECT * FROM $table ORDER BY {$fields}_order ASC"; - $result = $db->sql_query_limit($sql, $config['smilies_per_page'], request_var('start', 0)); + $result = $db->sql_query_limit($sql, $config['smilies_per_page'], $pagination_start); - $pagination_start = request_var('start', 0); while ($row = $db->sql_fetchrow($result)) { $alt_text = ($mode == 'smilies') ? $row['code'] : ''; @@ -874,7 +873,8 @@ class acp_icons } $db->sql_freeresult($result); $template->assign_var('PAGINATION', generate_pagination( - $this->u_action, $item_count, $config['smilies_per_page'], $pagination_start, true)); + + $this->u_action, $item_count, $config['smilies_per_page'], $pagination_start, true)); } } -- cgit v1.2.1 From 955939ee1b8f95948c37628ee996a6ac07c305a2 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 17 Jul 2009 10:11:10 +0000 Subject: Fix bug #47495 - Move hardcoded language string to language file. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9765 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_database.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index 1182e224cf..575137ea2d 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -548,7 +548,9 @@ class base_extractor if (!$this->fp) { - trigger_error('Unable to write temporary file to storage folder', E_USER_ERROR); + global $user; + + trigger_error($user->lang['FILE_WRITE_FAIL'], E_USER_ERROR); } } } -- cgit v1.2.1 From 2f9f52b151338903ed9721475f6cb3d753d100b9 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 17 Jul 2009 10:11:48 +0000 Subject: ok, i misread this one. :) related to r9763 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9766 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_icons.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php index e261a6cbf0..291f846999 100644 --- a/phpBB/includes/acp/acp_icons.php +++ b/phpBB/includes/acp/acp_icons.php @@ -872,9 +872,10 @@ class acp_icons } } $db->sql_freeresult($result); - $template->assign_var('PAGINATION', generate_pagination( - $this->u_action, $item_count, $config['smilies_per_page'], $pagination_start, true)); + $template->assign_var('PAGINATION', + generate_pagination($this->u_action, $item_count, $config['smilies_per_page'], $pagination_start, true) + ); } } -- cgit v1.2.1 From 6cacfce937c64cae1f90dedef130f3a39fa2c317 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Fri, 17 Jul 2009 11:27:50 +0000 Subject: Ability to empty a user's outbox from the user ACP quick tools. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9767 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_users.php | 55 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index c27c259b46..cb342ac300 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -495,6 +495,56 @@ class acp_users break; + case 'deloutbox': + + if (confirm_box(true)) + { + $msg_ids = array(); + $lang = 'EMPTY'; + + $sql = 'SELECT msg_id + FROM ' . PRIVMSGS_TO_TABLE . " + WHERE author_id = $user_id + AND folder_id = " . PRIVMSGS_OUTBOX; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + if (!function_exists('delete_pm')) + { + include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx); + } + + do + { + $msg_ids[] = (int) $row['msg_id']; + } + while ($row = $db->sql_fetchrow($result)); + + $db->sql_freeresult($result); + + delete_pm($user_id, $msg_ids, PRIVMSGS_OUTBOX); + + add_log('admin', 'LOG_USER_DEL_OUTBOX', $user_row['username']); + + $lang = 'EMPTIED'; + } + $db->sql_freeresult($result); + + trigger_error($user->lang['USER_OUTBOX_' . $lang] . adm_back_link($this->u_action . '&u=' . $user_id)); + } + else + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'u' => $user_id, + 'i' => $id, + 'mode' => $mode, + 'action' => $action, + 'update' => true)) + ); + } + break; + case 'moveposts': if (!check_form_key($form_name)) @@ -842,7 +892,7 @@ class acp_users if ($user_id == $user->data['user_id']) { - $quick_tool_ary = array('delsig' => 'DEL_SIG', 'delavatar' => 'DEL_AVATAR', 'moveposts' => 'MOVE_POSTS', 'delposts' => 'DEL_POSTS', 'delattach' => 'DEL_ATTACH'); + $quick_tool_ary = array('delsig' => 'DEL_SIG', 'delavatar' => 'DEL_AVATAR', 'moveposts' => 'MOVE_POSTS', 'delposts' => 'DEL_POSTS', 'delattach' => 'DEL_ATTACH', 'deloutbox' => 'DEL_OUTBOX'); if ($user_row['user_new']) { $quick_tool_ary['leave_nr'] = 'LEAVE_NR'; @@ -862,12 +912,13 @@ class acp_users $quick_tool_ary += array('active' => (($user_row['user_type'] == USER_INACTIVE) ? 'ACTIVATE' : 'DEACTIVATE')); } - $quick_tool_ary += array('delsig' => 'DEL_SIG', 'delavatar' => 'DEL_AVATAR', 'moveposts' => 'MOVE_POSTS', 'delposts' => 'DEL_POSTS', 'delattach' => 'DEL_ATTACH'); + $quick_tool_ary += array('delsig' => 'DEL_SIG', 'delavatar' => 'DEL_AVATAR', 'moveposts' => 'MOVE_POSTS', 'delposts' => 'DEL_POSTS', 'delattach' => 'DEL_ATTACH', 'deloutbox' => 'DEL_OUTBOX'); if ($config['email_enable'] && ($user_row['user_type'] == USER_NORMAL || $user_row['user_type'] == USER_INACTIVE)) { $quick_tool_ary['reactivate'] = 'FORCE'; } + if ($user_row['user_new']) { $quick_tool_ary['leave_nr'] = 'LEAVE_NR'; -- cgit v1.2.1 From 9b9298cfaa0612372926ba83feef39a2c6c215fe Mon Sep 17 00:00:00 2001 From: "Marek A. R" Date: Fri, 17 Jul 2009 13:56:24 +0000 Subject: - Add hard limit for smilies git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9772 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_icons.php | 55 +++++++++++++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 7 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php index 291f846999..fa1e324cc6 100644 --- a/phpBB/includes/acp/acp_icons.php +++ b/phpBB/includes/acp/acp_icons.php @@ -231,7 +231,7 @@ class acp_icons $data = $_images; } - $colspan = (($mode == 'smilies') ? '7' : '5'); + $colspan = (($mode == 'smilies') ? 7 : 5); $colspan += ($icon_id) ? 1 : 0; $colspan += ($action == 'add') ? 2 : 0; @@ -348,6 +348,25 @@ class acp_icons } } + if ($mode == 'smilies' && $action == 'create') + { + $smiley_count = $this->item_count($table); + + $addable_smileys_count = sizeof($images); + foreach ($images as $image) + { + if (!isset($image_add[$image])) + { + --$addable_smileys_count; + } + } + + if ($smiley_count + $addable_smileys_count > SMILEY_LIMIT) + { + trigger_error(sprintf($user->lang['TOO_MANY_SMILIES'], SMILEY_LIMIT) . adm_back_link($this->u_action), E_USER_WARNING); + } + } + $icons_updated = 0; $errors = array(); foreach ($images as $image) @@ -495,7 +514,6 @@ class acp_icons } } - // The user has already selected a smilies_pak file if ($current == 'delete') { @@ -541,6 +559,15 @@ class acp_icons $db->sql_freeresult($result); } + if ($mode == 'smilies') + { + $smiley_count = $this->item_count($table); + if ($smiley_count + sizeof($pak_ary) > SMILEY_LIMIT) + { + trigger_error(sprintf($user->lang['TOO_MANY_SMILIES'], SMILEY_LIMIT) . adm_back_link($this->u_action), E_USER_WARNING); + } + } + foreach ($pak_ary as $pak_entry) { $data = array(); @@ -837,11 +864,7 @@ class acp_icons $spacer = false; $pagination_start = request_var('start', 0); - $sql = "SELECT COUNT(*) AS count - FROM $table"; - $result = $db->sql_query($sql); - $item_count = (int) $db->sql_fetchfield('count'); - $db->sql_freeresult($result); + $item_count = $this->item_count($table); $sql = "SELECT * FROM $table @@ -877,6 +900,24 @@ class acp_icons generate_pagination($this->u_action, $item_count, $config['smilies_per_page'], $pagination_start, true) ); } + + /** + * Returns the count of smilies or icons in the database + * + * @param string $table The table of items to count. + * @return int number of items + */ + /* private */ function item_count($table) + { + global $db; + + $sql = "SELECT COUNT(*) AS count + FROM $table"; + $result = $db->sql_query($sql); + $item_count = (int) $db->sql_fetchfield('count'); + $db->sql_freeresult($result); + return $item_count; + } } ?> \ No newline at end of file -- cgit v1.2.1 From 50e5bdf08cac2c98c233876a5439aefa1d77e436 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 17 Jul 2009 16:39:16 +0000 Subject: Small change to r9765, Bug #47495 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9773 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_database.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index 575137ea2d..bf02a58dce 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -548,9 +548,7 @@ class base_extractor if (!$this->fp) { - global $user; - - trigger_error($user->lang['FILE_WRITE_FAIL'], E_USER_ERROR); + trigger_error('FILE_WRITE_FAIL', E_USER_ERROR); } } } -- cgit v1.2.1 From b6a1271c3aedab008be367565db9c9713e22e638 Mon Sep 17 00:00:00 2001 From: Jim Wigginton Date: Sat, 18 Jul 2009 19:19:38 +0000 Subject: - added ability to filter logs by log_operation git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9781 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_logs.php | 62 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_logs.php b/phpBB/includes/acp/acp_logs.php index 12953173f1..c44592a23c 100644 --- a/phpBB/includes/acp/acp_logs.php +++ b/phpBB/includes/acp/acp_logs.php @@ -104,6 +104,65 @@ class acp_logs $sql_where = ($sort_days) ? (time() - ($sort_days * 86400)) : 0; $sql_sort = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC'); + $log_operation = request_var('log_operation', ''); + $s_lang_keys = ''; + + switch ($mode) + { + case 'admin': + $log_type = LOG_ADMIN; + $sql_forum = ''; + break; + + case 'mod': + $log_type = LOG_MOD; + + if ($topic_id) + { + $sql_forum = 'AND topic_id = ' . intval($topic_id); + } + else if (is_array($forum_id)) + { + $sql_forum = 'AND ' . $db->sql_in_set('forum_id', array_map('intval', $forum_id)); + } + else + { + $sql_forum = ($forum_id) ? 'AND forum_id = ' . intval($forum_id) : ''; + } + break; + + case 'user': + $log_type = LOG_USERS; + $sql_forum = 'AND reportee_id = ' . (int) $user_id; + break; + + case 'users': + $log_type = LOG_USERS; + $sql_forum = ''; + break; + + case 'critical': + $log_type = LOG_CRITICAL; + $sql_forum = ''; + break; + + default: + return; + } + + $sql = "SELECT DISTINCT log_operation + FROM " . LOG_TABLE . " + WHERE log_type = $log_type + " . (($limit_days) ? "AND log_time >= $sql_where " : ' ') . + $sql_forum; + $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) + { + $selected = ($log_operation == $row['log_operation']) ? ' selected="selected"' : ''; + $s_lang_keys .= ''; + } + $db->sql_freeresult($result); + $l_title = $user->lang['ACP_' . strtoupper($mode) . '_LOGS']; $l_title_explain = $user->lang['ACP_' . strtoupper($mode) . '_LOGS_EXPLAIN']; @@ -123,7 +182,7 @@ class acp_logs // Grab log data $log_data = array(); $log_count = 0; - view_log($mode, $log_data, $log_count, $config['topics_per_page'], $start, $forum_id, 0, 0, $sql_where, $sql_sort); + view_log($mode, $log_data, $log_count, $config['topics_per_page'], $start, $forum_id, 0, 0, $sql_where, $sql_sort, $log_operation); $template->assign_vars(array( 'L_TITLE' => $l_title, @@ -136,6 +195,7 @@ class acp_logs 'S_LIMIT_DAYS' => $s_limit_days, 'S_SORT_KEY' => $s_sort_key, 'S_SORT_DIR' => $s_sort_dir, + 'S_LANG_KEYS' => $s_lang_keys, 'S_CLEARLOGS' => $auth->acl_get('a_clearlogs'), ) ); -- cgit v1.2.1 From b3767cd1436bf2b579ad2e0c1c17f55881d4dc4e Mon Sep 17 00:00:00 2001 From: Jim Wigginton Date: Mon, 20 Jul 2009 00:57:18 +0000 Subject: - added filtration ability to MCP - added missing lang variable - fixed a pagination bug in filtration routines git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9800 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_logs.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_logs.php b/phpBB/includes/acp/acp_logs.php index c44592a23c..f13979ec0f 100644 --- a/phpBB/includes/acp/acp_logs.php +++ b/phpBB/includes/acp/acp_logs.php @@ -158,8 +158,12 @@ class acp_logs $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { + if (empty($row['log_operation'])) + { + continue; + } $selected = ($log_operation == $row['log_operation']) ? ' selected="selected"' : ''; - $s_lang_keys .= ''; + $s_lang_keys .= ''; } $db->sql_freeresult($result); -- cgit v1.2.1 From 3a3872766177c30c580353c2946b0d308685a2c5 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Tue, 21 Jul 2009 10:26:18 +0000 Subject: copy regiustration attempt setting to acp_captcha - although the setting is pointless git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9809 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_captcha.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_captcha.php b/phpBB/includes/acp/acp_captcha.php index 2fc8fe7486..c3588ceb9e 100644 --- a/phpBB/includes/acp/acp_captcha.php +++ b/phpBB/includes/acp/acp_captcha.php @@ -52,9 +52,10 @@ class acp_captcha $captchas = phpbb_captcha_factory::get_captcha_types(); $config_vars = array( - 'enable_confirm' => 'REG_ENABLE', - 'enable_post_confirm' => 'POST_ENABLE', - 'confirm_refresh' => 'CONFIRM_REFRESH', + 'enable_confirm' => array('tpl' => 'REG_ENABLE', 'default' => false), + 'enable_post_confirm' => array('tpl' => 'POST_ENABLE', 'default' => false), + 'confirm_refresh' => array('tpl' => 'CONFIRM_REFRESH', 'default' => false), + 'max_reg_attempts' => array('tpl' => 'REG_LIMIT', 'default' => 0), ); $this->tpl_name = 'acp_captcha'; @@ -67,10 +68,9 @@ class acp_captcha if ($submit && check_form_key($form_key)) { $config_vars = array_keys($config_vars); - - foreach ($config_vars as $config_var) + foreach ($config_vars as $config_var => $options) { - set_config($config_var, request_var($config_var, false)); + set_config($config_var, request_var($config_var, $options['default'])); } if ($selected !== $config['captcha_plugin']) @@ -115,9 +115,9 @@ class acp_captcha $demo_captcha =& phpbb_captcha_factory::get_instance($selected); - foreach ($config_vars as $config_var => $template_var) + foreach ($config_vars as $config_var => $options) { - $template->assign_var($template_var, (isset($_REQUEST[$config_var])) ? request_var($config_var, '') : $config[$config_var]) ; + $template->assign_var($options['tpl'], (isset($_POST[$config_var])) ? request_var($config_var, $options['default']) : $config[$config_var]) ; } $template->assign_vars(array( -- cgit v1.2.1 From 6e4a7c03d14d6fcc03955fbe26c3d5f725eb929d Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 21 Jul 2009 20:59:11 +0000 Subject: Users can report PMs to moderators which are then visible in a new MCP module git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9814 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_board.php | 1 + 1 file changed, 1 insertion(+) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 5966d5a4b2..3a2ad6f89a 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -81,6 +81,7 @@ class acp_board 'allow_namechange' => array('lang' => 'ALLOW_NAME_CHANGE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'allow_attachments' => array('lang' => 'ALLOW_ATTACHMENTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_pm_report' => array('lang' => 'ALLOW_PM_REPORT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'allow_bbcode' => array('lang' => 'ALLOW_BBCODE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'allow_smilies' => array('lang' => 'ALLOW_SMILIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'allow_sig' => array('lang' => 'ALLOW_SIG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), -- cgit v1.2.1 From 8e8c40bc75f1394dfcb9fd772858069388b86b06 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Wed, 22 Jul 2009 00:11:46 +0000 Subject: - Added install_id to data collector - config variable whitelist, so sensitive MOD info is not transmitted, currently mostly bool/int values - should we reduce the amount of data? git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9818 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_send_statistics.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_send_statistics.php b/phpBB/includes/acp/acp_send_statistics.php index 6c29b9fbb5..c76b450605 100644 --- a/phpBB/includes/acp/acp_send_statistics.php +++ b/phpBB/includes/acp/acp_send_statistics.php @@ -29,12 +29,23 @@ class acp_send_statistics { global $config, $template; - $collect_url = "http://www.phpbb.com/stats/getstatdata.php"; + $collect_url = "http://www.phpbb.com/stats/receive_stats.php"; $this->tpl_name = 'acp_send_statistics'; $this->page_title = 'ACP_SEND_STATISTICS'; - $collector = new phpbb_questionnaire_data_collector(); + // generate a unique id if necessary + if (!isset($config['questionnaire_unique_id'])) + { + $install_id = unique_id(); + set_config('questionnaire_unique_id', $install_id); + } + else + { + $install_id = $config['questionnaire_unique_id']; + } + + $collector = new phpbb_questionnaire_data_collector($install_id); // Add data provider $collector->add_data_provider(new phpbb_questionnaire_php_data_provider()); -- cgit v1.2.1 From 818b252f208b92157b56b101aac555eb1efb8cee Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 22 Jul 2009 11:47:37 +0000 Subject: fix r9758 Authorised by: AcydBurn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9828 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_users.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index cb342ac300..7921b6df67 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1160,11 +1160,13 @@ class acp_users if ($deleteall) { - $deleted_warnings = '0'; + $log_warnings = $deleted_warnings = 0; } else { - $deleted_warnings = ' user_warnings - ' . $db->sql_affectedrows(); + $num_warnings = (int) $db->sql_affectedrows(); + $deleted_warnings = ' user_warnings - ' . $num_warnings; + $log_warnings = ($num_warnings > 2) ? 2 : $num_warnings; } $sql = 'UPDATE ' . USERS_TABLE . " @@ -1172,7 +1174,18 @@ class acp_users WHERE user_id = $user_id"; $db->sql_query($sql); - add_log('admin', 'LOG_WARNING_DELETED', $user_row['username']); + switch ($log_warnings) + { + case 2: + add_log('admin', 'LOG_WARNINGS_DELETED', $user_row['username'], $num_warnings); + break; + case 1: + add_log('admin', 'LOG_WARNING_DELETED', $user_row['username']); + break; + default: + add_log('admin', 'LOG_WARNINGS_DELETED_ALL', $user_row['username']); + break; + } } } else -- cgit v1.2.1 From 4739c7ba3957dfe585973dafe7465cb9fd8c6d1f Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 24 Jul 2009 11:13:32 +0000 Subject: [Feature] Added new functionality to inactive users module: - Ability to set users per page. - Ability to sort by posts/number of reminders/last reminded date. - Show number of posts and ability to search posts. - Show number of reminders sent to user. - Show date of last reminder sent to user. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9845 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_inactive.php | 73 ++++++++++++++++++++++++++++--------- 1 file changed, 55 insertions(+), 18 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_inactive.php b/phpBB/includes/acp/acp_inactive.php index a38b47a704..e41e8f661d 100644 --- a/phpBB/includes/acp/acp_inactive.php +++ b/phpBB/includes/acp/acp_inactive.php @@ -51,6 +51,19 @@ class acp_inactive $form_key = 'acp_inactive'; add_form_key($form_key); + // We build the sort key and per page settings here, because they may be needed later + + // Number of entries to display + $per_page = request_var('users_per_page', (int) $config['topics_per_page']); + + // Sorting + $limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']); + $sort_by_text = array('i' => $user->lang['SORT_INACTIVE'], 'j' => $user->lang['SORT_REG_DATE'], 'l' => $user->lang['SORT_LAST_VISIT'], 'd' => $user->lang['SORT_LAST_REMINDER'], 'r' => $user->lang['SORT_REASON'], 'u' => $user->lang['SORT_USERNAME'], 'p' => $user->lang['SORT_POSTS'], 'e' => $user->lang['SORT_REMINDER']); + $sort_by_sql = array('i' => 'user_inactive_time', 'j' => 'user_regdate', 'l' => 'user_lastvisit', 'd' => 'user_reminded_time', 'r' => 'user_inactive_reason', 'u' => 'username_clean', 'p' => 'user_posts', 'e' => 'user_reminded'); + + $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = ''; + gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param); + if ($submit && sizeof($mark)) { if ($action !== 'delete' && !check_form_key($form_key)) @@ -67,7 +80,7 @@ class acp_inactive FROM ' . USERS_TABLE . ' WHERE ' . $db->sql_in_set('user_id', $mark); $result = $db->sql_query($sql); - + $user_affected = array(); while ($row = $db->sql_fetchrow($result)) { @@ -122,6 +135,12 @@ class acp_inactive $messenger->save_queue(); } + + // For activate we really need to redirect, else a refresh can result in users being deactivated again + $u_action = $this->u_action . "&$u_sort_param&start=$start"; + $u_action .= ($per_page != $config['topics_per_page']) ? "&users_per_page=$per_page" : ''; + + redirect($u_action); } else if ($action == 'delete') { @@ -175,7 +194,7 @@ class acp_inactive include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); $messenger = new messenger(); - $usernames = array(); + $usernames = $user_ids = array(); do { @@ -198,28 +217,34 @@ class acp_inactive $messenger->send($row['user_notify_type']); $usernames[] = $row['username']; + $user_ids[] = (int) $row['user_id']; } while ($row = $db->sql_fetchrow($result)); $messenger->save_queue(); + // Add the remind state to the database + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_reminded = user_reminded + 1, + user_reminded_time = ' . time() . ' + WHERE ' . $db->sql_in_set('user_id', $user_ids); + $db->sql_query($sql); + add_log('admin', 'LOG_INACTIVE_REMIND', implode(', ', $usernames)); unset($usernames); } $db->sql_freeresult($result); - + + // For remind we really need to redirect, else a refresh can result in more than one reminder + $u_action = $this->u_action . "&$u_sort_param&start=$start"; + $u_action .= ($per_page != $config['topics_per_page']) ? "&users_per_page=$per_page" : ''; + + redirect($u_action); + break; } } - // Sorting - $limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']); - $sort_by_text = array('i' => $user->lang['SORT_INACTIVE'], 'j' => $user->lang['SORT_REG_DATE'], 'l' => $user->lang['SORT_LAST_VISIT'], 'r' => $user->lang['SORT_REASON'], 'u' => $user->lang['SORT_USERNAME']); - $sort_by_sql = array('i' => 'user_inactive_time', 'j' => 'user_regdate', 'l' => 'user_lastvisit', 'r' => 'user_inactive_reason', 'u' => 'username_clean'); - - $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = ''; - gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param); - // Define where and sort sql for use in displaying logs $sql_where = ($sort_days) ? (time() - ($sort_days * 86400)) : 0; $sql_sort = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC'); @@ -227,19 +252,30 @@ class acp_inactive $inactive = array(); $inactive_count = 0; - $start = view_inactive_users($inactive, $inactive_count, $config['topics_per_page'], $start, $sql_where, $sql_sort); + $start = view_inactive_users($inactive, $inactive_count, $per_page, $start, $sql_where, $sql_sort); foreach ($inactive as $row) { $template->assign_block_vars('inactive', array( 'INACTIVE_DATE' => $user->format_date($row['user_inactive_time']), + 'REMINDED_DATE' => $user->format_date($row['user_reminded_time']), 'JOINED' => $user->format_date($row['user_regdate']), 'LAST_VISIT' => (!$row['user_lastvisit']) ? ' - ' : $user->format_date($row['user_lastvisit']), + 'REASON' => $row['inactive_reason'], 'USER_ID' => $row['user_id'], - 'USERNAME' => $row['username'], - 'U_USER_ADMIN' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&mode=overview&u={$row['user_id']}")) - ); + 'POSTS' => ($row['user_posts']) ? $row['user_posts'] : 0, + 'REMINDED' => $row['user_reminded'], + + 'REMINDED_EXPLAIN' => $user->lang('USER_LAST_REMINDED', (int) $row['user_reminded'], $user->format_date($row['user_reminded_time'])), + + 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], false, append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&mode=overview')), + 'USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']), + 'USER_COLOR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']), + + 'U_USER_ADMIN' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&mode=overview&u={$row['user_id']}"), + 'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id={$row['user_id']}&sr=posts") : '', + )); } $option_ary = array('activate' => 'ACTIVATE', 'delete' => 'DELETE'); @@ -255,9 +291,10 @@ class acp_inactive 'S_LIMIT_DAYS' => $s_limit_days, 'S_SORT_KEY' => $s_sort_key, 'S_SORT_DIR' => $s_sort_dir, - 'S_ON_PAGE' => on_page($inactive_count, $config['topics_per_page'], $start), - 'PAGINATION' => generate_pagination($this->u_action . "&$u_sort_param", $inactive_count, $config['topics_per_page'], $start, true), - + 'S_ON_PAGE' => on_page($inactive_count, $per_page, $start), + 'PAGINATION' => generate_pagination($this->u_action . "&$u_sort_param&users_per_page=$per_page", $inactive_count, $per_page, $start, true), + 'USERS_PER_PAGE' => $per_page, + 'U_ACTION' => $this->u_action . '&start=' . $start, )); -- cgit v1.2.1 From 1a0bd316e41ba78b8519558c47665877e8661970 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sun, 26 Jul 2009 11:34:11 +0000 Subject: correctly add the install_id to the data git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9857 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_send_statistics.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_send_statistics.php b/phpBB/includes/acp/acp_send_statistics.php index c76b450605..6784d29262 100644 --- a/phpBB/includes/acp/acp_send_statistics.php +++ b/phpBB/includes/acp/acp_send_statistics.php @@ -61,6 +61,11 @@ class acp_send_statistics foreach ($raw as $provider => $data) { + if ($provider == 'install_id') + { + $data = array($provider => $data); + } + $template->assign_block_vars('providers', array( 'NAME' => htmlspecialchars($provider), )); -- cgit v1.2.1 From 68e2102f20fa583dd184cefec19511d61caa5602 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Sun, 26 Jul 2009 14:54:02 +0000 Subject: Make some adjustments to the log filter. r9781, r9800 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9858 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_logs.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_logs.php b/phpBB/includes/acp/acp_logs.php index f13979ec0f..567606cfc7 100644 --- a/phpBB/includes/acp/acp_logs.php +++ b/phpBB/includes/acp/acp_logs.php @@ -156,14 +156,32 @@ class acp_logs " . (($limit_days) ? "AND log_time >= $sql_where " : ' ') . $sql_forum; $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) { if (empty($row['log_operation'])) { continue; } + $selected = ($log_operation == $row['log_operation']) ? ' selected="selected"' : ''; - $s_lang_keys .= ''; + + if (isset($user->lang[$row['log_operation']])) + { + $text = htmlspecialchars(strip_tags(str_replace('
', ' ', $user->lang[$row['log_operation']])), ENT_COMPAT, 'UTF-8'); + + // Fill in sprintf placeholders with translated placeholder text + if (substr_count($text, '%')) + { + $text = vsprintf($text, array_fill(0, substr_count($text, '%'), $user->lang['LOGS_PLACEHOLDER'])); + } + } + else + { + $text = ucfirst(str_replace('_', ' ', strtolower($row['log_operation']))); + } + + $s_lang_keys .= ''; } $db->sql_freeresult($result); -- cgit v1.2.1 From d2aca86b4a1858200a032e7bf4fdd997bc339331 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Mon, 27 Jul 2009 12:43:57 +0000 Subject: Fix a bug in r9781 #48595 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9871 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_logs.php | 1 + 1 file changed, 1 insertion(+) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_logs.php b/phpBB/includes/acp/acp_logs.php index 567606cfc7..d1e8b6d9c4 100644 --- a/phpBB/includes/acp/acp_logs.php +++ b/phpBB/includes/acp/acp_logs.php @@ -33,6 +33,7 @@ class acp_logs // Set up general vars $action = request_var('action', ''); $forum_id = request_var('f', 0); + $topic_id = request_var('t', 0); $start = request_var('start', 0); $deletemark = (!empty($_POST['delmarked'])) ? true : false; $deleteall = (!empty($_POST['delall'])) ? true : false; -- cgit v1.2.1 From da169625a6a4e7682f0b3a2623f2081e52ad4a49 Mon Sep 17 00:00:00 2001 From: "Marek A. R" Date: Tue, 28 Jul 2009 13:58:01 +0000 Subject: - Display version check on ACP main page. - Cache version check. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9880 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_main.php | 21 +++++++++++++++++++++ phpBB/includes/acp/acp_update.php | 8 ++------ 2 files changed, 23 insertions(+), 6 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index f9d611f8db..8a5918b558 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -395,6 +395,25 @@ class acp_main } } + // Version check + $user->add_lang('install'); + + $latest_version_info = false; + if (($latest_version_info = obtain_latest_version_info(request_var('versioncheck_force', false))) === false) + { + $template->assign_var('S_VERSIONCHECK_FAIL', true); + } + else + { + $latest_version_info = explode("\n", $latest_version_info); + $latest_version = trim($latest_version_info[0]); + $template->assign_var('S_VERSION_UP_TO_DATE', + version_compare( + str_replace('rc', 'RC', strtolower($config['version'])), + str_replace('rc', 'RC', strtolower($latest_version)), + '<') ? false : true); + } + // Get forum statistics $total_posts = $config['num_posts']; $total_topics = $config['num_topics']; @@ -492,6 +511,8 @@ class acp_main 'U_ACTION' => $this->u_action, 'U_ADMIN_LOG' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=logs&mode=admin'), 'U_INACTIVE_USERS' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=inactive&mode=list'), + 'U_VERSIONCHECK' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=update&mode=version_check'), + 'U_VERSIONCHECK_FORCE' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=1&versioncheck_force=1'), 'S_ACTION_OPTIONS' => ($auth->acl_get('a_board')) ? true : false, 'S_FOUNDER' => ($user->data['user_type'] == USER_FOUNDER) ? true : false, diff --git a/phpBB/includes/acp/acp_update.php b/phpBB/includes/acp/acp_update.php index dbb25bdbbd..121c72aeb3 100644 --- a/phpBB/includes/acp/acp_update.php +++ b/phpBB/includes/acp/acp_update.php @@ -37,12 +37,7 @@ class acp_update $errstr = ''; $errno = 0; - $info = get_remote_file('www.phpbb.com', '/updatecheck', ((defined('PHPBB_QA')) ? '30x_qa.txt' : '30x.txt'), $errstr, $errno); - - if ($info === false) - { - trigger_error($errstr, E_USER_WARNING); - } + $info = obtain_latest_version_info(request_var('versioncheck_force', false), true); $info = explode("\n", $info); $latest_version = trim($info[0]); @@ -68,6 +63,7 @@ class acp_update 'S_UP_TO_DATE_AUTO' => $up_to_date_automatic, 'S_VERSION_CHECK' => true, 'U_ACTION' => $this->u_action, + 'U_VERSIONCHECK_FORCE' => append_sid($this->u_action . '&versioncheck_force=1'), 'LATEST_VERSION' => $latest_version, 'CURRENT_VERSION' => $config['version'], -- cgit v1.2.1 From 1b8a1f73d77d3df21b8404611a130bb4ee19b822 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 28 Jul 2009 22:09:46 +0000 Subject: [Feature] Ability to copy permissions from one forum to several other forums. [Fix] Add log entry when copying forum permissions. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9887 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_forums.php | 58 +------------------------ phpBB/includes/acp/acp_permissions.php | 66 +++++++++++++++++++++++++++++ phpBB/includes/acp/info/acp_permissions.php | 1 + 3 files changed, 68 insertions(+), 57 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index 810caa62d5..b6a13acd01 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -187,63 +187,7 @@ class acp_forums if (!empty($forum_perm_from) && $forum_perm_from != $forum_data['forum_id'] && (($action != 'edit') || empty($forum_id) || ($auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth')))) { - // if we edit a forum delete current permissions first - if ($action == 'edit') - { - $sql = 'DELETE FROM ' . ACL_USERS_TABLE . ' - WHERE forum_id = ' . (int) $forum_data['forum_id']; - $db->sql_query($sql); - - $sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . ' - WHERE forum_id = ' . (int) $forum_data['forum_id']; - $db->sql_query($sql); - } - - // From the mysql documentation: - // Prior to MySQL 4.0.14, the target table of the INSERT statement cannot appear in the FROM clause of the SELECT part of the query. This limitation is lifted in 4.0.14. - // Due to this we stay on the safe side if we do the insertion "the manual way" - - // Copy permisisons from/to the acl users table (only forum_id gets changed) - $sql = 'SELECT user_id, auth_option_id, auth_role_id, auth_setting - FROM ' . ACL_USERS_TABLE . ' - WHERE forum_id = ' . $forum_perm_from; - $result = $db->sql_query($sql); - - $users_sql_ary = array(); - while ($row = $db->sql_fetchrow($result)) - { - $users_sql_ary[] = array( - 'user_id' => (int) $row['user_id'], - 'forum_id' => (int) $forum_data['forum_id'], - 'auth_option_id' => (int) $row['auth_option_id'], - 'auth_role_id' => (int) $row['auth_role_id'], - 'auth_setting' => (int) $row['auth_setting'] - ); - } - $db->sql_freeresult($result); - - // Copy permisisons from/to the acl groups table (only forum_id gets changed) - $sql = 'SELECT group_id, auth_option_id, auth_role_id, auth_setting - FROM ' . ACL_GROUPS_TABLE . ' - WHERE forum_id = ' . $forum_perm_from; - $result = $db->sql_query($sql); - - $groups_sql_ary = array(); - while ($row = $db->sql_fetchrow($result)) - { - $groups_sql_ary[] = array( - 'group_id' => (int) $row['group_id'], - 'forum_id' => (int) $forum_data['forum_id'], - 'auth_option_id' => (int) $row['auth_option_id'], - 'auth_role_id' => (int) $row['auth_role_id'], - 'auth_setting' => (int) $row['auth_setting'] - ); - } - $db->sql_freeresult($result); - - // Now insert the data - $db->sql_multi_insert(ACL_USERS_TABLE, $users_sql_ary); - $db->sql_multi_insert(ACL_GROUPS_TABLE, $groups_sql_ary); + copy_forum_permissions($forum_perm_from, $forum_data['forum_id'], ($action == 'edit') ? true : false); cache_moderators(); } diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php index 8e03a7fa52..6bbe550e4f 100644 --- a/phpBB/includes/acp/acp_permissions.php +++ b/phpBB/includes/acp/acp_permissions.php @@ -57,6 +57,21 @@ class acp_permissions trigger_error('NO_MODE', E_USER_ERROR); } + // Copy forum permissions + if ($mode == 'setting_forum_copy') + { + $this->tpl_name = 'permission_forum_copy'; + + if ($auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth')) + { + $this->page_title = 'ACP_FORUM_PERMISSIONS_COPY'; + $this->copy_forum_permissions(); + return; + } + + trigger_error('NO_MODE', E_USER_ERROR); + } + // Set some vars $action = request_var('action', array('' => 0)); $action = key($action); @@ -1152,6 +1167,57 @@ class acp_permissions )); } + /** + * Handles copying permissions from one forum to others + */ + function copy_forum_permissions() + { + global $auth, $cache, $template, $user; + + $user->add_lang('acp/forums'); + + $submit = isset($_POST['submit']) ? true : false; + + if ($submit) + { + $src = request_var('src_forum_id', 0); + $dest = request_var('dest_forum_ids', array(0)); + + if (confirm_box(true)) + { + if (copy_forum_permissions($src, $dest)) + { + cache_moderators(); + + $auth->acl_clear_prefetch(); + $cache->destroy('sql', FORUMS_TABLE); + + trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action)); + } + else + { + trigger_error($user->lang['SELECTED_FORUM_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING); + } + } + else + { + $s_hidden_fields = array( + 'submit' => $submit, + 'src_forum_id' => $src, + 'dest_forum_ids' => $dest, + ); + + $s_hidden_fields = build_hidden_fields($s_hidden_fields); + + confirm_box(false, $user->lang['CONFIRM_OPERATION'] . ' ' . $user->lang['COPY_PERMISSIONS_CONFIRM'], $s_hidden_fields); + } + } + + $template->assign_vars(array( + 'S_FORUM_OPTIONS' => make_forum_select(false, false, false, false, false), + )); + } + /** * Get already assigned users/groups */ diff --git a/phpBB/includes/acp/info/acp_permissions.php b/phpBB/includes/acp/info/acp_permissions.php index 22de666af3..6f341742f3 100644 --- a/phpBB/includes/acp/info/acp_permissions.php +++ b/phpBB/includes/acp/info/acp_permissions.php @@ -24,6 +24,7 @@ class acp_permissions_info 'trace' => array('title' => 'ACP_PERMISSION_TRACE', 'auth' => 'acl_a_viewauth', 'display' => false, 'cat' => array('ACP_PERMISSION_MASKS')), 'setting_forum_local' => array('title' => 'ACP_FORUM_PERMISSIONS', 'auth' => 'acl_a_fauth && (acl_a_authusers || acl_a_authgroups)', 'cat' => array('ACP_FORUM_BASED_PERMISSIONS')), + 'setting_forum_copy' => array('title' => 'ACP_FORUM_PERMISSIONS_COPY', 'auth' => 'acl_a_fauth && acl_a_authusers && acl_a_authgroups && acl_a_mauth', 'cat' => array('ACP_FORUM_BASED_PERMISSIONS')), 'setting_mod_local' => array('title' => 'ACP_FORUM_MODERATORS', 'auth' => 'acl_a_mauth && (acl_a_authusers || acl_a_authgroups)', 'cat' => array('ACP_FORUM_BASED_PERMISSIONS')), 'setting_user_global' => array('title' => 'ACP_USERS_PERMISSIONS', 'auth' => 'acl_a_authusers && (acl_a_aauth || acl_a_mauth || acl_a_uauth)', 'cat' => array('ACP_GLOBAL_PERMISSIONS', 'ACP_CAT_USERS')), 'setting_user_local' => array('title' => 'ACP_USERS_FORUM_PERMISSIONS', 'auth' => 'acl_a_authusers && (acl_a_mauth || acl_a_fauth)', 'cat' => array('ACP_FORUM_BASED_PERMISSIONS', 'ACP_CAT_USERS')), -- cgit v1.2.1 From 01fe852ad8eb19e0700e6dd87ec518493adae897 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 29 Jul 2009 09:26:50 +0000 Subject: Slightly adjust version check on index page to be a bit more descriptive git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9889 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_main.php | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index 8a5918b558..815a55b5a9 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -345,15 +345,15 @@ class acp_main add_log('admin', 'LOG_PURGE_CACHE'); break; - + case 'purge_sessions': if ((int) $user->data['user_type'] !== USER_FOUNDER) { trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING); } - + $tables = array(CONFIRM_TABLE, SESSIONS_TABLE); - + foreach ($tables as $table) { switch ($db->sql_layer) @@ -368,7 +368,7 @@ class acp_main break; } } - + // let's restore the admin session $reinsert_ary = array( 'session_id' => (string) $user->session_id, @@ -385,10 +385,10 @@ class acp_main 'session_admin' => 1, 'session_viewonline' => (int) $user->data['session_viewonline'], ); - + $sql = 'INSERT INTO ' . SESSIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $reinsert_ary); $db->sql_query($sql); - + add_log('admin', 'LOG_PURGE_SESSIONS'); break; } @@ -406,12 +406,13 @@ class acp_main else { $latest_version_info = explode("\n", $latest_version_info); - $latest_version = trim($latest_version_info[0]); - $template->assign_var('S_VERSION_UP_TO_DATE', - version_compare( - str_replace('rc', 'RC', strtolower($config['version'])), - str_replace('rc', 'RC', strtolower($latest_version)), - '<') ? false : true); + + $latest_version = str_replace('rc', 'RC', strtolower(trim($latest_version_info[0]))); + $current_version = str_replace('rc', 'RC', strtolower($config['version'])); + + $template->assign_vars(array( + 'S_VERSION_UP_TO_DATE' => version_compare($current_version, $latest_version, '<') ? false : true, + )); } // Get forum statistics -- cgit v1.2.1 From 312f2c87edbc81af7e332c14d7ce590df183cf60 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Fri, 31 Jul 2009 12:46:15 +0000 Subject: Add box if users decided not to select a forum to copy permissions from on forum creation git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9896 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_forums.php | 67 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index b6a13acd01..7977654c0a 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -74,6 +74,13 @@ class acp_forums { trigger_error($user->lang['NO_PERMISSION_FORUM_ADD'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); } + + case 'copy_perm': + + if (!(($auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth')))) + { + trigger_error($user->lang['NO_PERMISSION_COPY'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); + } break; } @@ -190,6 +197,12 @@ class acp_forums copy_forum_permissions($forum_perm_from, $forum_data['forum_id'], ($action == 'edit') ? true : false); cache_moderators(); } + else if (($action != 'edit') && $auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth')) + { + $this->copy_permission_page($forum_data); + return; + } + $auth->acl_clear_prefetch(); $cache->destroy('sql', FORUMS_TABLE); @@ -687,6 +700,36 @@ class acp_forums return; break; + + case 'copy_perm': + $forum_perm_from = request_var('forum_perm_from', 0); + + // Copy permissions? + if (!empty($forum_perm_from) && $forum_perm_from != $forum_id) + { + copy_forum_permissions($forum_perm_from, $forum_id, true); + cache_moderators(); + $auth->acl_clear_prefetch(); + $cache->destroy('sql', FORUMS_TABLE); + + $acl_url = '&mode=setting_forum_local&forum_id[]=' . $forum_id; + + $message = $user->lang['FORUM_UPDATED']; + + // Redirect to permissions + if ($auth->acl_get('a_fauth')) + { + $message .= '

' . sprintf($user->lang['REDIRECT_ACL'], '', ''); + } + + // redirect directly to permission settings screen if authed + if ($action == 'add' && !$forum_perm_from && $auth->acl_get('a_fauth')) + { + meta_refresh(4, append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions' . $acl_url)); + } + + trigger_error($message . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); + } } // Default management page @@ -1876,6 +1919,30 @@ class acp_forums adm_page_footer(); } + + function copy_permission_page($forum_data) + { + global $phpEx, $phpbb_admin_path, $template, $user; + + $acl_url = '&mode=setting_forum_local&forum_id[]=' . $forum_data['forum_id']; + $action = append_sid($this->u_action . "&parent_id={$this->parent_id}&f={$forum_data['forum_id']}&action=copy_perm"); + + + $l_acl = sprintf($user->lang['COPY_TO_ACL'], '', ''); + + + + $this->tpl_name = 'acp_forums_copy_perm'; + + $template->assign_vars(array( + 'U_ACL' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions' . $acl_url), + 'L_ACL_LINK' => $l_acl, + 'L_BACK_LINK' => adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), + 'S_COPY_ACTION' => $action, + 'S_FORUM_OPTIONS' => make_forum_select($forum_data['parent_id'], false, false, false, false), + )); + } + } ?> \ No newline at end of file -- cgit v1.2.1 From 2958890439f29b9cf45997c52c8cfa57e0f16bc8 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 1 Aug 2009 12:28:50 +0000 Subject: Apply locale-independent basename() to attachment filenames. New function added: utf8_basename(). (Bug #43335 - Patch by ocean=Yohsuke) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9905 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_attachments.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index 0fc0fe0848..849c076f0e 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -1027,8 +1027,8 @@ class acp_attachments $template->assign_block_vars('orphan', array( 'FILESIZE' => get_formatted_filesize($row['filesize']), 'FILETIME' => $user->format_date($row['filetime']), - 'REAL_FILENAME' => basename($row['real_filename']), - 'PHYSICAL_FILENAME' => basename($row['physical_filename']), + 'REAL_FILENAME' => utf8_basename($row['real_filename']), + 'PHYSICAL_FILENAME' => utf8_basename($row['physical_filename']), 'ATTACH_ID' => $row['attach_id'], 'POST_IDS' => (!empty($post_ids[$row['attach_id']])) ? $post_ids[$row['attach_id']] : '', 'U_FILE' => append_sid($phpbb_root_path . 'download/file.' . $phpEx, 'mode=view&id=' . $row['attach_id'])) -- cgit v1.2.1 From 1f871950d8bbefe59e18c00ea3238591c0b73807 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Mon, 3 Aug 2009 15:46:56 +0000 Subject: #48985 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9916 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_profile.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php index bbe36af9be..1b0ec4b5d5 100644 --- a/phpBB/includes/acp/acp_profile.php +++ b/phpBB/includes/acp/acp_profile.php @@ -369,6 +369,7 @@ class acp_profile 'field_show_profile'=> 0, 'field_no_view' => 0, 'field_show_on_reg' => 0, + 'field_show_on_vt' => 0, 'lang_name' => utf8_normalize_nfc(request_var('field_ident', '', true)), 'lang_explain' => '', 'lang_default_value'=> '') @@ -379,7 +380,7 @@ class acp_profile // $exclude contains the data we gather in each step $exclude = array( - 1 => array('field_ident', 'lang_name', 'lang_explain', 'field_option_none', 'field_show_on_reg', 'field_required', 'field_hide', 'field_show_profile', 'field_no_view'), + 1 => array('field_ident', 'lang_name', 'lang_explain', 'field_option_none', 'field_show_on_reg', 'field_show_on_vt', 'field_required', 'field_hide', 'field_show_profile', 'field_no_view'), 2 => array('field_length', 'field_maxlen', 'field_minlen', 'field_validation', 'field_novalue', 'field_default_value'), 3 => array('l_lang_name', 'l_lang_explain', 'l_lang_default_value', 'l_lang_options') ); @@ -405,6 +406,7 @@ class acp_profile $visibility_ary = array( 'field_required', 'field_show_on_reg', + 'field_show_on_vt', 'field_show_profile', 'field_hide', ); @@ -721,6 +723,7 @@ class acp_profile 'S_STEP_ONE' => true, 'S_FIELD_REQUIRED' => ($cp->vars['field_required']) ? true : false, 'S_SHOW_ON_REG' => ($cp->vars['field_show_on_reg']) ? true : false, + 'S_SHOW_ON_VT' => ($cp->vars['field_show_on_vt']) ? true : false, 'S_FIELD_HIDE' => ($cp->vars['field_hide']) ? true : false, 'S_SHOW_PROFILE' => ($cp->vars['field_show_profile']) ? true : false, 'S_FIELD_NO_VIEW' => ($cp->vars['field_no_view']) ? true : false, @@ -1036,6 +1039,7 @@ class acp_profile 'field_validation' => $cp->vars['field_validation'], 'field_required' => $cp->vars['field_required'], 'field_show_on_reg' => $cp->vars['field_show_on_reg'], + 'field_show_on_vt' => $cp->vars['field_show_on_vt'], 'field_hide' => $cp->vars['field_hide'], 'field_show_profile' => $cp->vars['field_show_profile'], 'field_no_view' => $cp->vars['field_no_view'] -- cgit v1.2.1 From 4e117116749ad47c1cfcc24cd2cb24c7271aad1c Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Wed, 5 Aug 2009 13:05:55 +0000 Subject: Fix Bug #48955 - Correctly extract column default value when exporting PostgreSQL tables. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9928 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_database.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index bf02a58dce..b25518e1c4 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -1157,16 +1157,17 @@ class postgres_extractor extends base_extractor AND (c.oid = d.adrelid) AND d.adnum = " . $row['attnum']; $def_res = $db->sql_query($sql_get_default); + $def_row = $db->sql_fetchrow($def_res); + $db->sql_freeresult($def_res); - if (!$def_res) + if (empty($def_row)) { unset($row['rowdefault']); } else { - $row['rowdefault'] = $db->sql_fetchfield('rowdefault', false, $def_res); + $row['rowdefault'] = $def_row['rowdefault']; } - $db->sql_freeresult($def_res); if ($row['type'] == 'bpchar') { -- cgit v1.2.1 From af6704700855e732dd811de4e8d6730d43a7c392 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 7 Aug 2009 13:53:17 +0000 Subject: Remove some left over code introduced in r9575, reverted in r9704. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9938 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_board.php | 7 ------- 1 file changed, 7 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 3a2ad6f89a..7bc94d685e 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -450,13 +450,6 @@ class acp_board continue; } - // If not set, then this is a valid entry and needs to be emptied (select_multiple, checkbox) - if (!isset($cfg_array[$config_name])) - { - $cfg_array[$config_name] = ''; - } - - // Erm, we spotted an array if ($null['type'] == 'select_multiple' && $submit && isset($_REQUEST['config'][$config_name])) { -- cgit v1.2.1 From d5c6d1d434555167f9d7adfdd3805e92e5bc266c Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Mon, 10 Aug 2009 09:13:28 +0000 Subject: reverted all changes made to this code block, especially the one mentioned in r9704 with reference to wrong bug report "undoing change from #9575, as it broke the board disabled message". The board disabled message still works fine. If there are any problems with the code and settings within the ACP, please tell me and i will check them. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9941 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_board.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 7bc94d685e..ea0de2ef30 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -440,7 +440,7 @@ class acp_board // We go through the display_vars to make sure no one is trying to set variables he/she is not allowed to... foreach ($display_vars['vars'] as $config_name => $null) { - if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false) + if ($null === false || strpos($config_name, 'legend') !== false) { continue; } @@ -450,6 +450,12 @@ class acp_board continue; } + // If not set, then this is a valid entry and needs to be emptied (select_multiple, checkbox) + if (!isset($cfg_array[$config_name])) + { + $cfg_array[$config_name] = ''; + } + // Erm, we spotted an array if ($null['type'] == 'select_multiple' && $submit && isset($_REQUEST['config'][$config_name])) { -- cgit v1.2.1 From d327154a5a5e9360b8ef5407da56e46a6629b26f Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Mon, 10 Aug 2009 11:14:21 +0000 Subject: ok, r9704 was correct - i used a wrong code base within my tests. :/ git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9943 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_board.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index ea0de2ef30..7bc94d685e 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -440,7 +440,7 @@ class acp_board // We go through the display_vars to make sure no one is trying to set variables he/she is not allowed to... foreach ($display_vars['vars'] as $config_name => $null) { - if ($null === false || strpos($config_name, 'legend') !== false) + if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false) { continue; } @@ -450,12 +450,6 @@ class acp_board continue; } - // If not set, then this is a valid entry and needs to be emptied (select_multiple, checkbox) - if (!isset($cfg_array[$config_name])) - { - $cfg_array[$config_name] = ''; - } - // Erm, we spotted an array if ($null['type'] == 'select_multiple' && $submit && isset($_REQUEST['config'][$config_name])) { -- cgit v1.2.1 From dea4eb6a0bbe04cc6fdf354a0564e449547064ff Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Mon, 10 Aug 2009 11:17:24 +0000 Subject: check for not set values in acp_board to correctly grab those input elements not populated if empty (checkboxes and multiple select fields) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9944 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_board.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 7bc94d685e..bd97c29f02 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -440,7 +440,7 @@ class acp_board // We go through the display_vars to make sure no one is trying to set variables he/she is not allowed to... foreach ($display_vars['vars'] as $config_name => $null) { - if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false) + if (strpos($config_name, 'legend') !== false) { continue; } @@ -450,6 +450,12 @@ class acp_board continue; } + // It could happen that the cfg array is not set. This happens within feed settings if unselecting all forums in the multiple select fields for example (it is the same as checkbox handling) + if (!isset($cfg_array[$config_name])) + { + $cfg_array[$config_name] = ''; + } + // Erm, we spotted an array if ($null['type'] == 'select_multiple' && $submit && isset($_REQUEST['config'][$config_name])) { -- cgit v1.2.1 From 5078b5e4ccaebcf6897e985cdf8c73a8172a2edf Mon Sep 17 00:00:00 2001 From: Jim Wigginton Date: Mon, 10 Aug 2009 16:04:44 +0000 Subject: - filtered logs weren't correctly paginated git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9950 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_logs.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_logs.php b/phpBB/includes/acp/acp_logs.php index d1e8b6d9c4..861df90777 100644 --- a/phpBB/includes/acp/acp_logs.php +++ b/phpBB/includes/acp/acp_logs.php @@ -106,6 +106,7 @@ class acp_logs $sql_sort = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC'); $log_operation = request_var('log_operation', ''); + $log_operation_param = !empty($log_operation) ? '&log_operation=' . urlencode(htmlspecialchars_decode($log_operation)) : ''; $s_lang_keys = ''; switch ($mode) @@ -213,7 +214,7 @@ class acp_logs 'U_ACTION' => $this->u_action, 'S_ON_PAGE' => on_page($log_count, $config['topics_per_page'], $start), - 'PAGINATION' => generate_pagination($this->u_action . "&$u_sort_param", $log_count, $config['topics_per_page'], $start, true), + 'PAGINATION' => generate_pagination($this->u_action . "&$u_sort_param$log_operation_param", $log_count, $config['topics_per_page'], $start, true), 'S_LIMIT_DAYS' => $s_limit_days, 'S_SORT_KEY' => $s_sort_key, -- cgit v1.2.1 From 09ad10a734c0993f9465e6ac3463951251602fc6 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 12 Aug 2009 15:00:47 +0000 Subject: ok, i am very sorry, but this needs to be fixed. Generally, our config table is not really suited for holding large datasets. Because feed settings for the forums to enable news feeds and excluded forums rely on the forums itself we have decided to introduce a forum_options table where custom options can be stored. Additionally, for this to work across all DBMS we support, we added a new method to the DBAL for the bitwise AND operator. Also moved the forum/topic feed template variable to the location where they belong to (forum and topic view) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9965 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_board.php | 82 ++++++++++++++++++++++++---------------- 1 file changed, 49 insertions(+), 33 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index bd97c29f02..78ba5092a0 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -272,8 +272,8 @@ class acp_board 'feed_overall_topics_limit' => array('lang' => 'ACP_FEED_OVERALL_TOPIC_LIMIT', 'validate' => 'int:5', 'type' => 'text:3:4', 'explain' => false), 'feed_forum' => array('lang' => 'ACP_FEED_FORUM', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true ), 'feed_topic' => array('lang' => 'ACP_FEED_TOPIC', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true ), - 'feed_news_id' => array('lang' => 'ACP_FEED_NEWS', 'validate' => 'string', 'type' => 'select_multiple', 'method' => 'select_news_forums', 'explain' => true ), - 'feed_exclude_id' => array('lang' => 'ACP_FEED_EXCLUDE_ID', 'validate' => 'string', 'type' => 'select_multiple', 'method' => 'select_exclude_forums', 'explain' => true), + 'feed_news_id' => array('lang' => 'ACP_FEED_NEWS', 'validate' => 'string', 'type' => 'custom', 'method' => 'select_news_forums', 'explain' => true), + 'feed_exclude_id' => array('lang' => 'ACP_FEED_EXCLUDE_ID', 'validate' => 'string', 'type' => 'custom', 'method' => 'select_exclude_forums', 'explain' => true), ) ); break; @@ -440,35 +440,16 @@ class acp_board // We go through the display_vars to make sure no one is trying to set variables he/she is not allowed to... foreach ($display_vars['vars'] as $config_name => $null) { - if (strpos($config_name, 'legend') !== false) + if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false) { continue; } - if ($config_name == 'auth_method') + if ($config_name == 'auth_method' || $config_name == 'feed_news_id' || $config_name == 'feed_exclude_id') { continue; } - // It could happen that the cfg array is not set. This happens within feed settings if unselecting all forums in the multiple select fields for example (it is the same as checkbox handling) - if (!isset($cfg_array[$config_name])) - { - $cfg_array[$config_name] = ''; - } - - // Erm, we spotted an array - if ($null['type'] == 'select_multiple' && $submit && isset($_REQUEST['config'][$config_name])) - { - // Get config *array* - $cfg_ = utf8_normalize_nfc(request_var('config', array('' => array('')), true)); - - // Check if the variable is set and an array - if (isset($cfg_[$config_name]) && is_array($cfg_[$config_name])) - { - $cfg_array[$config_name] = trim(serialize($cfg_[$config_name])); - } - } - $this->new_config[$config_name] = $config_value = $cfg_array[$config_name]; if ($config_name == 'email_function_name') @@ -484,6 +465,13 @@ class acp_board } } + // Store news and exclude ids + if ($mode == 'feed' && $submit) + { + $this->store_feed_forums(FORUM_OPTION_FEED_NEWS, 'feed_news_id'); + $this->store_feed_forums(FORUM_OPTION_FEED_EXCLUDE, 'feed_exclude_id'); + } + if ($mode == 'auth') { // Retrieve a list of auth plugins and check their config values @@ -902,17 +890,17 @@ class acp_board { global $user, $config; - // Determine ids to be selected - $select_ids = (sizeof($value)) ? $value : false; - - $forum_list = make_forum_select($select_ids, false, true, true, true, false, true); + $forum_list = make_forum_select(false, false, true, true, true, false, true); // Build forum options - $s_forum_options = ''; + $s_forum_options = ''; return $s_forum_options; } @@ -921,20 +909,48 @@ class acp_board { global $user, $config; - // Determine ids to be selected - $select_ids = (sizeof($value)) ? $value : false; - - $forum_list = make_forum_select($select_ids, false, true, false, false, false, true); + $forum_list = make_forum_select(false, false, true, false, false, false, true); // Build forum options - $s_forum_options = ''; + $s_forum_options = ''; return $s_forum_options; } + + function store_feed_forums($option, $key) + { + global $db, $cache; + + // Get key + $values = request_var($key, array(0 => 0)); + + // Empty option bit for all forums + $sql = 'UPDATE ' . FORUMS_TABLE . ' + SET forum_options = forum_options - ' . (1 << $option) . ' + WHERE ' . $db->sql_bit_and('forum_options', $option, '<> 0'); + $db->sql_query($sql); + + // Already emptied for all... + if (sizeof($values)) + { + // Set for selected forums + $sql = 'UPDATE ' . FORUMS_TABLE . ' + SET forum_options = forum_options + ' . (1 << $option) . ' + WHERE ' . $db->sql_in_set('forum_id', $values); + $db->sql_query($sql); + } + + // Empty sql cache for forums table because options changed + $cache->destroy('sql', FORUMS_TABLE); + } + } ?> \ No newline at end of file -- cgit v1.2.1 From 4525d1cb733e893762e87a4f597f8489a9917191 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Thu, 13 Aug 2009 14:51:47 +0000 Subject: - links to send statistics after install and update - link back to ACP main from send statistics - improved language / better explanation (incl. Bug #48555) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9969 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_send_statistics.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_send_statistics.php b/phpBB/includes/acp/acp_send_statistics.php index 6784d29262..b3baf54983 100644 --- a/phpBB/includes/acp/acp_send_statistics.php +++ b/phpBB/includes/acp/acp_send_statistics.php @@ -27,7 +27,7 @@ class acp_send_statistics function main($id, $mode) { - global $config, $template; + global $config, $template, $phpbb_admin_path, $phpEx; $collect_url = "http://www.phpbb.com/stats/receive_stats.php"; @@ -55,6 +55,7 @@ class acp_send_statistics $template->assign_vars(array( 'U_COLLECT_STATS' => $collect_url, 'RAW_DATA' => $collector->get_data_for_form(), + 'U_ACP_MAIN' => append_sid("{$phpbb_admin_path}index.$phpEx"), )); $raw = $collector->get_data_raw(); -- cgit v1.2.1 From 918e66758795f744092fce2d423f6d43bb00b7c0 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Fri, 14 Aug 2009 10:00:30 +0000 Subject: #49675 #49655 - ATTENTION: small captcha API change git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9975 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_captcha.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_captcha.php b/phpBB/includes/acp/acp_captcha.php index c3588ceb9e..6e86f412fb 100644 --- a/phpBB/includes/acp/acp_captcha.php +++ b/phpBB/includes/acp/acp_captcha.php @@ -67,7 +67,6 @@ class acp_captcha if ($submit && check_form_key($form_key)) { - $config_vars = array_keys($config_vars); foreach ($config_vars as $config_var => $options) { set_config($config_var, request_var($config_var, $options['default'])); @@ -122,6 +121,7 @@ class acp_captcha $template->assign_vars(array( 'CAPTCHA_PREVIEW_TPL' => $demo_captcha->get_demo_template($id), + 'S_CAPTCHA_HAS_CONFIG' => $demo_captcha->has_config(), 'CAPTCHA_SELECT' => $captcha_select, )); } -- cgit v1.2.1 From 412bb22acbe3c5cbb0d86d941f98bb8cae909f56 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 14 Aug 2009 10:19:37 +0000 Subject: fix #49685 introduced in r9896 Authorised by: AcydBurn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9977 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_forums.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index 7977654c0a..b2e04083fe 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -189,6 +189,7 @@ class acp_forums if (!sizeof($errors)) { $forum_perm_from = request_var('forum_perm_from', 0); + $cache->destroy('sql', FORUMS_TABLE); // Copy permissions? if (!empty($forum_perm_from) && $forum_perm_from != $forum_data['forum_id'] && @@ -205,7 +206,6 @@ class acp_forums $auth->acl_clear_prefetch(); - $cache->destroy('sql', FORUMS_TABLE); $acl_url = '&mode=setting_forum_local&forum_id[]=' . $forum_data['forum_id']; -- cgit v1.2.1 From 1683559e19c42effff71d21e2210a5a876241c64 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 14 Aug 2009 10:43:31 +0000 Subject: More r9896 cleanup. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9978 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_forums.php | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index b2e04083fe..5f56bfb84d 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -74,9 +74,9 @@ class acp_forums { trigger_error($user->lang['NO_PERMISSION_FORUM_ADD'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); } - + case 'copy_perm': - + if (!(($auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth')))) { trigger_error($user->lang['NO_PERMISSION_COPY'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); @@ -204,7 +204,6 @@ class acp_forums return; } - $auth->acl_clear_prefetch(); $acl_url = '&mode=setting_forum_local&forum_id[]=' . $forum_data['forum_id']; @@ -722,14 +721,10 @@ class acp_forums $message .= '

' . sprintf($user->lang['REDIRECT_ACL'], '', ''); } - // redirect directly to permission settings screen if authed - if ($action == 'add' && !$forum_perm_from && $auth->acl_get('a_fauth')) - { - meta_refresh(4, append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions' . $acl_url)); - } - trigger_error($message . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); } + + break; } // Default management page @@ -1919,7 +1914,10 @@ class acp_forums adm_page_footer(); } - + + /** + * Display copy permission page + */ function copy_permission_page($forum_data) { global $phpEx, $phpbb_admin_path, $template, $user; @@ -1927,11 +1925,8 @@ class acp_forums $acl_url = '&mode=setting_forum_local&forum_id[]=' . $forum_data['forum_id']; $action = append_sid($this->u_action . "&parent_id={$this->parent_id}&f={$forum_data['forum_id']}&action=copy_perm"); - $l_acl = sprintf($user->lang['COPY_TO_ACL'], '', ''); - - $this->tpl_name = 'acp_forums_copy_perm'; $template->assign_vars(array( -- cgit v1.2.1 From 54362bbe2bd3155262f3a8c7dd3034facc97b06c Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 18 Aug 2009 14:37:49 +0000 Subject: Adjustment to r9887: Only use one language variable. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10017 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_permissions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php index 6bbe550e4f..e9f0af5071 100644 --- a/phpBB/includes/acp/acp_permissions.php +++ b/phpBB/includes/acp/acp_permissions.php @@ -1209,7 +1209,7 @@ class acp_permissions $s_hidden_fields = build_hidden_fields($s_hidden_fields); - confirm_box(false, $user->lang['CONFIRM_OPERATION'] . ' ' . $user->lang['COPY_PERMISSIONS_CONFIRM'], $s_hidden_fields); + confirm_box(false, $user->lang['COPY_PERMISSIONS_CONFIRM'], $s_hidden_fields); } } -- cgit v1.2.1 From 4fb22c972ff64559bc064c3017fbc1c6fd29e523 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 20 Aug 2009 11:40:36 +0000 Subject: fix sql error due to us using STRICT db mode. ;) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10024 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_forums.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index 5f56bfb84d..5a44af836f 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -125,6 +125,7 @@ class acp_forums 'type_action' => request_var('type_action', ''), 'forum_status' => request_var('forum_status', ITEM_UNLOCKED), 'forum_parents' => '', + 'forum_options' => 0, 'forum_name' => utf8_normalize_nfc(request_var('forum_name', '', true)), 'forum_link' => request_var('forum_link', ''), 'forum_link_track' => request_var('forum_link_track', false), @@ -443,6 +444,7 @@ class acp_forums 'prune_viewed' => 7, 'prune_freq' => 1, 'forum_flags' => FORUM_FLAG_POST_REVIEW, + 'forum_options' => 0, 'forum_password' => '', 'forum_password_confirm'=> '', ); @@ -699,8 +701,8 @@ class acp_forums return; break; - - case 'copy_perm': + + case 'copy_perm': $forum_perm_from = request_var('forum_perm_from', 0); // Copy permissions? @@ -1921,7 +1923,7 @@ class acp_forums function copy_permission_page($forum_data) { global $phpEx, $phpbb_admin_path, $template, $user; - + $acl_url = '&mode=setting_forum_local&forum_id[]=' . $forum_data['forum_id']; $action = append_sid($this->u_action . "&parent_id={$this->parent_id}&f={$forum_data['forum_id']}&action=copy_perm"); -- cgit v1.2.1 From 5d2e4e88ab3266b44101714a101d337e0053361e Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 21 Aug 2009 09:44:55 +0000 Subject: Allow "0" as censor word and replacement. Only obtain word censor list if text is not empty. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10039 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_words.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_words.php b/phpBB/includes/acp/acp_words.php index 596c2fc743..1cb9545967 100644 --- a/phpBB/includes/acp/acp_words.php +++ b/phpBB/includes/acp/acp_words.php @@ -23,7 +23,7 @@ if (!defined('IN_PHPBB')) class acp_words { var $u_action; - + function main($id, $mode) { global $db, $user, $auth, $template, $cache; @@ -47,8 +47,9 @@ class acp_words switch ($action) { case 'edit': + $word_id = request_var('id', 0); - + if (!$word_id) { trigger_error($user->lang['NO_WORD'] . adm_back_link($this->u_action), E_USER_WARNING); @@ -73,7 +74,7 @@ class acp_words 'REPLACEMENT' => (isset($word_info['replacement'])) ? $word_info['replacement'] : '', 'S_HIDDEN_FIELDS' => $s_hidden_fields) ); - + return; break; @@ -84,11 +85,12 @@ class acp_words { trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING); } + $word_id = request_var('id', 0); $word = utf8_normalize_nfc(request_var('word', '', true)); $replacement = utf8_normalize_nfc(request_var('replacement', '', true)); - - if (!$word || !$replacement) + + if ($word === '' || $replacement === '') { trigger_error($user->lang['ENTER_WORD'] . adm_back_link($this->u_action), E_USER_WARNING); } -- cgit v1.2.1 From 69aa05376bd6cd04e23b6edcfe0d44e9e5f5f7e2 Mon Sep 17 00:00:00 2001 From: Jim Wigginton Date: Fri, 21 Aug 2009 21:47:19 +0000 Subject: - replaced the drop down menu log filter thing with log searching git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10041 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_logs.php | 88 +++-------------------------------------- 1 file changed, 5 insertions(+), 83 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_logs.php b/phpBB/includes/acp/acp_logs.php index 861df90777..35f2a3bf6b 100644 --- a/phpBB/includes/acp/acp_logs.php +++ b/phpBB/includes/acp/acp_logs.php @@ -105,87 +105,8 @@ class acp_logs $sql_where = ($sort_days) ? (time() - ($sort_days * 86400)) : 0; $sql_sort = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC'); - $log_operation = request_var('log_operation', ''); - $log_operation_param = !empty($log_operation) ? '&log_operation=' . urlencode(htmlspecialchars_decode($log_operation)) : ''; - $s_lang_keys = ''; - - switch ($mode) - { - case 'admin': - $log_type = LOG_ADMIN; - $sql_forum = ''; - break; - - case 'mod': - $log_type = LOG_MOD; - - if ($topic_id) - { - $sql_forum = 'AND topic_id = ' . intval($topic_id); - } - else if (is_array($forum_id)) - { - $sql_forum = 'AND ' . $db->sql_in_set('forum_id', array_map('intval', $forum_id)); - } - else - { - $sql_forum = ($forum_id) ? 'AND forum_id = ' . intval($forum_id) : ''; - } - break; - - case 'user': - $log_type = LOG_USERS; - $sql_forum = 'AND reportee_id = ' . (int) $user_id; - break; - - case 'users': - $log_type = LOG_USERS; - $sql_forum = ''; - break; - - case 'critical': - $log_type = LOG_CRITICAL; - $sql_forum = ''; - break; - - default: - return; - } - - $sql = "SELECT DISTINCT log_operation - FROM " . LOG_TABLE . " - WHERE log_type = $log_type - " . (($limit_days) ? "AND log_time >= $sql_where " : ' ') . - $sql_forum; - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - if (empty($row['log_operation'])) - { - continue; - } - - $selected = ($log_operation == $row['log_operation']) ? ' selected="selected"' : ''; - - if (isset($user->lang[$row['log_operation']])) - { - $text = htmlspecialchars(strip_tags(str_replace('
', ' ', $user->lang[$row['log_operation']])), ENT_COMPAT, 'UTF-8'); - - // Fill in sprintf placeholders with translated placeholder text - if (substr_count($text, '%')) - { - $text = vsprintf($text, array_fill(0, substr_count($text, '%'), $user->lang['LOGS_PLACEHOLDER'])); - } - } - else - { - $text = ucfirst(str_replace('_', ' ', strtolower($row['log_operation']))); - } - - $s_lang_keys .= ''; - } - $db->sql_freeresult($result); + $keywords = utf8_normalize_nfc(request_var('keywords', '', true)); + $keywords_param = !empty($keywords) ? '&keywords=' . urlencode(htmlspecialchars_decode($keywords)) : ''; $l_title = $user->lang['ACP_' . strtoupper($mode) . '_LOGS']; $l_title_explain = $user->lang['ACP_' . strtoupper($mode) . '_LOGS_EXPLAIN']; @@ -206,7 +127,7 @@ class acp_logs // Grab log data $log_data = array(); $log_count = 0; - view_log($mode, $log_data, $log_count, $config['topics_per_page'], $start, $forum_id, 0, 0, $sql_where, $sql_sort, $log_operation); + view_log($mode, $log_data, $log_count, $config['topics_per_page'], $start, $forum_id, 0, 0, $sql_where, $sql_sort, $keywords); $template->assign_vars(array( 'L_TITLE' => $l_title, @@ -214,13 +135,14 @@ class acp_logs 'U_ACTION' => $this->u_action, 'S_ON_PAGE' => on_page($log_count, $config['topics_per_page'], $start), - 'PAGINATION' => generate_pagination($this->u_action . "&$u_sort_param$log_operation_param", $log_count, $config['topics_per_page'], $start, true), + 'PAGINATION' => generate_pagination($this->u_action . "&$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start, true), 'S_LIMIT_DAYS' => $s_limit_days, 'S_SORT_KEY' => $s_sort_key, 'S_SORT_DIR' => $s_sort_dir, 'S_LANG_KEYS' => $s_lang_keys, 'S_CLEARLOGS' => $auth->acl_get('a_clearlogs'), + 'S_KEYWORDS' => $keywords, ) ); -- cgit v1.2.1 From 70c4e48b3973df360ec075b89011cb2841c1abb7 Mon Sep 17 00:00:00 2001 From: Jim Wigginton Date: Sat, 22 Aug 2009 02:56:05 +0000 Subject: - accidentally undid changes introduced in r9979 - removed a few lines from the old log filtering system git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10042 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_logs.php | 1 - 1 file changed, 1 deletion(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_logs.php b/phpBB/includes/acp/acp_logs.php index 35f2a3bf6b..0f4f78fcdd 100644 --- a/phpBB/includes/acp/acp_logs.php +++ b/phpBB/includes/acp/acp_logs.php @@ -140,7 +140,6 @@ class acp_logs 'S_LIMIT_DAYS' => $s_limit_days, 'S_SORT_KEY' => $s_sort_key, 'S_SORT_DIR' => $s_sort_dir, - 'S_LANG_KEYS' => $s_lang_keys, 'S_CLEARLOGS' => $auth->acl_get('a_clearlogs'), 'S_KEYWORDS' => $keywords, ) -- cgit v1.2.1 From c52f05b3329c9c79ecbc3184bd65cdbe4644ebcd Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 28 Aug 2009 09:26:43 +0000 Subject: Fix Bug #49195 - Queries on un-indexed column user_email Added function to generate email-hash. Authorised by: AcydBurn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10060 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_users.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 7921b6df67..71720f45b4 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -847,7 +847,7 @@ class acp_users { $sql_ary += array( 'user_email' => $update_email, - 'user_email_hash' => crc32($update_email) . strlen($update_email) + 'user_email_hash' => phpbb_email_hash($update_email), ); add_log('user', $user_id, 'LOG_USER_UPDATE_EMAIL', $user_row['username'], $user_row['user_email'], $update_email); -- cgit v1.2.1 From 3f22f755a3a3da4f711454e25772f13c42014ecc Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 30 Aug 2009 17:22:21 +0000 Subject: correct mode is send_statistics, else installs will differ from updates. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10068 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/info/acp_send_statistics.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/info/acp_send_statistics.php b/phpBB/includes/acp/info/acp_send_statistics.php index 33e66ecd26..de5dcdb8ad 100644 --- a/phpBB/includes/acp/info/acp_send_statistics.php +++ b/phpBB/includes/acp/info/acp_send_statistics.php @@ -20,7 +20,7 @@ class acp_send_statistics_info 'title' => 'ACP_SEND_STATISTICS', 'version' => '1.0.0', 'modes' => array( - 'questionnaire' => array('title' => 'ACP_SEND_STATISTICS', 'auth' => 'acl_a_server', 'cat' => array('ACP_SERVER_CONFIGURATION')), + 'send_statistics' => array('title' => 'ACP_SEND_STATISTICS', 'auth' => 'acl_a_server', 'cat' => array('ACP_SERVER_CONFIGURATION')), ), ); } -- cgit v1.2.1 From fe6cb1489c4517de0f9902dabdad9bb870a67521 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Mon, 31 Aug 2009 11:25:28 +0000 Subject: Fix wrong error message for non-writable template file in acp_styles.php - Bug #50045 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10074 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_styles.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 166ad11d3e..fbf3eadcb2 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -747,7 +747,8 @@ parse_css_file = {PARSE_CSS_FILE} { if (!($fp = @fopen($file, 'wb'))) { - trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING); + // File exists and is writeable, but still not able to be written to + trigger_error(sprintf($user->lang['TEMPLATE_FILE_NOT_WRITABLE'], htmlspecialchars($template_file)) . adm_back_link($this->u_action), E_USER_WARNING); } fwrite($fp, $template_data); fclose($fp); -- cgit v1.2.1 From 139f1d35302fc675b5e972e55c62d36cbc42af5c Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 31 Aug 2009 14:57:04 +0000 Subject: fix r10076 for #48615 - Ability to specify amount of time user is able to delete his last post in topic. Authorised by: AcydBurn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10080 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_board.php | 1 + 1 file changed, 1 insertion(+) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 78ba5092a0..9f0bcf210f 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -177,6 +177,7 @@ class acp_board 'legend2' => 'POSTING', 'bump_type' => false, 'edit_time' => array('lang' => 'EDIT_TIME', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']), + 'delete_time' => array('lang' => 'DELETE_TIME', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']), 'display_last_edited' => array('lang' => 'DISPLAY_LAST_EDITED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'flood_interval' => array('lang' => 'FLOOD_INTERVAL', 'validate' => 'int:0', 'type' => 'text:3:10', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']), 'bump_interval' => array('lang' => 'BUMP_INTERVAL', 'validate' => 'int:0', 'type' => 'custom', 'method' => 'bump_interval', 'explain' => true), -- cgit v1.2.1 From d65ccbde11efe8dba2b4cdf838903938399cd045 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 1 Sep 2009 11:21:42 +0000 Subject: adjust inactive users list on ACP index to act like the new inactive users list from r9845 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10081 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_main.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index 815a55b5a9..cd83c52e01 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -540,6 +540,8 @@ class acp_main if ($auth->acl_get('a_user')) { + $user->add_lang('memberlist'); + $inactive = array(); $inactive_count = 0; @@ -549,13 +551,24 @@ class acp_main { $template->assign_block_vars('inactive', array( 'INACTIVE_DATE' => $user->format_date($row['user_inactive_time']), + 'REMINDED_DATE' => $user->format_date($row['user_reminded_time']), 'JOINED' => $user->format_date($row['user_regdate']), 'LAST_VISIT' => (!$row['user_lastvisit']) ? ' - ' : $user->format_date($row['user_lastvisit']), + 'REASON' => $row['inactive_reason'], 'USER_ID' => $row['user_id'], - 'USERNAME' => $row['username'], - 'U_USER_ADMIN' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&mode=overview&u={$row['user_id']}")) - ); + 'POSTS' => ($row['user_posts']) ? $row['user_posts'] : 0, + 'REMINDED' => $row['user_reminded'], + + 'REMINDED_EXPLAIN' => $user->lang('USER_LAST_REMINDED', (int) $row['user_reminded'], $user->format_date($row['user_reminded_time'])), + + 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], false, append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&mode=overview')), + 'USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']), + 'USER_COLOR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']), + + 'U_USER_ADMIN' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&mode=overview&u={$row['user_id']}"), + 'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id={$row['user_id']}&sr=posts") : '', + )); } $option_ary = array('activate' => 'ACTIVATE', 'delete' => 'DELETE'); -- cgit v1.2.1 From 73baf42558b70acf7b2e194a84172778374a1c6e Mon Sep 17 00:00:00 2001 From: Jim Wigginton Date: Wed, 2 Sep 2009 05:12:23 +0000 Subject: Fixed bugs #43145, #44375, #44415 and #43045 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10088 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_ban.php | 6 ++++-- phpBB/includes/acp/acp_icons.php | 23 +++++++++++++++++++++++ phpBB/includes/acp/acp_users.php | 25 +++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_ban.php b/phpBB/includes/acp/acp_ban.php index 542ed47f3b..3198376584 100644 --- a/phpBB/includes/acp/acp_ban.php +++ b/phpBB/includes/acp/acp_ban.php @@ -156,7 +156,8 @@ class acp_ban FROM ' . BANLIST_TABLE . ' WHERE (ban_end >= ' . time() . " OR ban_end = 0) - AND ban_ip <> ''"; + AND ban_ip <> '' + ORDER BY ban_ip"; break; case 'email': @@ -168,7 +169,8 @@ class acp_ban FROM ' . BANLIST_TABLE . ' WHERE (ban_end >= ' . time() . " OR ban_end = 0) - AND ban_email <> ''"; + AND ban_email <> '' + ORDER BY ban_email"; break; } $result = $db->sql_query($sql); diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php index fa1e324cc6..8213c55ccb 100644 --- a/phpBB/includes/acp/acp_icons.php +++ b/phpBB/includes/acp/acp_icons.php @@ -89,6 +89,18 @@ class acp_icons continue; } + // adjust the width and height to be lower than 128px while perserving the aspect ratio + if ($img_size[0] > 127 && $img_size[0] > $img_size[1]) + { + $img_size[1] = (int) ($img_size[1] * (127 / $img_size[0])); + $img_size[0] = 127; + } + else if ($img_size[1] > 127) + { + $img_size[0] = (int) ($img_size[0] * (127 / $img_size[1])); + $img_size[1] = 127; + } + $_images[$path . $img]['file'] = $path . $img; $_images[$path . $img]['width'] = $img_size[0]; $_images[$path . $img]['height'] = $img_size[1]; @@ -388,6 +400,17 @@ class acp_icons $image_height[$image] = $img_size[1]; } + if ($image_width[$image] > 127 && $image_width[$image] > $image_height[$image]) + { + $image_height[$image] = (int) ($image_height[$image] * (127 / $image_width[$image])); + $image_width[$image] = 127; + } + else if ($image_height[$image] > 127) + { + $image_width[$image] = (int) ($image_width[$image] * (127 / $image_height[$image])); + $image_height[$image] = 127; + } + $img_sql = array( $fields . '_url' => $image, $fields . '_width' => $image_width[$image], diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 71720f45b4..98a0cfebd5 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -385,6 +385,31 @@ class acp_users user_active_flip('flip', $user_id); + if ($user_row['user_type'] == USER_INACTIVE) + { + if ($config['require_activation'] == USER_ACTIVATION_ADMIN) + { + include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); + + $messenger = new messenger(false); + + $messenger->template('admin_welcome_activated', $user_row['user_lang']); + + $messenger->to($user_row['user_email'], $user_row['username']); + + $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']); + $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']); + $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']); + $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip); + + $messenger->assign_vars(array( + 'USERNAME' => htmlspecialchars_decode($user_row['username'])) + ); + + $messenger->send(NOTIFY_EMAIL); + } + } + $message = ($user_row['user_type'] == USER_INACTIVE) ? 'USER_ADMIN_ACTIVATED' : 'USER_ADMIN_DEACTIVED'; $log = ($user_row['user_type'] == USER_INACTIVE) ? 'LOG_USER_ACTIVE' : 'LOG_USER_INACTIVE'; -- cgit v1.2.1 From f17e49d11b3d8e7f5dd96afcc54a1cc172087651 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 4 Sep 2009 10:20:47 +0000 Subject: only whitespace changes git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10097 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_users.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 98a0cfebd5..1afec6183a 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -551,11 +551,11 @@ class acp_users delete_pm($user_id, $msg_ids, PRIVMSGS_OUTBOX); add_log('admin', 'LOG_USER_DEL_OUTBOX', $user_row['username']); - + $lang = 'EMPTIED'; } $db->sql_freeresult($result); - + trigger_error($user->lang['USER_OUTBOX_' . $lang] . adm_back_link($this->u_action . '&u=' . $user_id)); } else @@ -725,7 +725,7 @@ class acp_users trigger_error($user->lang['USER_POSTS_MOVED'] . adm_back_link($this->u_action . '&u=' . $user_id)); break; - + case 'leave_nr': if (confirm_box(true)) -- cgit v1.2.1 From 30d402c24b3fa0af4285926784c97fde099254b7 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 9 Sep 2009 09:08:24 +0000 Subject: Send emails for manual user activation if admin activation is enabled not through queue in ACP (Bug #50925) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10124 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_inactive.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_inactive.php b/phpBB/includes/acp/acp_inactive.php index e41e8f661d..3d0c0a2780 100644 --- a/phpBB/includes/acp/acp_inactive.php +++ b/phpBB/includes/acp/acp_inactive.php @@ -113,7 +113,7 @@ class acp_inactive { include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); - $messenger = new messenger(); + $messenger = new messenger(false); foreach ($inactive_users as $row) { -- cgit v1.2.1 From 33e58d8e9038610fa708cdbaf951f1fb8e28f3c0 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Thu, 10 Sep 2009 19:49:19 +0000 Subject: Fix bug #51105. - Ignore (disable) newly generated forum in forums list. Related to r9896. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10135 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_forums.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/acp') diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index 5a44af836f..045d8a2e8e 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -1936,7 +1936,7 @@ class acp_forums 'L_ACL_LINK' => $l_acl, 'L_BACK_LINK' => adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), 'S_COPY_ACTION' => $action, - 'S_FORUM_OPTIONS' => make_forum_select($forum_data['parent_id'], false, false, false, false), + 'S_FORUM_OPTIONS' => make_forum_select($forum_data['parent_id'], $forum_data['forum_id'], false, false, false), )); } -- cgit v1.2.1