aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-06-08 20:26:03 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-06-08 20:26:03 +0000
commitef08df567522851202b09715c6b4bdef0c386403 (patch)
treef48e3798b2983a893c49943ac849be1d8a1ee5c7 /phpBB/includes
parent580a318d1624e76e258c5aa9a151e45f59bc7b91 (diff)
downloadforums-ef08df567522851202b09715c6b4bdef0c386403.tar
forums-ef08df567522851202b09715c6b4bdef0c386403.tar.gz
forums-ef08df567522851202b09715c6b4bdef0c386403.tar.bz2
forums-ef08df567522851202b09715c6b4bdef0c386403.tar.xz
forums-ef08df567522851202b09715c6b4bdef0c386403.zip
- bugfix roll
- fixed sql_query_limit on mssql/mssql_odbc git-svn-id: file:///svn/phpbb/trunk@6024 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/acp/acp_permissions.php4
-rw-r--r--phpBB/includes/acp/acp_users.php24
-rw-r--r--phpBB/includes/db/mssql.php10
-rw-r--r--phpBB/includes/db/mssql_odbc.php15
-rwxr-xr-xphpBB/includes/mcp/mcp_logs.php16
-rw-r--r--phpBB/includes/ucp/ucp_activate.php17
-rw-r--r--phpBB/includes/ucp/ucp_profile.php4
-rw-r--r--phpBB/includes/ucp/ucp_zebra.php10
8 files changed, 81 insertions, 19 deletions
diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php
index 79f55a7dd2..bb7c3e4267 100644
--- a/phpBB/includes/acp/acp_permissions.php
+++ b/phpBB/includes/acp/acp_permissions.php
@@ -738,10 +738,12 @@ class acp_permissions
}
// Update the permission set...
- $auth_admin->acl_set($ug_type, $forum_id, $ug_id, $auth_options, $assigned_role);
+ $auth_admin->acl_set($ug_type, $forum_id, $ug_id, $auth_options, $assigned_role, false);
}
}
+ $auth_admin->acl_clear_prefetch();
+
// Do we need to recache the moderator lists?
if ($permission_type == 'm_')
{
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index ea8e20a210..fba21b3cb9 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -288,6 +288,30 @@ class acp_users
add_log('user', $user_id, $log . '_USER');
+ if ($user_row['user_type'] == USER_INACTIVE)
+ {
+ set_config('num_users', $config['num_users'] + 1, true);
+ }
+ else
+ {
+ set_config('num_users', $config['num_users'] - 1, true);
+ }
+
+ // Get latest username
+ $sql = 'SELECT user_id, username
+ FROM ' . USERS_TABLE . '
+ WHERE user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')
+ ORDER BY user_id DESC';
+ $result = $db->sql_query_limit($sql, 1);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ if ($row)
+ {
+ set_config('newest_user_id', $row['user_id'], true);
+ set_config('newest_username', $row['username'], true);
+ }
+
trigger_error($user->lang[$message] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
break;
diff --git a/phpBB/includes/db/mssql.php b/phpBB/includes/db/mssql.php
index ef6f406edc..2f76f90bbb 100644
--- a/phpBB/includes/db/mssql.php
+++ b/phpBB/includes/db/mssql.php
@@ -159,7 +159,15 @@ class dbal_mssql extends dbal
$query = 'SELECT TOP ' . ($row_offset + $num_rows) . ' ' . substr($query, 6);
}
- return $this->sql_query($query, $cache_ttl);
+ $result = $this->sql_query($query, $cache_ttl);
+
+ // Seek by $row_offset rows
+ if ($row_offset)
+ {
+ $this->sql_rowseek($result, $row_offset);
+ }
+
+ return $result;
}
else
{
diff --git a/phpBB/includes/db/mssql_odbc.php b/phpBB/includes/db/mssql_odbc.php
index 0ae0d7e770..80ae25c4be 100644
--- a/phpBB/includes/db/mssql_odbc.php
+++ b/phpBB/includes/db/mssql_odbc.php
@@ -146,7 +146,7 @@ class dbal_mssql_odbc extends dbal
$total = -1;
}
- $row_offset = ($total) ? $offset : '';
+ $row_offset = ($total) ? $offset : 0;
$num_rows = ($total) ? $total : $offset;
if (strpos($query, 'SELECT DISTINCT') === 0)
@@ -158,7 +158,18 @@ class dbal_mssql_odbc extends dbal
$query = 'SELECT TOP ' . ($row_offset + $num_rows) . ' ' . substr($query, 6);
}
- return $this->sql_query($query, $cache_ttl);
+ $result = $this->sql_query($query, $cache_ttl);
+
+ // Seek by $row_offset rows
+ if ($row_offset)
+ {
+ for ($i = 0; $i < $row_offset; $i++)
+ {
+ $this->sql_fetchrow($result);
+ }
+ }
+
+ return $result;
}
else
{
diff --git a/phpBB/includes/mcp/mcp_logs.php b/phpBB/includes/mcp/mcp_logs.php
index 3d4c5d10ab..b190c52f43 100755
--- a/phpBB/includes/mcp/mcp_logs.php
+++ b/phpBB/includes/mcp/mcp_logs.php
@@ -60,15 +60,17 @@ class mcp_logs
{
case 'front':
$where_sql = '';
- break;
+ break;
+
case 'forum_logs':
$forum_id = request_var('f', 0);
$where_sql = " AND forum_id = $forum_id";
- break;
+ break;
+
case 'topic_logs':
$topic_id = request_var('t', 0);
$where_sql = " AND topic_id = $topic_id";
- break;
+ break;
}
// Delete entries if requested and able
@@ -81,6 +83,7 @@ class mcp_logs
{
$sql_in[] = $mark;
}
+
$where_sql = ' AND log_id IN (' . implode(', ', $sql_in) . ')';
unset($sql_in);
}
@@ -111,13 +114,12 @@ class mcp_logs
// Grab log data
$log_data = array();
$log_count = 0;
-
view_log('mod', $log_data, $log_count, $config['topics_per_page'], $start, $forum_id, $topic_id, 0, $sql_where, $sql_sort);
$template->assign_vars(array(
- 'S_ON_PAGE' => on_page($log_count, $config['topics_per_page'], $start),
- 'TOTAL_LOGS' => ($log_count == 1) ? $user->lang['TOTAL_LOG'] : sprintf($user->lang['TOTAL_LOGS'], $log_count),
- 'PAGINATION' => generate_pagination($this->u_action . "&amp;$u_sort_param", $log_count, $config['topics_per_page'], $start, true),
+ 'PAGE_NUMBER' => on_page($log_count, $config['topics_per_page'], $start),
+ 'TOTAL' => ($log_count == 1) ? $user->lang['TOTAL_LOG'] : sprintf($user->lang['TOTAL_LOGS'], $log_count),
+ 'PAGINATION' => generate_pagination($this->u_action . "&amp;$u_sort_param", $log_count, $config['topics_per_page'], $start),
'U_POST_ACTION' => $this->u_action,
'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false,
diff --git a/phpBB/includes/ucp/ucp_activate.php b/phpBB/includes/ucp/ucp_activate.php
index c837975fa4..f9f39f4663 100644
--- a/phpBB/includes/ucp/ucp_activate.php
+++ b/phpBB/includes/ucp/ucp_activate.php
@@ -105,8 +105,21 @@ class ucp_activate
if (!$update_password)
{
- set_config('newest_user_id', $row['user_id'], true);
- set_config('newest_username', $row['username'], true);
+ // Get latest username
+ $sql = 'SELECT user_id, username
+ FROM ' . USERS_TABLE . '
+ WHERE user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')
+ ORDER BY user_id DESC';
+ $result = $db->sql_query_limit($sql, 1);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ if ($row)
+ {
+ set_config('newest_user_id', $row['user_id'], true);
+ set_config('newest_username', $row['username'], true);
+ }
+
set_config('num_users', $config['num_users'] + 1, true);
}
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index 8488f30968..7f593a26a5 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -475,7 +475,9 @@ class ucp_profile
'L_SIGNATURE_EXPLAIN' => sprintf($user->lang['SIGNATURE_EXPLAIN'], $config['max_sig_chars']),
'S_BBCODE_ALLOWED' => $config['allow_sig_bbcode'],
- 'S_SMILIES_ALLOWED' => $config['allow_sig_smilies'],)
+ 'S_SMILIES_ALLOWED' => $config['allow_sig_smilies'],
+ 'S_BBCODE_IMG' => ($config['allow_sig_img']) ? true : false,
+ 'S_BBCODE_FLASH' => ($config['allow_sig_flash']) ? true : false)
);
// Build custom bbcodes array
diff --git a/phpBB/includes/ucp/ucp_zebra.php b/phpBB/includes/ucp/ucp_zebra.php
index 60d8822a00..9b2de97b8e 100644
--- a/phpBB/includes/ucp/ucp_zebra.php
+++ b/phpBB/includes/ucp/ucp_zebra.php
@@ -45,7 +45,7 @@ class ucp_zebra
if ($data['add'] && !sizeof($error))
{
- $data['add'] = explode("\n", $data['add']);
+ $data['add'] = array_map('strtolower', explode("\n", $data['add']));
// Do these name/s exist on a list already? If so, ignore ... we could be
// 'nice' and automatically handle names added to one list present on
@@ -62,16 +62,16 @@ class ucp_zebra
{
if ($row['friend'])
{
- $friends[] = $row['username'];
+ $friends[] = strtolower($row['username']);
}
else
{
- $foes[] = $row['username'];
+ $foes[] = strtolower($row['username']);
}
}
$db->sql_freeresult($result);
- $data['add'] = array_diff($data['add'], $friends, $foes, array($user->data['username']));
+ $data['add'] = array_diff($data['add'], $friends, $foes, array(strtolower($user->data['username'])));
unset($friends, $foes);
$data['add'] = implode(', ', preg_replace('#^[\s]*?(.*?)[\s]*?$#e', "\"'\" . \$db->sql_escape('\\1') . \"'\"", $data['add']));
@@ -80,7 +80,7 @@ class ucp_zebra
{
$sql = 'SELECT user_id, user_type
FROM ' . USERS_TABLE . '
- WHERE username IN (' . $data['add'] . ')
+ WHERE LOWER(username) IN (' . $data['add'] . ')
AND user_type NOT IN (' . USER_IGNORE . ', ' . USER_INACTIVE . ')';
$result = $db->sql_query($sql);