1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-12 20:56:40 +02:00

Fix bug #46255 - Allow friends/foes to be added and removed at the same time.

Authorised by: acydburn

git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9577 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Andreas Fischer
2009-06-13 12:40:15 +00:00
parent 8c246032cc
commit 12de4efca4
2 changed files with 16 additions and 12 deletions

View File

@ -101,6 +101,7 @@
<li>[Fix] Also remove data from friend/foe table when deleting user. (Bug #45345 - Patch by nickvergessen)</li> <li>[Fix] Also remove data from friend/foe table when deleting user. (Bug #45345 - Patch by nickvergessen)</li>
<li>[Fix] Correctly hide skiplink in prosilver right-to-left mode. (Bug #45765 - Patch by prototech and bantu)</li> <li>[Fix] Correctly hide skiplink in prosilver right-to-left mode. (Bug #45765 - Patch by prototech and bantu)</li>
<li>[Fix] Fix dynamic config update routine error if firebird is used (Bug #46315)</li> <li>[Fix] Fix dynamic config update routine error if firebird is used (Bug #46315)</li>
<li>[Fix] Allow friends/foes to be added and removed at the same time. (Bug #46255 - Patch by bantu)</li>
<li>[Change] Change the data format of the default file ACM to be more secure from tampering and have better performance.</li> <li>[Change] Change the data format of the default file ACM to be more secure from tampering and have better performance.</li>
<li>[Change] Add index on log_time to the log table to prevent slowdown on boards with many log entries. (Bug #44665 - Patch by bantu)</li> <li>[Change] Add index on log_time to the log table to prevent slowdown on boards with many log entries. (Bug #44665 - Patch by bantu)</li>
<li>[Change] Template engine now permits to a limited extent variable includes.</li> <li>[Change] Template engine now permits to a limited extent variable includes.</li>

View File

@ -52,6 +52,21 @@ class ucp_zebra
{ {
if (confirm_box(true)) if (confirm_box(true))
{ {
// Remove users
if (!empty($data['usernames']))
{
// Force integer values
$data['usernames'] = array_map('intval', $data['usernames']);
$sql = 'DELETE FROM ' . ZEBRA_TABLE . '
WHERE user_id = ' . $user->data['user_id'] . '
AND ' . $db->sql_in_set('zebra_id', $data['usernames']);
$db->sql_query($sql);
$updated = true;
}
// Add users
if ($data['add']) if ($data['add'])
{ {
$data['add'] = array_map('trim', array_map('utf8_clean_string', explode("\n", $data['add']))); $data['add'] = array_map('trim', array_map('utf8_clean_string', explode("\n", $data['add'])));
@ -183,18 +198,6 @@ class ucp_zebra
} }
} }
} }
else if (sizeof($data['usernames']))
{
// Force integer values
$data['usernames'] = array_map('intval', $data['usernames']);
$sql = 'DELETE FROM ' . ZEBRA_TABLE . '
WHERE user_id = ' . $user->data['user_id'] . '
AND ' . $db->sql_in_set('zebra_id', $data['usernames']);
$db->sql_query($sql);
$updated = true;
}
if ($updated) if ($updated)
{ {