From e7d2f292f2102be5b2de16ea501a12efde6b08de Mon Sep 17 00:00:00 2001 From: "timeless%mozdev.org" <> Date: Sun, 14 Mar 2004 14:30:35 +0000 Subject: Bug 214457 Updated user page is useless r=justdave a=justdave --- editusers.cgi | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) (limited to 'editusers.cgi') diff --git a/editusers.cgi b/editusers.cgi index 9adc36922..e1a6940ce 100755 --- a/editusers.cgi +++ b/editusers.cgi @@ -264,7 +264,7 @@ if (!$editall) { # my $user = trim($::FORM{user} || ''); my $action = trim($::FORM{action} || ''); -my $localtrailer = "edit more users"; +my $localtrailer = 'edit more users'; my $candelete = Param('allowuserdeletion'); @@ -368,7 +368,7 @@ if ($action eq 'list') { my $span = $candelete ? 3 : 2; print qq{ - Add a new user + add a new user }; print ""; @@ -508,7 +508,7 @@ if ($action eq 'new') { # if ($action eq 'del') { - PutHeader("Delete user"); + PutHeader("Delete user $user"); if (!$candelete) { print "Sorry, deleting users isn't allowed."; PutTrailer(); @@ -679,7 +679,7 @@ if ($action eq 'delete') { # if ($action eq 'edit') { - PutHeader("Edit user"); + PutHeader("Edit user $user"); CheckUser($user); # get data of user @@ -715,6 +715,13 @@ if ($action eq 'edit') {
"; print ""; + if ($candelete) { + print "
\n"; + print "\n"; + print "\n"; + print "\n"; + print "
"; + } my $x = $localtrailer; $x =~ s/more/other/; @@ -727,14 +734,15 @@ if ($action eq 'edit') { # if ($action eq 'update') { - PutHeader("Updated user"); - my $userold = trim($::FORM{userold} || ''); my $realname = trim($::FORM{realname} || ''); my $realnameold = trim($::FORM{realnameold} || ''); my $password = $::FORM{password} || ''; my $disabledtext = trim($::FORM{disabledtext} || ''); my $disabledtextold = trim($::FORM{disabledtextold} || ''); + my @localtrailers = ($localtrailer); + $localtrailer = qq|edit user again|; + PutHeader("Updating user $userold" . ($realnameold && " ($realnameold)")); CheckUser($userold); SendSQL("SELECT userid FROM profiles @@ -822,7 +830,7 @@ if ($action eq 'update') { SendSQL("UPDATE profiles SET realname=" . SqlQuote($realname) . " WHERE login_name=" . SqlQuote($userold)); - print "Updated real name.
\n"; + print 'Updated real name to ' . html_quote($realname) . ".
\n"; } if ($editall && $disabledtext ne $disabledtextold) { SendSQL("UPDATE profiles @@ -838,11 +846,17 @@ if ($action eq 'update') { if ($editall && $user ne $userold) { unless ($user) { print "Sorry, I can't delete the user's name."; - PutTrailer($localtrailer); + $userold = value_quote($userold); + $localtrailer =~ s/XXX/$userold/; + push @localtrailers, $localtrailer; + PutTrailer(@localtrailers); exit; } if (TestUser($user)) { print "Sorry, user name '$user' is already in use."; + $userold = value_quote($userold); + $localtrailer =~ s/XXX/$userold/; + push @localtrailers, $localtrailer; PutTrailer($localtrailer); exit; } @@ -851,12 +865,16 @@ if ($action eq 'update') { SET login_name=" . SqlQuote($user) . " WHERE login_name=" . SqlQuote($userold)); - print "Updated user's name.
\n"; + print q|Updated user's name to ' . html_quote($user) . ".
\n"; } my $changeduser = new Bugzilla::User($thisuserid); $changeduser->derive_groups(); - PutTrailer($localtrailer); + $user = value_quote($user); + $localtrailer =~ s/XXX/$user/; + push @localtrailers, $localtrailer; + PutTrailer(@localtrailers); exit; } -- cgit v1.2.3-24-g4f1b