aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-03-12 21:43:07 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-03-12 21:43:07 +0000
commit15b2933fd9867d15bd81b3fd86487837d9e3c6fe (patch)
treed50465f431f645d34dc19393e4467d18eb146311 /phpBB/includes
parent1b689a884d091c5750ac4bb1c4d82d28bbc0c1ae (diff)
downloadforums-15b2933fd9867d15bd81b3fd86487837d9e3c6fe.tar
forums-15b2933fd9867d15bd81b3fd86487837d9e3c6fe.tar.gz
forums-15b2933fd9867d15bd81b3fd86487837d9e3c6fe.tar.bz2
forums-15b2933fd9867d15bd81b3fd86487837d9e3c6fe.tar.xz
forums-15b2933fd9867d15bd81b3fd86487837d9e3c6fe.zip
remove user with empty username_clean...
git-svn-id: file:///svn/phpbb/trunk@7180 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/functions_convert.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php
index 294390af69..88ea955a42 100644
--- a/phpBB/includes/functions_convert.php
+++ b/phpBB/includes/functions_convert.php
@@ -2002,6 +2002,32 @@ function fix_empty_primary_groups()
$db->sql_freeresult($result);
}
+/**
+* Cleanly remove invalid user entries after converting the users table...
+*/
+function remove_invalid_users()
+{
+ global $convert, $db;
+
+ // username_clean is UNIQUE
+ $sql = 'SELECT user_id
+ FROM ' . USERS_TABLE . "
+ WHERE username_clean = ''";
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ if ($row)
+ {
+ if (!function_exists('user_delete'))
+ {
+ include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ }
+
+ user_delete('remove', $row['user_id']);
+ }
+}
+
function convert_bbcode($message, $convert_size = true, $extended_bbcodes = false)
{
static $orig, $repl, $origx, $replx, $str_from, $str_to;