mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
merge again, revisions 8516 to 8525
git-svn-id: file:///svn/phpbb/trunk@8526 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
f2ba40f294
commit
91d0c8b3bf
13 changed files with 64 additions and 41 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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']))
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
?>
|
|
@ -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')))
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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 = '';
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue