diff options
author | travis%sedsystems.ca <> | 2005-02-01 05:04:11 +0000 |
---|---|---|
committer | travis%sedsystems.ca <> | 2005-02-01 05:04:11 +0000 |
commit | b7e1208d8c64cdb3a86733052f349eb6228ee1b0 (patch) | |
tree | 4404f1450c8be5f3ee017f96f644a7b386ed5229 /globals.pl | |
parent | 955aba6821f199ad5d0850fe2065490a40d53007 (diff) | |
download | bugs-b7e1208d8c64cdb3a86733052f349eb6228ee1b0.tar bugs-b7e1208d8c64cdb3a86733052f349eb6228ee1b0.tar.gz bugs-b7e1208d8c64cdb3a86733052f349eb6228ee1b0.tar.bz2 bugs-b7e1208d8c64cdb3a86733052f349eb6228ee1b0.tar.xz bugs-b7e1208d8c64cdb3a86733052f349eb6228ee1b0.zip |
Bug 280124 : Move InsertNewUser to Bugzilla::User
Patch by Max Kanat-Alexander <mkanat@kerio.com> r=vladd a=justdave
Diffstat (limited to 'globals.pl')
-rw-r--r-- | globals.pl | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/globals.pl b/globals.pl index 0badac43e..c97467b36 100644 --- a/globals.pl +++ b/globals.pl @@ -410,30 +410,6 @@ sub ValidateNewUser { return 1; } -sub InsertNewUser { - my ($username, $realname) = (@_); - - # Generate a new random password for the user. - my $password = GenerateRandomPassword(); - my $cryptpassword = bz_crypt($password); - - - my $defaultflagstring = SqlQuote(Bugzilla::Constants::DEFAULT_EMAIL_SETTINGS); - - # Insert the new user record into the database. - $username = SqlQuote($username); - $realname = SqlQuote($realname); - $cryptpassword = SqlQuote($cryptpassword); - PushGlobalSQLState(); - SendSQL("INSERT INTO profiles (login_name, realname, cryptpassword, emailflags) - VALUES ($username, $realname, $cryptpassword, $defaultflagstring)"); - PopGlobalSQLState(); - - # Return the password to the calling code so it can be included - # in an email sent to the user. - return $password; -} - sub GenerateRandomPassword { my $size = (shift or 10); # default to 10 chars if nothing specified return join("", map{ ('0'..'9','a'..'z','A'..'Z')[rand 62] } (1..$size)); |