diff options
-rw-r--r-- | phpBB/includes/acp/acp_database.php | 8 | ||||
-rw-r--r-- | phpBB/includes/functions.php | 10 | ||||
-rw-r--r-- | phpBB/includes/functions_jabber.php | 3 | ||||
-rw-r--r-- | phpBB/includes/functions_posting.php | 5 | ||||
-rw-r--r-- | phpBB/includes/functions_privmsgs.php | 21 | ||||
-rw-r--r-- | phpBB/includes/functions_upload.php | 4 | ||||
-rw-r--r-- | phpBB/includes/functions_user.php | 1 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_main.php | 12 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_queue.php | 4 | ||||
-rwxr-xr-x | phpBB/includes/mcp/mcp_reports.php | 6 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_topic.php | 4 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_pm.php | 19 | ||||
-rw-r--r-- | phpBB/memberlist.php | 8 |
13 files changed, 64 insertions, 41 deletions
diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index 3b943ef889..cd877ae31d 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -25,7 +25,7 @@ class acp_database function main($id, $mode) { - global $db, $user, $auth, $template, $table_prefix; + global $cache, $db, $user, $auth, $template, $table_prefix; global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; $user->add_lang('acp/database'); @@ -160,12 +160,13 @@ class acp_database $extractor->write_end(); + add_log('admin', 'LOG_DB_BACKUP'); + if ($download == true) { exit; } - add_log('admin', 'LOG_DB_BACKUP'); trigger_error($user->lang['BACKUP_SUCCESS'] . adm_back_link($this->u_action)); break; @@ -379,6 +380,9 @@ class acp_database $close($fp); + // Purge the cache due to updated data + $cache->purge(); + add_log('admin', 'LOG_DB_RESTORE'); trigger_error($user->lang['RESTORE_SUCCESS'] . adm_back_link($this->u_action)); break; diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index cbedd9804a..a42d773286 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2865,6 +2865,12 @@ function msg_handler($errno, $msg_text, $errfile, $errline) if (strpos($errfile, 'cache') === false && strpos($errfile, 'template.') === false) { // flush the content, else we get a white page if output buffering is on + if (strtolower(@ini_get('output_buffering')) !== 'off') + { + @ob_end_flush(); + } + + // Another quick fix for those having gzip compression enabled if ($config['gzip_compress']) { if (@extension_loaded('zlib') && !headers_sent()) @@ -3488,7 +3494,7 @@ function garbage_collection() */ function exit_handler() { - global $phpbb_hook; + global $phpbb_hook, $config; if (!empty($phpbb_hook) && $phpbb_hook->call_hook(__FUNCTION__)) { @@ -3499,7 +3505,7 @@ function exit_handler() } // As a pre-caution... some setups display a blank page if the flush() is not there. - @flush(); + (!$config['gzip_compress']) ? @flush() : @ob_flush(); exit; } diff --git a/phpBB/includes/functions_jabber.php b/phpBB/includes/functions_jabber.php index 72dbbd2869..310b061b90 100644 --- a/phpBB/includes/functions_jabber.php +++ b/phpBB/includes/functions_jabber.php @@ -399,12 +399,13 @@ class jabber $second_time = isset($this->session['id']); $this->session['id'] = $xml['stream:stream'][0]['@']['id']; + /** Currently commented out due to problems with some jabber server - reason unknown if ($second_time) { // If we are here for the second time after TLS, we need to continue logging in $this->login(); return; - } + }*/ // go on with authentication? if (isset($this->features['stream:features'][0]['#']['bind']) || !empty($this->session['tls'])) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index a2482c64c4..7d9945684d 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -524,6 +524,8 @@ function get_supported_image_types($type = false) if ($type !== false) { + // Type is one of the IMAGETYPE constants - it is fetched from getimagesize() + // We do not use the constants here, because some were not available in PHP 4.3.x switch ($type) { // GIF @@ -545,8 +547,7 @@ function get_supported_image_types($type = false) $new_type = ($format & IMG_PNG) ? IMG_PNG : false; break; - // BMP, WBMP - case 6: + // WBMP case 15: $new_type = ($format & IMG_WBMP) ? IMG_WBMP : false; break; diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index bffa64158a..834bcfea51 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1803,4 +1803,25 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode return true; } +/** +* Set correct users max messages in PM folder. +* If several group memberships define different amount of messages, the highest will be chosen. +*/ +function set_user_message_limit() +{ + global $user, $db, $config; + + // Get maximum about from user memberships - if it is 0, there is no limit set and we use the maximum value within the config. + $sql = 'SELECT MAX(g.group_message_limit) as max_message_limit + FROM ' . GROUPS_TABLE . ' g, ' . USER_GROUP_TABLE . ' ug + WHERE ug.user_id = ' . $user->data['user_id'] . ' + AND ug.user_pending = 0 + AND ug.group_id = g.group_id'; + $result = $db->sql_query($sql); + $message_limit = (int) $db->sql_fetchfield('max_message_limit'); + $db->sql_freeresult($result); + + $user->data['message_limit'] = (!$message_limit) ? $config['pm_max_msgs'] : $message_limit; +} + ?>
\ No newline at end of file diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php index 181401200c..0a1ed1fab2 100644 --- a/phpBB/includes/functions_upload.php +++ b/phpBB/includes/functions_upload.php @@ -257,7 +257,7 @@ class filespec return false; } - $upload_mode = (@ini_get('open_basedir') || @ini_get('safe_mode')) ? 'move' : 'copy'; + $upload_mode = (@ini_get('open_basedir') || @ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'on') ? 'move' : 'copy'; $upload_mode = ($this->local) ? 'local' : $upload_mode; $this->destination_file = $this->destination_path . '/' . basename($this->realname); @@ -741,7 +741,7 @@ class fileupload return $file; } - $tmp_path = (!@ini_get('safe_mode')) ? false : $phpbb_root_path . 'cache'; + $tmp_path = (!@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'off') ? false : $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 ded50fe0c0..fa4b2f1771 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -183,7 +183,6 @@ function user_add($user_row, $cp_data = false) 'user_dateformat' => $config['default_dateformat'], 'user_lang' => $config['default_lang'], 'user_style' => $config['default_style'], - 'user_allow_pm' => 1, 'user_actkey' => '', 'user_ip' => '', 'user_regdate' => time(), diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 3b4f27d751..f000bcc881 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -235,7 +235,7 @@ function lock_unlock($action, $ids) } unset($orig_ids); - $redirect = request_var('redirect', build_url(array('_f_', 'action', 'quickmod'))); + $redirect = request_var('redirect', build_url(array('action', 'quickmod'))); $s_hidden_fields = build_hidden_fields(array( $sql_id . '_list' => $ids, @@ -321,7 +321,7 @@ function change_topic_type($action, $topic_ids) break; } - $redirect = request_var('redirect', build_url(array('_f_', 'action', 'quickmod'))); + $redirect = request_var('redirect', build_url(array('action', 'quickmod'))); $s_hidden_fields = array( 'topic_id_list' => $topic_ids, @@ -542,7 +542,7 @@ function mcp_move_topic($topic_ids) } $to_forum_id = request_var('to_forum_id', 0); - $redirect = request_var('redirect', build_url(array('_f_', 'action', 'quickmod'))); + $redirect = request_var('redirect', build_url(array('action', 'quickmod'))); $additional_msg = $success_msg = ''; $s_hidden_fields = build_hidden_fields(array( @@ -762,7 +762,7 @@ function mcp_delete_topic($topic_ids) return; } - $redirect = request_var('redirect', build_url(array('_f_', 'action', 'quickmod'))); + $redirect = request_var('redirect', build_url(array('action', 'quickmod'))); $forum_id = request_var('f', 0); $s_hidden_fields = build_hidden_fields(array( @@ -818,7 +818,7 @@ function mcp_delete_post($post_ids) return; } - $redirect = request_var('redirect', build_url(array('_f_', 'action', 'quickmod'))); + $redirect = request_var('redirect', build_url(array('action', 'quickmod'))); $forum_id = request_var('f', 0); $s_hidden_fields = build_hidden_fields(array( @@ -941,7 +941,7 @@ function mcp_fork_topic($topic_ids) $to_forum_id = request_var('to_forum_id', 0); $forum_id = request_var('f', 0); - $redirect = request_var('redirect', build_url(array('_f_', 'action', 'quickmod'))); + $redirect = request_var('redirect', build_url(array('action', 'quickmod'))); $additional_msg = $success_msg = ''; $s_hidden_fields = build_hidden_fields(array( diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index 88fc9cb13d..36e937897e 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -459,7 +459,7 @@ function approve_post($post_id_list, $id, $mode) trigger_error('NOT_AUTHORISED'); } - $redirect = request_var('redirect', build_url(array('_f_', 'quickmod'))); + $redirect = request_var('redirect', build_url(array('quickmod'))); $success_msg = ''; $s_hidden_fields = build_hidden_fields(array( @@ -758,7 +758,7 @@ function disapprove_post($post_id_list, $id, $mode) trigger_error('NOT_AUTHORISED'); } - $redirect = request_var('redirect', build_url(array('t', 'mode', '_f_', 'quickmod')) . "&mode=$mode"); + $redirect = request_var('redirect', build_url(array('t', 'mode', 'quickmod')) . "&mode=$mode"); $reason = utf8_normalize_nfc(request_var('reason', '', true)); $reason_id = request_var('reason_id', 0); $success_msg = $additional_msg = ''; diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index c4ce753cfd..c837ff0e67 100755 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -450,15 +450,15 @@ function close_report($report_id_list, $mode, $action) if ($action == 'delete' && strpos($user->data['session_page'], 'mode=report_details') !== false) { - $redirect = request_var('redirect', build_url(array('mode', '_f_', 'r', 'quickmod')) . '&mode=reports'); + $redirect = request_var('redirect', build_url(array('mode', 'r', 'quickmod')) . '&mode=reports'); } else if ($action == 'close' && !request_var('r', 0)) { - $redirect = request_var('redirect', build_url(array('mode', '_f_', 'p', 'quickmod')) . '&mode=reports'); + $redirect = request_var('redirect', build_url(array('mode', 'p', 'quickmod')) . '&mode=reports'); } else { - $redirect = request_var('redirect', build_url(array('_f_', 'quickmod'))); + $redirect = request_var('redirect', build_url(array('quickmod'))); } $success_msg = ''; $forum_ids = array(); diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index ca566b1524..2e7f60825d 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -386,7 +386,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) return; } - $redirect = request_var('redirect', build_url(array('_f_', 'quickmod'))); + $redirect = request_var('redirect', build_url(array('quickmod'))); $s_hidden_fields = build_hidden_fields(array( 'i' => 'main', @@ -550,7 +550,7 @@ function merge_posts($topic_id, $to_topic_id) return; } - $redirect = request_var('redirect', build_url(array('_f_', 'quickmod'))); + $redirect = request_var('redirect', build_url(array('quickmod'))); $s_hidden_fields = build_hidden_fields(array( 'i' => 'main', diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php index 46b23efb54..b4ac0c11da 100644 --- a/phpBB/includes/ucp/ucp_pm.php +++ b/phpBB/includes/ucp/ucp_pm.php @@ -129,15 +129,7 @@ class ucp_pm break; case 'options': - $sql = 'SELECT group_message_limit - FROM ' . GROUPS_TABLE . ' - WHERE group_id = ' . $user->data['group_id']; - $result = $db->sql_query($sql, 3600); - $message_limit = (int) $db->sql_fetchfield('group_message_limit'); - $db->sql_freeresult($result); - - $user->data['message_limit'] = (!$message_limit) ? $config['pm_max_msgs'] : $message_limit; - + set_user_message_limit(); get_folder($user->data['user_id']); include($phpbb_root_path . 'includes/ucp/ucp_pm_options.' . $phpEx); @@ -168,14 +160,7 @@ class ucp_pm case 'view': - $sql = 'SELECT group_message_limit - FROM ' . GROUPS_TABLE . ' - WHERE group_id = ' . $user->data['group_id']; - $result = $db->sql_query($sql, 3600); - $message_limit = (int) $db->sql_fetchfield('group_message_limit'); - $db->sql_freeresult($result); - - $user->data['message_limit'] = (!$message_limit) ? $config['pm_max_msgs'] : $message_limit; + set_user_message_limit(); if ($folder_specified) { diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index dc74290fad..bfa4e6eceb 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -894,7 +894,7 @@ switch ($mode) { $sort_key_sql['l'] = 'u.user_lastvisit'; } - $sort_key_sql['m'] = 'u.user_rank DESC, u.user_posts'; + $sort_key_sql['m'] = 'u.user_rank'; $sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']); @@ -1154,6 +1154,12 @@ switch ($mode) $order_by .= $sort_key_sql[$sort_key] . ' ' . (($sort_dir == 'a') ? 'ASC' : 'DESC'); + // Unfortunately we must do this here for sorting by rank, else the sort order is applied wrongly + if ($sort_key == 'm') + { + $order_by .= ', u.user_posts DESC'; + } + // Count the users ... if ($sql_where) { |