mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-08 17:56:52 +02:00
- fix some bugs...
git-svn-id: file:///svn/phpbb/trunk@5643 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -18,7 +18,7 @@ class acp_forums
|
||||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template;
|
||||
global $db, $user, $auth, $template, $cache;
|
||||
global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx, $SID;
|
||||
|
||||
$user->add_lang('acp/forums');
|
||||
|
@@ -809,7 +809,7 @@ class acp_permissions
|
||||
}
|
||||
|
||||
/**
|
||||
* Update foes
|
||||
* Update foes - remove moderators and administrators from foe lists...
|
||||
*/
|
||||
function update_foes()
|
||||
{
|
||||
@@ -827,7 +827,8 @@ class acp_permissions
|
||||
if (sizeof($perms))
|
||||
{
|
||||
$sql = 'DELETE FROM ' . ZEBRA_TABLE . '
|
||||
WHERE zebra_id IN (' . implode(', ', $perms) . ')';
|
||||
WHERE zebra_id IN (' . implode(', ', $perms) . ')
|
||||
AND foe = 1';
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
unset($perms);
|
||||
|
@@ -220,15 +220,15 @@ class acp_search
|
||||
}
|
||||
|
||||
$action = &$this->state[1];
|
||||
|
||||
|
||||
@set_time_limit(0);
|
||||
|
||||
|
||||
$this->max_post_id = $this->get_max_post_id();
|
||||
|
||||
|
||||
$post_counter = (isset($this->state[2])) ? $this->state[2] : 0;
|
||||
$this->state[2] = &$post_counter;
|
||||
$this->save_state();
|
||||
|
||||
|
||||
if ($action == 'delete')
|
||||
{
|
||||
if (method_exists($this->search, 'delete_index'))
|
||||
@@ -251,7 +251,7 @@ class acp_search
|
||||
$posters[] = $row['poster_id'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
if (sizeof($ids))
|
||||
{
|
||||
$this->search->index_remove($ids, $posters);
|
||||
@@ -296,13 +296,13 @@ class acp_search
|
||||
WHERE post_id >= ' . (int) ($post_counter + 1) . '
|
||||
AND post_id < ' . (int) ($post_counter + $this->batch_size);
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
|
||||
while (false !== ($row = $db->sql_fetchrow($result)))
|
||||
{
|
||||
$this->search->index('post', $row['post_id'], $row['post_text'], $row['post_subject'], $row['poster_id']);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
$post_counter += $this->batch_size;
|
||||
|
||||
// save the current state
|
||||
@@ -452,8 +452,10 @@ class acp_search
|
||||
$sql = 'SELECT MAX(post_id) as max_post_id
|
||||
FROM '. POSTS_TABLE;
|
||||
$result = $db->sql_query($sql);
|
||||
$max_post_id = (int) $db->sql_fetchfield('max_post_id', 0, $result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
return $db->sql_fetchfield('max_post_id', 0, $result);
|
||||
return $max_post_id;
|
||||
}
|
||||
|
||||
function save_state($state = false)
|
||||
|
@@ -616,16 +616,13 @@ 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 = ($user_row['user_password'] != $data['user_password']) ? true : false;
|
||||
$update_password = ($data['user_password'] && $user_row['user_password'] != md5($data['user_password'])) ? true : false;
|
||||
$update_email = ($data['user_email'] != $user_row['user_email']) ? $data['user_email'] : false;
|
||||
|
||||
if (!sizeof($error))
|
||||
{
|
||||
$sql_ary = array(
|
||||
'username' => $data['username'],
|
||||
'user_email' => $data['user_email'],
|
||||
'user_email_hash' => crc32(strtolower($data['user_email'])) . strlen($data['user_email'])
|
||||
);
|
||||
|
||||
$sql_ary = array();
|
||||
|
||||
if ($user_row['user_type'] != USER_FOUNDER || $user->data['user_type'] == USER_FOUNDER)
|
||||
{
|
||||
if ($update_warning)
|
||||
@@ -639,6 +636,25 @@ class acp_users
|
||||
}
|
||||
}
|
||||
|
||||
if ($update_username !== false)
|
||||
{
|
||||
$sql_ary['username'] = $update_username;
|
||||
|
||||
add_log('admin', 'LOG_USER_UPDATE_NAME', $user_row['username'], $update_username);
|
||||
add_log('user', $user_id, 'LOG_USER_UPDATE_NAME', $user_row['username'], $update_username);
|
||||
}
|
||||
|
||||
if ($update_email !== false)
|
||||
{
|
||||
$sql_ary += array(
|
||||
'user_email' => $update_email,
|
||||
'user_email_hash' => crc32(strtolower($update_email)) . strlen($update_email)
|
||||
);
|
||||
|
||||
add_log('admin', 'LOG_USER_UPDATE_EMAIL', $user_row['username'], $user_row['user_email'], $update_email);
|
||||
add_log('user', $user_id, 'LOG_USER_UPDATE_EMAIL', $user_row['username'], $user_row['user_email'], $update_email);
|
||||
}
|
||||
|
||||
if ($update_password)
|
||||
{
|
||||
$sql_ary += array(
|
||||
@@ -647,6 +663,7 @@ class acp_users
|
||||
);
|
||||
|
||||
add_log('admin', 'LOG_USER_NEW_PASSWORD', $user_row['username']);
|
||||
add_log('user', $user_id, 'LOG_USER_NEW_PASSWORD', $user_row['username']);
|
||||
}
|
||||
|
||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||
@@ -664,9 +681,6 @@ class acp_users
|
||||
if ($update_username)
|
||||
{
|
||||
user_update_name($user_row['username'], $update_username);
|
||||
|
||||
add_log('admin', 'LOG_USER_UPDATE_NAME', $user_row['username'], $update_username);
|
||||
add_log('user', $user_id, 'LOG_USER_UPDATE_NAME', $user_row['username'], $update_username);
|
||||
}
|
||||
|
||||
add_log('admin', 'LOG_USER_USER_UPDATE', $data['username']);
|
||||
|
Reference in New Issue
Block a user