Some error-checking so that you can't rename to an existing user using
the commandline rename command. (Renaming through the web interface still
allows renaming to an existing user.)
Patch by kareila.
diffs (15 lines):
diff -r 677ac59981c5 -r 7f28d1bf7c09 bin/renameuser.pl
--- a/bin/renameuser.pl Tue Sep 07 11:08:22 2010 +0800
+++ b/bin/renameuser.pl Tue Sep 07 11:19:36 2010 +0800
@@ -137,6 +137,11 @@ sub rename_user
return 0;
}
+ if ( LJ::load_user( $to, 'force' ) ) {
+ $error = "User already exists: $to";
+ return 0;
+ }
+
foreach my $table (qw(user useridmap))
{
$dbh->do("UPDATE $table SET user=$qto WHERE user=$qfrom");
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog