From b7e1208d8c64cdb3a86733052f349eb6228ee1b0 Mon Sep 17 00:00:00 2001 From: "travis%sedsystems.ca" <> Date: Tue, 1 Feb 2005 05:04:11 +0000 Subject: Bug 280124 : Move InsertNewUser to Bugzilla::User Patch by Max Kanat-Alexander r=vladd a=justdave --- globals.pl | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'globals.pl') 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)); -- cgit v1.2.3-24-g4f1b