aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-03-22 17:38:46 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-03-22 17:38:46 +0000
commit654a35c653bd92409e0dbaee714cb0ee4e9d45ae (patch)
tree04e0ecf701004d0e988cc3a8604a473c0149f91a /phpBB/includes
parent1e2ed1bc9f8128d4d252c6761b50216d0b01998e (diff)
downloadforums-654a35c653bd92409e0dbaee714cb0ee4e9d45ae.tar
forums-654a35c653bd92409e0dbaee714cb0ee4e9d45ae.tar.gz
forums-654a35c653bd92409e0dbaee714cb0ee4e9d45ae.tar.bz2
forums-654a35c653bd92409e0dbaee714cb0ee4e9d45ae.tar.xz
forums-654a35c653bd92409e0dbaee714cb0ee4e9d45ae.zip
strange... must've been my editor not reloading between updates.
git-svn-id: file:///svn/phpbb/trunk@5700 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/functions_user.php35
1 files changed, 19 insertions, 16 deletions
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index c36a57c4d0..cd37808e36 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -95,7 +95,7 @@ function user_update_name($old_name, $new_name)
/**
* Remove User
*/
-function user_delete($mode, $user_id)
+function user_delete($mode, $user_id, $post_username = false)
{
global $config, $db, $user, $auth;
@@ -105,12 +105,12 @@ function user_delete($mode, $user_id)
{
case 'retain':
$sql = 'UPDATE ' . FORUMS_TABLE . '
- SET forum_last_poster_id = ' . ANONYMOUS . "
+ SET forum_last_poster_id = ' . ANONYMOUS . (($post_username !== false) ? ", forum_last_poster_name = '" . $db->sql_escape($post_username) . "'" : '') . "
WHERE forum_last_poster_id = $user_id";
$db->sql_query($sql);
$sql = 'UPDATE ' . POSTS_TABLE . '
- SET poster_id = ' . ANONYMOUS . "
+ SET poster_id = ' . ANONYMOUS . (($post_username !== false) ? ", post_username = '" . $db->sql_escape($post_username) . "'" : '') . "
WHERE poster_id = $user_id";
$db->sql_query($sql);
@@ -120,10 +120,10 @@ function user_delete($mode, $user_id)
$db->sql_query($sql);
$sql = 'UPDATE ' . TOPICS_TABLE . '
- SET topic_last_poster_id = ' . ANONYMOUS . "
+ SET topic_last_poster_id = ' . ANONYMOUS . (($post_username !== false) ? ", topic_last_poster_name = '" . $db->sql_escape($post_username) . "'" : '') . "
WHERE topic_last_poster_id = $user_id";
$db->sql_query($sql);
- break;
+ break;
case 'remove':
@@ -213,7 +213,7 @@ function user_delete($mode, $user_id)
* Flips user_type from active to inactive and vice versa, handles
* group membership updates
*/
-function user_active_flip($user_id, $user_type, $user_actkey = false, $username = false)
+function user_active_flip($user_id, $user_type, $user_actkey = false, $username = false, $no_log = false)
{
global $db, $user, $auth;
@@ -274,18 +274,21 @@ function user_active_flip($user_id, $user_type, $user_actkey = false, $username
$auth->acl_clear_prefetch($user_id);
- if ($username === false)
+ if (!$no_log)
{
- $sql = 'SELECT username
- FROM ' . USERS_TABLE . "
- WHERE user_id = $user_id";
- $result = $db->sql_query($sql);
- $username = (string) $db->sql_fetchfield('username');
- $db->sql_freeresult($result);
- }
+ if ($username === false)
+ {
+ $sql = 'SELECT username
+ FROM ' . USERS_TABLE . "
+ WHERE user_id = $user_id";
+ $result = $db->sql_query($sql);
+ $username = (string) $db->sql_fetchfield('username');
+ $db->sql_freeresult($result);
+ }
- $log = ($user_type == USER_NORMAL) ? 'LOG_USER_INACTIVE' : 'LOG_USER_ACTIVE';
- add_log('admin', $log, $username);
+ $log = ($user_type == USER_NORMAL) ? 'LOG_USER_INACTIVE' : 'LOG_USER_ACTIVE';
+ add_log('admin', $log, $username);
+ }
return false;
}