mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
- bugfix roll
- fixed sql_query_limit on mssql/mssql_odbc git-svn-id: file:///svn/phpbb/trunk@6024 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
580a318d16
commit
ef08df5675
10 changed files with 86 additions and 28 deletions
|
@ -738,10 +738,12 @@ class acp_permissions
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the permission set...
|
// 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?
|
// Do we need to recache the moderator lists?
|
||||||
if ($permission_type == 'm_')
|
if ($permission_type == 'm_')
|
||||||
{
|
{
|
||||||
|
|
|
@ -288,6 +288,30 @@ class acp_users
|
||||||
|
|
||||||
add_log('user', $user_id, $log . '_USER');
|
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 . '&u=' . $user_id));
|
trigger_error($user->lang[$message] . adm_back_link($this->u_action . '&u=' . $user_id));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -159,7 +159,15 @@ class dbal_mssql extends dbal
|
||||||
$query = 'SELECT TOP ' . ($row_offset + $num_rows) . ' ' . substr($query, 6);
|
$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
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -146,7 +146,7 @@ class dbal_mssql_odbc extends dbal
|
||||||
$total = -1;
|
$total = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$row_offset = ($total) ? $offset : '';
|
$row_offset = ($total) ? $offset : 0;
|
||||||
$num_rows = ($total) ? $total : $offset;
|
$num_rows = ($total) ? $total : $offset;
|
||||||
|
|
||||||
if (strpos($query, 'SELECT DISTINCT') === 0)
|
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);
|
$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
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -60,15 +60,17 @@ class mcp_logs
|
||||||
{
|
{
|
||||||
case 'front':
|
case 'front':
|
||||||
$where_sql = '';
|
$where_sql = '';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'forum_logs':
|
case 'forum_logs':
|
||||||
$forum_id = request_var('f', 0);
|
$forum_id = request_var('f', 0);
|
||||||
$where_sql = " AND forum_id = $forum_id";
|
$where_sql = " AND forum_id = $forum_id";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'topic_logs':
|
case 'topic_logs':
|
||||||
$topic_id = request_var('t', 0);
|
$topic_id = request_var('t', 0);
|
||||||
$where_sql = " AND topic_id = $topic_id";
|
$where_sql = " AND topic_id = $topic_id";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete entries if requested and able
|
// Delete entries if requested and able
|
||||||
|
@ -81,6 +83,7 @@ class mcp_logs
|
||||||
{
|
{
|
||||||
$sql_in[] = $mark;
|
$sql_in[] = $mark;
|
||||||
}
|
}
|
||||||
|
|
||||||
$where_sql = ' AND log_id IN (' . implode(', ', $sql_in) . ')';
|
$where_sql = ' AND log_id IN (' . implode(', ', $sql_in) . ')';
|
||||||
unset($sql_in);
|
unset($sql_in);
|
||||||
}
|
}
|
||||||
|
@ -111,13 +114,12 @@ class mcp_logs
|
||||||
// Grab log data
|
// Grab log data
|
||||||
$log_data = array();
|
$log_data = array();
|
||||||
$log_count = 0;
|
$log_count = 0;
|
||||||
|
|
||||||
view_log('mod', $log_data, $log_count, $config['topics_per_page'], $start, $forum_id, $topic_id, 0, $sql_where, $sql_sort);
|
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(
|
$template->assign_vars(array(
|
||||||
'S_ON_PAGE' => on_page($log_count, $config['topics_per_page'], $start),
|
'PAGE_NUMBER' => 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),
|
'TOTAL' => ($log_count == 1) ? $user->lang['TOTAL_LOG'] : sprintf($user->lang['TOTAL_LOGS'], $log_count),
|
||||||
'PAGINATION' => generate_pagination($this->u_action . "&$u_sort_param", $log_count, $config['topics_per_page'], $start, true),
|
'PAGINATION' => generate_pagination($this->u_action . "&$u_sort_param", $log_count, $config['topics_per_page'], $start),
|
||||||
|
|
||||||
'U_POST_ACTION' => $this->u_action,
|
'U_POST_ACTION' => $this->u_action,
|
||||||
'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false,
|
'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false,
|
||||||
|
|
|
@ -105,8 +105,21 @@ class ucp_activate
|
||||||
|
|
||||||
if (!$update_password)
|
if (!$update_password)
|
||||||
{
|
{
|
||||||
set_config('newest_user_id', $row['user_id'], true);
|
// Get latest username
|
||||||
set_config('newest_username', $row['username'], true);
|
$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);
|
set_config('num_users', $config['num_users'] + 1, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -475,7 +475,9 @@ class ucp_profile
|
||||||
'L_SIGNATURE_EXPLAIN' => sprintf($user->lang['SIGNATURE_EXPLAIN'], $config['max_sig_chars']),
|
'L_SIGNATURE_EXPLAIN' => sprintf($user->lang['SIGNATURE_EXPLAIN'], $config['max_sig_chars']),
|
||||||
|
|
||||||
'S_BBCODE_ALLOWED' => $config['allow_sig_bbcode'],
|
'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
|
// Build custom bbcodes array
|
||||||
|
|
|
@ -45,7 +45,7 @@ class ucp_zebra
|
||||||
|
|
||||||
if ($data['add'] && !sizeof($error))
|
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
|
// 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
|
// 'nice' and automatically handle names added to one list present on
|
||||||
|
@ -62,16 +62,16 @@ class ucp_zebra
|
||||||
{
|
{
|
||||||
if ($row['friend'])
|
if ($row['friend'])
|
||||||
{
|
{
|
||||||
$friends[] = $row['username'];
|
$friends[] = strtolower($row['username']);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$foes[] = $row['username'];
|
$foes[] = strtolower($row['username']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$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);
|
unset($friends, $foes);
|
||||||
|
|
||||||
$data['add'] = implode(', ', preg_replace('#^[\s]*?(.*?)[\s]*?$#e', "\"'\" . \$db->sql_escape('\\1') . \"'\"", $data['add']));
|
$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
|
$sql = 'SELECT user_id, user_type
|
||||||
FROM ' . USERS_TABLE . '
|
FROM ' . USERS_TABLE . '
|
||||||
WHERE username IN (' . $data['add'] . ')
|
WHERE LOWER(username) IN (' . $data['add'] . ')
|
||||||
AND user_type NOT IN (' . USER_IGNORE . ', ' . USER_INACTIVE . ')';
|
AND user_type NOT IN (' . USER_IGNORE . ', ' . USER_INACTIVE . ')';
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
|
|
|
@ -35,14 +35,6 @@
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<table width="100%" cellspacing="0" cellpadding="0">
|
|
||||||
<tr>
|
|
||||||
<td class="pagination">{S_ON_PAGE} [ {TOTAL_LOGS} ]</td>
|
|
||||||
<td align="right"><span class="pagination"><!-- IF PAGINATION --><a href="javascript:jumpto();">{L_GOTO_PAGE}</a> <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}">{L_PREVIOUS}</a> <!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE --> <a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --><!-- ENDIF --></span></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<br clear="all" /><br />
|
<br clear="all" /><br />
|
||||||
|
|
|
@ -48,13 +48,17 @@ e_help = "{LA_BBCODE_E_HELP}";
|
||||||
<td colspan="2"><input type="button" class="btnbbcode" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px;" onclick="bbstyle(0)" onmouseover="helpline('b')" />
|
<td colspan="2"><input type="button" class="btnbbcode" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px;" onclick="bbstyle(0)" onmouseover="helpline('b')" />
|
||||||
<input type="button" class="btnbbcode" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px;" onclick="bbstyle(2)" onmouseover="helpline('i')" />
|
<input type="button" class="btnbbcode" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px;" onclick="bbstyle(2)" onmouseover="helpline('i')" />
|
||||||
<input type="button" class="btnbbcode" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px;" onclick="bbstyle(4)" onmouseover="helpline('u')" />
|
<input type="button" class="btnbbcode" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px;" onclick="bbstyle(4)" onmouseover="helpline('u')" />
|
||||||
<!-- IF S_BBCODE_QUOTE --><input type="button" class="btnbbcode" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onclick="bbstyle(6)" onmouseover="helpline('q')" /><!-- ENDIF -->
|
<input type="button" class="btnbbcode" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onclick="bbstyle(6)" onmouseover="helpline('q')" />
|
||||||
<input type="button" class="btnbbcode" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" onmouseover="helpline('c')" />
|
<input type="button" class="btnbbcode" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" onmouseover="helpline('c')" />
|
||||||
<input type="button" class="btnbbcode" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" onmouseover="helpline('l')" />
|
<input type="button" class="btnbbcode" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" onmouseover="helpline('l')" />
|
||||||
<input type="button" class="btnbbcode" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" onmouseover="helpline('o')" />
|
<input type="button" class="btnbbcode" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" onmouseover="helpline('o')" />
|
||||||
<!-- IF S_BBCODE_IMG --><input type="button" class="btnbbcode" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" onmouseover="helpline('p')" /><!-- ENDIF -->
|
<!-- IF S_BBCODE_IMG --><input type="button" class="btnbbcode" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" onmouseover="helpline('p')" /><!-- ENDIF -->
|
||||||
<input type="button" class="btnbbcode" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" onmouseover="helpline('w')" />
|
<input type="button" class="btnbbcode" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" onmouseover="helpline('w')" />
|
||||||
<!-- IF S_BBCODE_FLASH --><input type="button" class="btnbbcode" accesskey="f" name="addbbcode18" value="Flash" onclick="bbstyle(18)" /><!-- ENDIF -->
|
<!-- IF S_BBCODE_FLASH --><input type="button" class="btnbbcode" accesskey="f" name="addbbcode18" value="Flash" onclick="bbstyle(18)" /><!-- ENDIF -->
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td valign="middle" align="left">
|
||||||
<span class="genmed" style="white-space: nowrap;">{L_FONT_SIZE}: <select class="gensmall" name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" onmouseover="helpline('f')">
|
<span class="genmed" style="white-space: nowrap;">{L_FONT_SIZE}: <select class="gensmall" name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" onmouseover="helpline('f')">
|
||||||
<option value="7">{L_FONT_TINY}</option>
|
<option value="7">{L_FONT_TINY}</option>
|
||||||
<option value="9">{L_FONT_SMALL}</option>
|
<option value="9">{L_FONT_SMALL}</option>
|
||||||
|
|
Loading…
Add table
Reference in a new issue