aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/acp/acp_forums.php4
-rw-r--r--phpBB/includes/acp/acp_groups.php4
-rw-r--r--phpBB/includes/acp/acp_users.php18
-rw-r--r--phpBB/includes/db/dbal.php18
-rw-r--r--phpBB/includes/db/firebird.php15
-rw-r--r--phpBB/includes/db/mssql.php43
-rw-r--r--phpBB/includes/db/mssql_odbc.php43
-rw-r--r--phpBB/includes/db/mysql.php27
-rw-r--r--phpBB/includes/db/mysqli.php27
-rw-r--r--phpBB/includes/db/oracle.php15
-rw-r--r--phpBB/includes/db/postgres.php25
-rw-r--r--phpBB/includes/db/sqlite.php25
-rw-r--r--phpBB/includes/functions.php14
-rw-r--r--phpBB/includes/functions_display.php11
-rw-r--r--phpBB/includes/functions_privmsgs.php2
-rw-r--r--phpBB/includes/functions_user.php28
-rw-r--r--phpBB/includes/mcp/mcp_forum.php37
-rw-r--r--phpBB/includes/mcp/mcp_topic.php6
-rwxr-xr-xphpBB/includes/mcp/mcp_warn.php2
-rw-r--r--phpBB/includes/ucp/ucp_groups.php1
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php2
-rw-r--r--phpBB/includes/ucp/ucp_pm_viewfolder.php4
-rw-r--r--phpBB/includes/ucp/ucp_profile.php2
23 files changed, 180 insertions, 193 deletions
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php
index 5ccac5773e..20b463d82a 100644
--- a/phpBB/includes/acp/acp_forums.php
+++ b/phpBB/includes/acp/acp_forums.php
@@ -478,7 +478,7 @@ class acp_forums
$forum_data['forum_rules_bitfield'] = '';
$forum_data['forum_rules_options'] = 0;
- generate_text_for_storage($forum_data['forum_rules'], $forum_data['forum_rules_uid'], $forum_data['forum_rules_bitfield'], $forum_data['forum_rules_options'], request_var('rules_allow_bbcode', false), request_var('rules_allow_urls', false), request_var('rules_allow_smiliess', false));
+ generate_text_for_storage($forum_data['forum_rules'], $forum_data['forum_rules_uid'], $forum_data['forum_rules_bitfield'], $forum_data['forum_rules_options'], request_var('rules_allow_bbcode', false), request_var('rules_allow_urls', false), request_var('rules_allow_smilies', false));
}
// Generate preview content
@@ -498,7 +498,7 @@ class acp_forums
$forum_data['forum_desc_bitfield'] = '';
$forum_data['forum_desc_options'] = 0;
- generate_text_for_storage($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield'], $forum_data['forum_desc_options'], request_var('desc_allow_bbcode', false), request_var('desc_allow_urls', false), request_var('desc_allow_smiliess', false));
+ generate_text_for_storage($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield'], $forum_data['forum_desc_options'], request_var('desc_allow_bbcode', false), request_var('desc_allow_urls', false), request_var('desc_allow_smilies', false));
}
// decode...
diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php
index 669e98f32f..63aec2db97 100644
--- a/phpBB/includes/acp/acp_groups.php
+++ b/phpBB/includes/acp/acp_groups.php
@@ -91,8 +91,6 @@ class acp_groups
break;
}
- group_update_listings($group_id);
-
trigger_error($user->lang[$message] . adm_back_link($this->u_action . '&action=list&g=' . $group_id));
break;
@@ -142,8 +140,6 @@ class acp_groups
group_user_attributes('default', $group_id, $mark_ary, false, $group_row['group_name'], $group_row);
}
- group_update_listings($group_id);
-
trigger_error($user->lang['GROUP_DEFS_UPDATED'] . adm_back_link($this->u_action . '&action=list&g=' . $group_id));
}
else
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 1929b1ece6..81bd8d6436 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -623,7 +623,6 @@ class acp_users
'email_confirm' => strtolower(request_var('email_confirm', '')),
'user_password' => request_var('user_password', '', true),
'password_confirm' => request_var('password_confirm', '', true),
- 'warnings' => request_var('warnings', $user_row['user_warnings']),
);
// Validation data - we do not check the password complexity setting here
@@ -632,7 +631,6 @@ class acp_users
array('string', true, $config['min_pass_chars'], $config['max_pass_chars']),
array('password')),
'password_confirm' => array('string', true, $config['min_pass_chars'], $config['max_pass_chars']),
- 'warnings' => array('num'),
);
// Check username if altered
@@ -641,7 +639,8 @@ class acp_users
$check_ary += array(
'username' => array(
array('string', false, $config['min_name_chars'], $config['max_name_chars']),
- array('username', $user_row['username'])),
+ array('username', $user_row['username'])
+ ),
);
}
@@ -670,7 +669,6 @@ class acp_users
}
// Which updates do we need to do?
- $update_warning = ($user_row['user_warnings'] != $data['warnings']) ? true : false;
$update_username = ($user_row['username'] != $data['username']) ? $data['username'] : false;
$update_password = ($data['user_password'] && $user_row['user_password'] != md5($data['user_password'])) ? true : false;
$update_email = ($data['email'] != $user_row['user_email']) ? $data['email'] : false;
@@ -681,11 +679,6 @@ class acp_users
if ($user_row['user_type'] != USER_FOUNDER || $user->data['user_type'] == USER_FOUNDER)
{
- if ($update_warning)
- {
- $sql_ary['user_warnings'] = $data['warnings'];
- }
-
// Only allow founders updating the founder status...
if ($user->data['user_type'] == USER_FOUNDER)
{
@@ -765,13 +758,6 @@ class acp_users
$db->sql_query($sql);
}
- /**
- * @todo adjust every data based in the number of user warnings
- */
- if ($update_warning)
- {
- }
-
if ($update_username)
{
user_update_name($user_row['username'], $update_username);
diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php
index 1f48909d43..df6e453329 100644
--- a/phpBB/includes/db/dbal.php
+++ b/phpBB/includes/db/dbal.php
@@ -115,6 +115,24 @@ class dbal
}
/**
+ * Build LIMIT query
+ * Doing some validation here.
+ */
+ function sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
+ {
+ if (empty($query))
+ {
+ return false;
+ }
+
+ // Never use a negative total or offset
+ $total = ($total < 0) ? 0 : $total;
+ $offset = ($offset < 0) ? 0 : $offset;
+
+ return $this->_sql_query_limit($query, $total, $offset, $cache_ttl);
+ }
+
+ /**
* Fetch all rows
*/
function sql_fetchrowset($query_id = false)
diff --git a/phpBB/includes/db/firebird.php b/phpBB/includes/db/firebird.php
index 60fa366b7f..709145c4cf 100644
--- a/phpBB/includes/db/firebird.php
+++ b/phpBB/includes/db/firebird.php
@@ -158,20 +158,13 @@ class dbal_firebird extends dbal
/**
* Build LIMIT query
*/
- function sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
+ function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
{
- if ($query != '')
- {
- $this->query_result = false;
+ $this->query_result = false;
- $query = 'SELECT FIRST ' . $total . ((!empty($offset)) ? ' SKIP ' . $offset : '') . substr($query, 6);
+ $query = 'SELECT FIRST ' . $total . ((!empty($offset)) ? ' SKIP ' . $offset : '') . substr($query, 6);
- return $this->sql_query($query, $cache_ttl);
- }
- else
- {
- return false;
- }
+ return $this->sql_query($query, $cache_ttl);
}
/**
diff --git a/phpBB/includes/db/mssql.php b/phpBB/includes/db/mssql.php
index c9946c2b5c..b28ea01acb 100644
--- a/phpBB/includes/db/mssql.php
+++ b/phpBB/includes/db/mssql.php
@@ -159,40 +159,33 @@ class dbal_mssql extends dbal
/**
* Build LIMIT query
*/
- function sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
+ function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
{
- if ($query != '')
- {
- $this->query_result = false;
+ $this->query_result = false;
- // Since TOP is only returning a set number of rows we won't need it if total is set to 0 (return all rows)
- if ($total)
+ // Since TOP is only returning a set number of rows we won't need it if total is set to 0 (return all rows)
+ if ($total)
+ {
+ // We need to grab the total number of rows + the offset number of rows to get the correct result
+ if (strpos($query, 'SELECT DISTINCT') === 0)
{
- // We need to grab the total number of rows + the offset number of rows to get the correct result
- if (strpos($query, 'SELECT DISTINCT') === 0)
- {
- $query = 'SELECT DISTINCT TOP ' . ($total + $offset) . ' ' . substr($query, 15);
- }
- else
- {
- $query = 'SELECT TOP ' . ($total + $offset) . ' ' . substr($query, 6);
- }
+ $query = 'SELECT DISTINCT TOP ' . ($total + $offset) . ' ' . substr($query, 15);
}
-
- $result = $this->sql_query($query, $cache_ttl);
-
- // Seek by $offset rows
- if ($offset)
+ else
{
- $this->sql_rowseek($offset, $result);
+ $query = 'SELECT TOP ' . ($total + $offset) . ' ' . substr($query, 6);
}
-
- return $result;
}
- else
+
+ $result = $this->sql_query($query, $cache_ttl);
+
+ // Seek by $offset rows
+ if ($offset)
{
- return false;
+ $this->sql_rowseek($offset, $result);
}
+
+ return $result;
}
/**
diff --git a/phpBB/includes/db/mssql_odbc.php b/phpBB/includes/db/mssql_odbc.php
index 2cb3bf0f2d..0b8f1e2a95 100644
--- a/phpBB/includes/db/mssql_odbc.php
+++ b/phpBB/includes/db/mssql_odbc.php
@@ -156,40 +156,33 @@ class dbal_mssql_odbc extends dbal
/**
* Build LIMIT query
*/
- function sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
+ function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
{
- if ($query != '')
- {
- $this->query_result = false;
+ $this->query_result = false;
- // Since TOP is only returning a set number of rows we won't need it if total is set to 0 (return all rows)
- if ($total)
+ // Since TOP is only returning a set number of rows we won't need it if total is set to 0 (return all rows)
+ if ($total)
+ {
+ // We need to grab the total number of rows + the offset number of rows to get the correct result
+ if (strpos($query, 'SELECT DISTINCT') === 0)
{
- // We need to grab the total number of rows + the offset number of rows to get the correct result
- if (strpos($query, 'SELECT DISTINCT') === 0)
- {
- $query = 'SELECT DISTINCT TOP ' . ($total + $offset) . ' ' . substr($query, 15);
- }
- else
- {
- $query = 'SELECT TOP ' . ($total + $offset) . ' ' . substr($query, 6);
- }
+ $query = 'SELECT DISTINCT TOP ' . ($total + $offset) . ' ' . substr($query, 15);
}
-
- $result = $this->sql_query($query, $cache_ttl);
-
- // Seek by $offset rows
- if ($offset)
+ else
{
- $this->sql_rowseek($offset, $result);
+ $query = 'SELECT TOP ' . ($total + $offset) . ' ' . substr($query, 6);
}
-
- return $result;
}
- else
+
+ $result = $this->sql_query($query, $cache_ttl);
+
+ // Seek by $offset rows
+ if ($offset)
{
- return false;
+ $this->sql_rowseek($offset, $result);
}
+
+ return $result;
}
/**
diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php
index 89a6e21d70..b750618ae6 100644
--- a/phpBB/includes/db/mysql.php
+++ b/phpBB/includes/db/mysql.php
@@ -163,27 +163,20 @@ class dbal_mysql extends dbal
/**
* Build LIMIT query
*/
- function sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
+ function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
{
- if ($query != '')
- {
- $this->query_result = false;
-
- // if $total is set to 0 we do not want to limit the number of rows
- if ($total == 0)
- {
- // Having a value of -1 was always a bug
- $total = '18446744073709551615';
- }
-
- $query .= "\n LIMIT " . ((!empty($offset)) ? $offset . ', ' . $total : $total);
+ $this->query_result = false;
- return $this->sql_query($query, $cache_ttl);
- }
- else
+ // if $total is set to 0 we do not want to limit the number of rows
+ if ($total == 0)
{
- return false;
+ // Having a value of -1 was always a bug
+ $total = '18446744073709551615';
}
+
+ $query .= "\n LIMIT " . ((!empty($offset)) ? $offset . ', ' . $total : $total);
+
+ return $this->sql_query($query, $cache_ttl);
}
/**
diff --git a/phpBB/includes/db/mysqli.php b/phpBB/includes/db/mysqli.php
index 86700744fb..da6faa3983 100644
--- a/phpBB/includes/db/mysqli.php
+++ b/phpBB/includes/db/mysqli.php
@@ -142,27 +142,20 @@ class dbal_mysqli extends dbal
/**
* Build LIMIT query
*/
- function sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
+ function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
{
- if ($query != '')
- {
- $this->query_result = false;
-
- // if $total is set to 0 we do not want to limit the number of rows
- if ($total == 0)
- {
- // MySQL 4.1+ no longer supports -1 in limit queries
- $total = '18446744073709551615';
- }
-
- $query .= "\n LIMIT " . ((!empty($offset)) ? $offset . ', ' . $total : $total);
+ $this->query_result = false;
- return $this->sql_query($query, $cache_ttl);
- }
- else
+ // if $total is set to 0 we do not want to limit the number of rows
+ if ($total == 0)
{
- return false;
+ // MySQL 4.1+ no longer supports -1 in limit queries
+ $total = '18446744073709551615';
}
+
+ $query .= "\n LIMIT " . ((!empty($offset)) ? $offset . ', ' . $total : $total);
+
+ return $this->sql_query($query, $cache_ttl);
}
/**
diff --git a/phpBB/includes/db/oracle.php b/phpBB/includes/db/oracle.php
index 8f65c667a7..dcb972d119 100644
--- a/phpBB/includes/db/oracle.php
+++ b/phpBB/includes/db/oracle.php
@@ -213,20 +213,13 @@ class dbal_oracle extends dbal
/**
* Build LIMIT query
*/
- function sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
+ function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
{
- if ($query != '')
- {
- $this->query_result = false;
+ $this->query_result = false;
- $query = 'SELECT * FROM (SELECT /*+ FIRST_ROWS */ rownum AS xrownum, a.* FROM (' . $query . ') a WHERE rownum <= ' . ($offset + $total) . ') WHERE xrownum >= ' . $offset;
+ $query = 'SELECT * FROM (SELECT /*+ FIRST_ROWS */ rownum AS xrownum, a.* FROM (' . $query . ') a WHERE rownum <= ' . ($offset + $total) . ') WHERE xrownum >= ' . $offset;
- return $this->sql_query($query, $cache_ttl);
- }
- else
- {
- return false;
- }
+ return $this->sql_query($query, $cache_ttl);
}
/**
diff --git a/phpBB/includes/db/postgres.php b/phpBB/includes/db/postgres.php
index c06786a795..c0a8d930e1 100644
--- a/phpBB/includes/db/postgres.php
+++ b/phpBB/includes/db/postgres.php
@@ -192,26 +192,19 @@ class dbal_postgres extends dbal
/**
* Build LIMIT query
*/
- function sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
+ function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
{
- if ($query != '')
- {
- $this->query_result = false;
-
- // if $total is set to 0 we do not want to limit the number of rows
- if ($total == 0)
- {
- $total = -1;
- }
+ $this->query_result = false;
- $query .= "\n LIMIT $total OFFSET $offset";
-
- return $this->sql_query($query, $cache_ttl);
- }
- else
+ // if $total is set to 0 we do not want to limit the number of rows
+ if ($total == 0)
{
- return false;
+ $total = -1;
}
+
+ $query .= "\n LIMIT $total OFFSET $offset";
+
+ return $this->sql_query($query, $cache_ttl);
}
/**
diff --git a/phpBB/includes/db/sqlite.php b/phpBB/includes/db/sqlite.php
index 708376881c..9f44bd6b35 100644
--- a/phpBB/includes/db/sqlite.php
+++ b/phpBB/includes/db/sqlite.php
@@ -141,26 +141,19 @@ class dbal_sqlite extends dbal
/**
* Build LIMIT query
*/
- function sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
+ function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
{
- if ($query != '')
- {
- $this->query_result = false;
-
- // if $total is set to 0 we do not want to limit the number of rows
- if ($total == 0)
- {
- $total = -1;
- }
-
- $query .= "\n LIMIT " . ((!empty($offset)) ? $offset . ', ' . $total : $total);
+ $this->query_result = false;
- return $this->sql_query($query, $cache_ttl);
- }
- else
+ // if $total is set to 0 we do not want to limit the number of rows
+ if ($total == 0)
{
- return false;
+ $total = -1;
}
+
+ $query .= "\n LIMIT " . ((!empty($offset)) ? $offset . ', ' . $total : $total);
+
+ return $this->sql_query($query, $cache_ttl);
}
/**
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index c9d820ae03..7a99a551cc 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -1285,8 +1285,11 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add
{
global $template, $user;
+ // Make sure $per_page is a valid value
+ $per_page = ($per_page <= 0) ? 1 : $per_page;
+
$seperator = '<span class="page-sep">' . $user->lang['PAGINATION_SEPERATOR'] . '</span>';
- $total_pages = ceil($num_items/$per_page);
+ $total_pages = ceil($num_items / $per_page);
if ($total_pages == 1 || !$num_items)
{
@@ -1361,6 +1364,9 @@ function on_page($num_items, $per_page, $start)
{
global $template, $user;
+ // Make sure $per_page is a valid value
+ $per_page = ($per_page <= 0) ? 1 : $per_page;
+
$on_page = floor($start / $per_page) + 1;
$template->assign_vars(array(
@@ -1503,12 +1509,6 @@ function redirect($url, $return = false)
// Make sure no &amp;'s are in, this will break the redirect
$url = str_replace('&amp;', '&', $url);
- // Make sure no linebreaks are there... to prevent http response splitting for PHP < 4.4.2
- if (strpos(urldecode($url), "\n") !== false || strpos(urldecode($url), "\r") !== false)
- {
- trigger_error('Tried to redirect to potentially insecure url.', E_USER_ERROR);
- }
-
// Determine which type of redirect we need to handle...
$url_parts = parse_url($url);
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index e1e6496c36..601eaa544c 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -504,20 +504,23 @@ function topic_generate_pagination($replies, $url)
{
global $config, $user;
- if (($replies + 1) > $config['posts_per_page'])
+ // Make sure $per_page is a valid value
+ $per_page = ($config['posts_per_page'] <= 0) ? 1 : $config['posts_per_page'];
+
+ if (($replies + 1) > $per_page)
{
- $total_pages = ceil(($replies + 1) / $config['posts_per_page']);
+ $total_pages = ceil(($replies + 1) / $per_page);
$pagination = '';
$times = 1;
- for ($j = 0; $j < $replies + 1; $j += $config['posts_per_page'])
+ for ($j = 0; $j < $replies + 1; $j += $per_page)
{
$pagination .= '<a href="' . $url . '&amp;start=' . $j . '">' . $times . '</a>';
if ($times == 1 && $total_pages > 4)
{
$pagination .= ' ... ';
$times = $total_pages - 3;
- $j += ($total_pages - 4) * $config['posts_per_page'];
+ $j += ($total_pages - 4) * $per_page;
}
else if ($times < $total_pages)
{
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index 20f043c890..d0923f7d36 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -1240,7 +1240,7 @@ function get_folder_status($folder_id, $folder)
/**
* Submit PM
*/
-function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = true)
+function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
{
global $db, $auth, $config, $phpEx, $template, $user, $phpbb_root_path;
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 25ac6f24eb..3e60580293 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -817,9 +817,11 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
}
// Fetch currently set bans of the specified type and exclude state. Prevent duplicate bans.
+ $sql_where = ($type == 'ban_userid') ? 'ban_userid <> 0' : "$type <> ''";
+
$sql = "SELECT $type
FROM " . BANLIST_TABLE . "
- WHERE $type <> ''
+ WHERE $sql_where
AND ban_exclude = $ban_exclude";
$result = $db->sql_query($sql);
@@ -1148,15 +1150,19 @@ function validate_match($string, $optional = false, $match)
* Also checks if it includes the " character, which we don't allow in usernames.
* Used for registering, changing names, and posting anonymously with a username
*
+* @param string $username The username to check
+* @param string $allowed_username An allowed username, default being $user->data['username']
+*
* @return mixed Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)
*/
-function validate_username($username)
+function validate_username($username, $allowed_username = false)
{
global $config, $db, $user, $cache;
$clean_username = utf8_clean_string($username);
+ $allowed_username = ($allowed_username === false) ? $user->data['username_clean'] : utf8_clean_string($allowed_username);
- if (utf8_clean_string($user->data['username']) == $clean_username)
+ if ($allowed_username == $clean_username)
{
return false;
}
@@ -1190,7 +1196,6 @@ function validate_username($username)
return 'USERNAME_TAKEN';
}
-
$bad_usernames = $cache->obtain_disallowed_usernames();
foreach ($bad_usernames as $bad_username)
@@ -1725,6 +1730,8 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow
$name = ($type == GROUP_SPECIAL) ? $user->lang['G_' . $name] : $name;
add_log('admin', $log, $name);
+
+ group_update_listings($group_id);
}
return (sizeof($error)) ? $error : false;
@@ -2013,6 +2020,8 @@ function group_user_del($group_id, $user_id_ary = false, $username_ary = false,
add_log('admin', $log, $group_name, implode(', ', $username_ary));
+ group_update_listings($group_id);
+
// Return false - no error
return false;
}
@@ -2115,13 +2124,17 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna
add_log('admin', $log, $group_name, implode(', ', $username_ary));
+ group_update_listings($group_id);
+
return true;
}
/**
* Set users default group
+*
+* @private
*/
-function group_set_user_default($group_id, $user_id_ary, $group_attributes = false)
+function group_set_user_default($group_id, $user_id_ary, $group_attributes = false, $update_listing = false)
{
global $db;
@@ -2212,6 +2225,11 @@ function group_set_user_default($group_id, $user_id_ary, $group_attributes = fal
set_config('newest_user_colour', $sql_ary['user_colour'], true);
}
}
+
+ if ($update_listing)
+ {
+ group_update_listings($group_id);
+ }
}
/**
diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php
index 9c51990ef0..9d0d15b917 100644
--- a/phpBB/includes/mcp/mcp_forum.php
+++ b/phpBB/includes/mcp/mcp_forum.php
@@ -129,14 +129,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
$posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', $row['forum_id'])) ? true : false;
$u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? $url . '&amp;i=queue&amp;mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . '&amp;t=' . $row['topic_id'] : '';
- $template->assign_block_vars('topicrow', array(
- 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&amp;f=$forum_id&amp;t={$row['topic_id']}&amp;mode=topic_view"),
-
- 'S_SELECT_TOPIC' => ($action == 'merge_select' && $row['topic_id'] != $topic_id) ? true : false,
- 'U_SELECT_TOPIC' => $url . "&amp;i=$id&amp;mode=topic_view&amp;action=merge&amp;to_topic_id=" . $row['topic_id'] . $selected_ids,
- 'U_MCP_QUEUE' => $u_mcp_queue,
- 'U_MCP_REPORT' => ($auth->acl_get('m_report', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&amp;mode=topic_view&amp;t=' . $row['topic_id'] . '&amp;action=reports') : '',
-
+ $topic_row = array(
'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'),
@@ -159,16 +152,38 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
'TOPIC_TITLE' => $topic_title,
'REPLIES' => ($auth->acl_get('m_approve', $row['forum_id'])) ? $row['topic_replies_real'] : $row['topic_replies'],
'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']),
- 'TOPIC_ID' => $row['topic_id'],
- 'S_TOPIC_CHECKED' => ($topic_id_list && in_array($row['topic_id'], $topic_id_list)) ? 'checked="checked" ' : '',
'FIRST_POST_TIME' => $user->format_date($row['topic_time']),
'LAST_POST_SUBJECT' => $row['topic_last_post_subject'],
'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']),
'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_get('m_report', $row['forum_id'])) ? true : false,
'S_TOPIC_UNAPPROVED' => $topic_unapproved,
- 'S_POSTS_UNAPPROVED' => $posts_unapproved)
+ 'S_POSTS_UNAPPROVED' => $posts_unapproved,
);
+
+ if ($row['topic_status'] == ITEM_MOVED)
+ {
+ $topic_row = array_merge($topic_row, array(
+ 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t={$row['topic_moved_id']}"),
+ 'S_MOVED_TOPIC' => true,
+ 'TOPIC_ID' => $row['topic_moved_id'],
+ ));
+ }
+ else
+ {
+ $topic_row = array_merge($topic_row, array(
+ 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&amp;f=$forum_id&amp;t={$row['topic_id']}&amp;mode=topic_view"),
+
+ 'S_SELECT_TOPIC' => ($action == 'merge_select' && $row['topic_id'] != $topic_id) ? true : false,
+ 'U_SELECT_TOPIC' => $url . "&amp;i=$id&amp;mode=topic_view&amp;action=merge&amp;to_topic_id=" . $row['topic_id'] . $selected_ids,
+ 'U_MCP_QUEUE' => $u_mcp_queue,
+ 'U_MCP_REPORT' => ($auth->acl_get('m_report', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&amp;mode=topic_view&amp;t=' . $row['topic_id'] . '&amp;action=reports') : '',
+ 'TOPIC_ID' => $row['topic_id'],
+ 'S_TOPIC_CHECKED' => ($topic_id_list && in_array($row['topic_id'], $topic_id_list)) ? true : false,
+ ));
+ }
+
+ $template->assign_block_vars('topicrow', $topic_row);
}
unset($topic_rows);
}
diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php
index 4ad8efeda3..09b3f6f314 100644
--- a/phpBB/includes/mcp/mcp_topic.php
+++ b/phpBB/includes/mcp/mcp_topic.php
@@ -386,6 +386,12 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
$to_topic_id = $db->sql_nextid();
move_posts($post_id_list, $to_topic_id);
+ $topic_info = get_post_data(array($topic_id));
+ $topic_info = $topic_info[$topic_id];
+
+ add_log('mod', $to_forum_id, $to_topic_id, 'LOG_SPLIT_DESTINATION', $subject);
+ add_log('mod', $forum_id, $topic_id, 'LOG_SPLIT_SOURCE', $topic_info['topic_title']);
+
// Change topic title of first post
$sql = 'UPDATE ' . POSTS_TABLE . "
SET post_subject = '" . $db->sql_escape($subject) . "'
diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php
index dc7a4870cd..a0a61110e1 100755
--- a/phpBB/includes/mcp/mcp_warn.php
+++ b/phpBB/includes/mcp/mcp_warn.php
@@ -432,7 +432,7 @@ function add_warning($user_row, $warning, $send_pm = true, $post_id = 0)
'address_list' => array('u' => array($user_row['user_id'] => 'to')),
);
- submit_pm('post', $lang['WARNING_PM_SUBJECT'], $pm_data, false, false);
+ submit_pm('post', $lang['WARNING_PM_SUBJECT'], $pm_data, false);
}
add_log('admin', 'LOG_USER_WARNING', $user_row['username']);
diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php
index c97fc99652..119f496d21 100644
--- a/phpBB/includes/ucp/ucp_groups.php
+++ b/phpBB/includes/ucp/ucp_groups.php
@@ -799,7 +799,6 @@ class ucp_groups
group_user_attributes('default', $group_id, $mark_ary, false, $group_row['group_name'], $group_row);
}
- group_update_listings($group_id);
$user->add_lang('acp/groups');
trigger_error($user->lang['GROUP_DEFS_UPDATED'] . $return_page);
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index 2e7ace4567..714f5ec0aa 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -558,7 +558,7 @@ function compose_pm($id, $mode, $action)
unset($message_parser);
// ((!$message_subject) ? $subject : $message_subject)
- $msg_id = submit_pm($action, $subject, $pm_data, true);
+ $msg_id = submit_pm($action, $subject, $pm_data);
$return_message_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=view&amp;p=' . $msg_id);
$return_folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=outbox');
diff --git a/phpBB/includes/ucp/ucp_pm_viewfolder.php b/phpBB/includes/ucp/ucp_pm_viewfolder.php
index d301e2ecb9..4ce5b81fce 100644
--- a/phpBB/includes/ucp/ucp_pm_viewfolder.php
+++ b/phpBB/includes/ucp/ucp_pm_viewfolder.php
@@ -239,7 +239,9 @@ function view_folder($id, $mode, $folder_id, $folder)
$template->assign_vars(array(
'S_SHOW_RECIPIENTS' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? true : false,
- 'S_SHOW_COLOUR_LEGEND' => true)
+ 'S_SHOW_COLOUR_LEGEND' => true,
+
+ 'S_PM_ICONS' => ($config['enable_pm_icons']) ? true : false)
);
}
}
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index e0d375c7ff..b5d2ae19d8 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -60,7 +60,7 @@ class ucp_profile
{
$check_ary['username'] = array(
array('string', false, $config['min_name_chars'], $config['max_name_chars']),
- array('username', $data['username']),
+ array('username'),
);
}