diff options
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/acp/acp_bbcodes.php | 8 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_extensions.php | 4 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_groups.php | 3 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_users.php | 5 | ||||
-rw-r--r-- | phpBB/includes/constants.php | 2 | ||||
-rw-r--r-- | phpBB/includes/functions.php | 4 | ||||
-rw-r--r-- | phpBB/includes/functions_acp.php | 2 | ||||
-rw-r--r-- | phpBB/includes/functions_admin.php | 6 | ||||
-rw-r--r-- | phpBB/includes/functions_upload.php | 2 | ||||
-rw-r--r-- | phpBB/includes/functions_user.php | 22 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_front.php | 10 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_main.php | 18 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_reports.php | 6 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_prefs.php | 45 |
14 files changed, 111 insertions, 26 deletions
diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index e245eea069..c98be241e9 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -33,6 +33,7 @@ class acp_bbcodes // Set up general vars $action = request_var('action', ''); $bbcode_id = request_var('bbcode', 0); + $submit = $request->is_set_post('submit'); $this->tpl_name = 'acp_bbcodes'; $this->page_title = 'ACP_BBCODES'; @@ -40,6 +41,11 @@ class acp_bbcodes add_form_key($form_key); + if ($submit && !check_form_key($form_key)) + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); + } + // Set up mode-specific vars switch ($action) { @@ -364,7 +370,7 @@ class acp_bbcodes * * @event core.acp_bbcodes_display_form * @var string action Type of the action: modify|create - * @var string sql_ary The SQL array to get custom bbcode data + * @var array sql_ary The SQL array to get custom bbcode data * @var array template_data Array with form template data * @var string u_action The u_action link * @since 3.1.0-a3 diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php index a3849d8ba1..f97711d69d 100644 --- a/phpBB/includes/acp/acp_extensions.php +++ b/phpBB/includes/acp/acp_extensions.php @@ -121,8 +121,6 @@ class acp_extensions 'U_ACTION' => $this->u_action, )); - add_form_key('version_check_settings'); - $this->tpl_name = 'acp_ext_list'; break; @@ -537,7 +535,7 @@ class acp_extensions $version_helper = new \phpbb\version_helper($this->cache, $this->config, new \phpbb\file_downloader(), $this->user); $version_helper->set_current_version($meta['version']); - $version_helper->set_file_location($version_check['host'], $version_check['directory'], $version_check['filename']); + $version_helper->set_file_location($version_check['host'], $version_check['directory'], $version_check['filename'], isset($version_check['ssl']) ? $version_check['ssl'] : false); $version_helper->force_stability($this->config['extension_force_unstable'] ? 'unstable' : null); return $updates = $version_helper->get_suggested_updates($force_update, $force_cache); diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index befbcdf24a..1e0264d8e9 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -672,9 +672,8 @@ class acp_groups $driver = $phpbb_avatar_manager->get_driver($current_driver); $avatars_enabled = true; - $config_name = $phpbb_avatar_manager->get_driver_config_name($driver); $template->set_filenames(array( - 'avatar' => "acp_avatar_options_{$config_name}.html", + 'avatar' => $driver->get_acp_template_name(), )); if ($driver->prepare_form($request, $template, $user, $avatar_data, $avatar_error)) diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 4d0bbf5721..4c94b99b0d 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1587,7 +1587,7 @@ class acp_users if ($submit) { $error = validate_data($data, array( - 'dateformat' => array('string', false, 1, 30), + 'dateformat' => array('string', false, 1, 64), 'lang' => array('match', false, '#^[a-z_\-]{2,}$#i'), 'tz' => array('timezone'), @@ -1878,9 +1878,8 @@ class acp_users $driver = $phpbb_avatar_manager->get_driver($current_driver); $avatars_enabled = true; - $config_name = $phpbb_avatar_manager->get_driver_config_name($driver); $template->set_filenames(array( - 'avatar' => "acp_avatar_options_{$config_name}.html", + 'avatar' => $driver->get_acp_template_name(), )); if ($driver->prepare_form($request, $template, $user, $avatar_data, $error)) diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index ab943c2f86..a1d85cf272 100644 --- a/phpBB/includes/constants.php +++ b/phpBB/includes/constants.php @@ -28,7 +28,7 @@ if (!defined('IN_PHPBB')) */ // phpBB Version -define('PHPBB_VERSION', '3.1.7-dev'); +define('PHPBB_VERSION', '3.1.8-dev'); // QA-related // define('PHPBB_QA', 1); diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 2d94bd14a7..094b1fd364 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -4283,7 +4283,7 @@ function obtain_users_online_string($online_users, $item_id = 0, $item = 'forum' * @var string item Restrict online users to a certain * session item, e.g. forum for * session_forum_id - * @var string sql_ary SQL query to obtain users online data + * @var array sql_ary SQL query array to obtain users online data * @since 3.1.4-RC1 * @changed 3.1.7-RC1 Change sql query into array and adjust var accordingly. Allows extension authors the ability to adjust the sql_ary. */ @@ -5395,6 +5395,8 @@ function page_footer($run_cron = true, $display_template = true, $exit_handler = return; } + $user->update_session_infos(); + phpbb_check_and_display_sql_report($request, $auth, $db); $template->assign_vars(array( diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index d566336d26..4193f69929 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -164,6 +164,8 @@ function adm_page_footer($copyright_html = true) return; } + $user->update_session_infos(); + phpbb_check_and_display_sql_report($request, $auth, $db); $template->assign_vars(array( diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 33cf55cc0b..b3641a2b45 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -3101,9 +3101,9 @@ function get_database_size() { $version = $row['mysql_version']; - if (preg_match('#(3\.23|[45]\.)#', $version)) + if (preg_match('#(3\.23|[45]\.|10\.[0-9]\.[0-9]{1,2}-+Maria)#', $version)) { - $db_name = (preg_match('#^(?:3\.23\.(?:[6-9]|[1-9]{2}))|[45]\.#', $version)) ? "`{$db->get_db_name()}`" : $db->get_db_name(); + $db_name = (preg_match('#^(?:3\.23\.(?:[6-9]|[1-9]{2}))|[45]\.|10\.[0-9]\.[0-9]{1,2}-+Maria#', $version)) ? "`{$db->get_db_name()}`" : $db->get_db_name(); $sql = 'SHOW TABLE STATUS FROM ' . $db_name; @@ -3112,7 +3112,7 @@ function get_database_size() $database_size = 0; while ($row = $db->sql_fetchrow($result)) { - if ((isset($row['Type']) && $row['Type'] != 'MRG_MyISAM') || (isset($row['Engine']) && ($row['Engine'] == 'MyISAM' || $row['Engine'] == 'InnoDB'))) + if ((isset($row['Type']) && $row['Type'] != 'MRG_MyISAM') || (isset($row['Engine']) && ($row['Engine'] == 'MyISAM' || $row['Engine'] == 'InnoDB' || $row['Engine'] == 'Aria'))) { if ($table_prefix != '') { diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php index 89bc31fa25..f0a48e51e5 100644 --- a/phpBB/includes/functions_upload.php +++ b/phpBB/includes/functions_upload.php @@ -919,7 +919,7 @@ class fileupload return $file; } - $tmp_path = (!@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'off') ? false : $phpbb_root_path . 'cache'; + $tmp_path = (!@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'off') ? sys_get_temp_dir() : $phpbb_root_path . 'cache'; $filename = tempnam($tmp_path, unique_id() . '-'); if (!($fp = @fopen($filename, 'wb'))) diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index fe370750d9..3e2dbcb794 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -2698,7 +2698,7 @@ function group_delete($group_id, $group_name = false) */ function group_user_add($group_id, $user_id_ary = false, $username_ary = false, $group_name = false, $default = false, $leader = 0, $pending = 0, $group_attributes = false) { - global $db, $auth, $phpbb_container; + global $db, $auth, $phpbb_container, $phpbb_dispatcher; // We need both username and user_id info $result = user_get_id_name($user_id_ary, $username_ary); @@ -2775,6 +2775,26 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false, // Clear permissions cache of relevant users $auth->acl_clear_prefetch($user_id_ary); + /** + * Event after users are added to a group + * + * @event core.group_add_user_after + * @var int group_id ID of the group to which users are added + * @var string group_name Name of the group + * @var array user_id_ary IDs of the users which are added + * @var array username_ary names of the users which are added + * @var int pending Pending setting, 1 if user(s) added are pending + * @since 3.1.7-RC1 + */ + $vars = array( + 'group_id', + 'group_name', + 'user_id_ary', + 'username_ary', + 'pending', + ); + extract($phpbb_dispatcher->trigger_event('core.group_add_user_after', compact($vars))); + if (!$group_name) { $group_name = get_group_name($group_id); diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php index cdf1abd8ff..5d8aa18c16 100644 --- a/phpBB/includes/mcp/mcp_front.php +++ b/phpBB/includes/mcp/mcp_front.php @@ -54,8 +54,8 @@ function mcp_front_view($id, $mode, $action) * Allow altering the query to get the number of unapproved posts * * @event core.mcp_front_queue_unapproved_total_before - * @var int sql_ary Query to get the total number of unapproved posts - * @var array forum_list List of forums to look for unapproved posts + * @var array sql_ary Query array to get the total number of unapproved posts + * @var array forum_list List of forums to look for unapproved posts * @since 3.1.5-RC1 */ $vars = array('sql_ary', 'forum_list'); @@ -179,7 +179,7 @@ function mcp_front_view($id, $mode, $action) * Alter sql query to count the number of reported posts * * @event core.mcp_front_reports_count_query_before - * @var int sql The query string used to get the number of reports that exist + * @var string sql The query string used to get the number of reports that exist * @var array forum_list List of forums that contain the posts * @since 3.1.5-RC1 */ @@ -226,8 +226,8 @@ function mcp_front_view($id, $mode, $action) * Alter sql query to get latest reported posts * * @event core.mcp_front_reports_listing_query_before - * @var int sql_ary Associative array with the query to be executed - * @var array forum_list List of forums that contain the posts + * @var array sql_ary Associative array with the query to be executed + * @var array forum_list List of forums that contain the posts * @since 3.1.0-RC3 */ $vars = array('sql_ary', 'forum_list'); diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index fc28968101..d0908a0d8b 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -262,7 +262,7 @@ class mcp_main */ function lock_unlock($action, $ids) { - global $auth, $user, $db, $phpEx, $phpbb_root_path, $request; + global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_dispatcher; if ($action == 'lock' || $action == 'unlock') { @@ -322,6 +322,22 @@ function lock_unlock($action, $ids) add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_' . strtoupper($action), $row['topic_title']); } + /** + * Perform additional actions after locking/unlocking posts/topics + * + * @event core.mcp_lock_unlock_after + * @var string action Variable containing the action we perform on the posts/topics ('lock', 'unlock', 'lock_post' or 'unlock_post') + * @var array ids Array containing the post/topic IDs that have been locked/unlocked + * @var array data Array containing posts/topics data + * @since 3.1.7-RC1 + */ + $vars = array( + 'action', + 'ids', + 'data', + ); + extract($phpbb_dispatcher->trigger_event('core.mcp_lock_unlock_after', compact($vars))); + $success_msg = $l_prefix . ((sizeof($ids) == 1) ? '' : 'S') . '_' . (($action == 'lock' || $action == 'lock_post') ? 'LOCKED' : 'UNLOCKED') . '_SUCCESS'; meta_refresh(2, $redirect); diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index fa2fed842f..6bb606a990 100644 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -95,7 +95,7 @@ class mcp_reports * * @event core.mcp_reports_report_details_query_before * @var array sql_ary The array in the format of the query builder with the query - * @var mixed forum_id The forum_id, the number in the f GET parameter + * @var int forum_id The forum_id, the number in the f GET parameter * @var int post_id The post_id of the report being viewed (if 0, it is meaningless) * @var int report_id The report_id of the report being viewed * @since 3.1.5-RC1 @@ -118,10 +118,10 @@ class mcp_reports * * @event core.mcp_reports_report_details_query_after * @var array sql_ary The array in the format of the query builder with the query that had been executted - * @var mixed forum_id The forum_id, the number in the f GET parameter + * @var int forum_id The forum_id, the number in the f GET parameter * @var int post_id The post_id of the report being viewed (if 0, it is meaningless) * @var int report_id The report_id of the report being viewed - * @var int report The query's resulting row. + * @var array report The query's resulting row. * @since 3.1.5-RC1 */ $vars = array( diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php index 3c274b53c7..e63e9b4c08 100644 --- a/phpBB/includes/ucp/ucp_prefs.php +++ b/phpBB/includes/ucp/ucp_prefs.php @@ -86,7 +86,7 @@ class ucp_prefs } $error = array_merge(validate_data($data, array( - 'dateformat' => array('string', false, 1, 30), + 'dateformat' => array('string', false, 1, 64), 'lang' => array('language_iso_name'), 'tz' => array('timezone'), )), $error); @@ -368,6 +368,49 @@ class ucp_prefs ${'s_sort_' . $sort_option . '_dir'} .= '</select>'; } + /** + * Run code before view form is displayed + * + * @event core.ucp_prefs_view_after + * @var bool submit Do we display the form only + * or did the user press submit + * @var array data Array with current ucp options data + * @var array sort_dir_text Array with sort dir language strings + * @var array limit_topic_days Topic ordering options + * @var array sort_by_topic_text Topic ordering language strings + * @var array sort_by_topic_sql Topic ordering sql + * @var array limit_post_days Post ordering options + * @var array sort_by_post_text Post ordering language strings + * @var array sort_by_post_sql Post ordering sql + * @var array _options Sort options + * @var string s_limit_topic_days Sort limit topic by days select box + * @var string s_sort_topic_key Sort topic key select box + * @var string s_sort_topic_dir Sort topic dir select box + * @var string s_limit_post_days Sort limit post by days select box + * @var string s_sort_post_key Sort post key select box + * @var string s_sort_post_dir Sort post dir select box + * @since 3.1.8-RC1 + */ + $vars = array( + 'submit', + 'data', + 'sort_dir_text', + 'limit_topic_days', + 'sort_by_topic_text', + 'sort_by_topic_sql', + 'limit_post_days', + 'sort_by_post_text', + 'sort_by_post_sql', + '_options', + 's_limit_topic_days', + 's_sort_topic_key', + 's_sort_topic_dir', + 's_limit_post_days', + 's_sort_post_key', + 's_sort_post_dir', + ); + extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_view_after', compact($vars))); + $template->assign_vars(array( 'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '', |