From: terry%mozilla.org <> Date: Thu, 19 Aug 1999 07:06:00 +0000 (+0000) Subject: Patch by Chris Baldwin -- allow optional X-Git-Tag: bugzilla-2.6~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d971ce0a409d7d324c742cd54a0d67ca7132d55;p=thirdparty%2Fbugzilla.git Patch by Chris Baldwin -- allow optional entry of the user's realname. Note that nothing actually makes use of this info at present. --- diff --git a/CGI.pl b/CGI.pl index ad15503bf8..a0a64fdad9 100644 --- a/CGI.pl +++ b/CGI.pl @@ -385,7 +385,7 @@ sub confirm_login { if (defined $::FORM{"PleaseMailAPassword"}) { my $realpwd; if ($realcryptpwd eq "") { - $realpwd = InsertNewUser($enteredlogin); + $realpwd = InsertNewUser($enteredlogin, ""); } else { SendSQL("select password from profiles where login_name = " . SqlQuote($enteredlogin)); diff --git a/changepassword.cgi b/changepassword.cgi index da9429b8ab..66dff014bd 100755 --- a/changepassword.cgi +++ b/changepassword.cgi @@ -33,9 +33,11 @@ if (! defined $::FORM{'pwd1'}) { if (Param('useqacontact')) { $qacontactpart = ", the current QA Contact"; } - SendSQL("select emailnotification from profiles where login_name = " . - SqlQuote($::COOKIE{'Bugzilla_login'})); - my ($emailnotification) = (FetchSQLData()); + my $loginname = SqlQuote($::COOKIE{'Bugzilla_login'}); + SendSQL("select emailnotification,realname from profiles where login_name = " . + $loginname); + my ($emailnotification, $realname) = (FetchSQLData()); + $realname = value_quote($realname); print qq{

@@ -47,6 +49,11 @@ if (! defined $::FORM{'pwd1'}) { Re-enter your new password: + + +Your real name (optional): + +
@@ -122,6 +129,13 @@ Please click Back and try again.\n"; SendSQL("update profiles set emailnotification='$::FORM{'emailnotification'}' where login_name = " . SqlQuote($::COOKIE{'Bugzilla_login'})); +my $newrealname = $::FORM{'realname'}; + +if ($newrealname ne "") { + $newrealname = SqlQuote($newrealname); + SendSQL("update profiles set realname=$newrealname where login_name = " . + SqlQuote($::COOKIE{'Bugzilla_login'})); +} PutHeader("Preferences updated."); print " diff --git a/createaccount.cgi b/createaccount.cgi index 3d1fa4c58d..cc9bdd018e 100755 --- a/createaccount.cgi +++ b/createaccount.cgi @@ -44,6 +44,7 @@ Content-type: text/html PutHeader("Create a new bugzilla account"); my $login = $::FORM{'login'}; +my $realname = $::FORM{'realname'}; if (defined $login) { CheckEmailSyntax($login); if (DBname_to_id($login) != 0) { @@ -53,7 +54,7 @@ if (defined $login) { print "the E-mail me a password button.\n"; exit; } - my $password = InsertNewUser($login); + my $password = InsertNewUser($login, $realname); MailPassword($login, $password); print "A bugzilla account for $login has been created. The\n"; print "password has been e-mailed to that address. When it is\n"; @@ -66,7 +67,8 @@ if (defined $login) { print q{ To create a bugzilla account, all that you need to do is to enter a legitimate e-mail address. The account will be created, and its -password will be mailed to you. +password will be mailed to you. Optionally you may enter your real name +as well.
@@ -74,6 +76,10 @@ password will be mailed to you. + + + +
E-mail address:
Real name:
}; diff --git a/globals.pl b/globals.pl index b667f48adb..96ab4a0d26 100644 --- a/globals.pl +++ b/globals.pl @@ -353,7 +353,7 @@ sub GetVersionTable { sub InsertNewUser { - my ($username) = (@_); + my ($username, $realname) = (@_); my $password = ""; for (my $i=0 ; $i<8 ; $i++) { $password .= substr("abcdefghijklmnopqrstuvwxyz", int(rand(26)), 1); @@ -370,7 +370,9 @@ sub InsertNewUser { } } - SendSQL("insert into profiles (login_name, password, cryptpassword, groupset) values (@{[SqlQuote($username)]}, '$password', encrypt('$password'), $groupset)"); + $username = SqlQuote($username); + $realname = SqlQuote($realname); + SendSQL("insert into profiles (login_name, realname, password, cryptpassword, groupset) values ($username, $realname, '$password', encrypt('$password'), $groupset)"); return $password; } @@ -406,7 +408,7 @@ sub DBNameToIdAndCheck { return $result; } if ($forceok) { - InsertNewUser($name); + InsertNewUser($name, ""); $result = DBname_to_id($name); if ($result > 0) { return $result;