Commit b1812f95 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 317489: Email preferences are not set for the new admin user - Patch by…

Bug 317489: Email preferences are not set for the new admin user - Patch by Frédéric Buclin <LpSolit@gmail.com> r=mkanat a=justdave
parent d3395fe6
...@@ -1442,7 +1442,10 @@ require Bugzilla::User::Setting; ...@@ -1442,7 +1442,10 @@ require Bugzilla::User::Setting;
import Bugzilla::User::Setting qw(add_setting); import Bugzilla::User::Setting qw(add_setting);
require Bugzilla::Util; require Bugzilla::Util;
import Bugzilla::Util qw(bz_crypt trim html_quote); import Bugzilla::Util qw(bz_crypt trim html_quote is_7bit_clean);
require Bugzilla::User;
import Bugzilla::User qw(insert_new_user);
# globals.pl clears the PATH, but File::Find uses Cwd::cwd() instead of # globals.pl clears the PATH, but File::Find uses Cwd::cwd() instead of
# Cwd::getcwd(), which we need to do because `pwd` isn't in the path - see # Cwd::getcwd(), which we need to do because `pwd` isn't in the path - see
...@@ -4407,10 +4410,6 @@ if ($sth->rows == 0) { ...@@ -4407,10 +4410,6 @@ if ($sth->rows == 0) {
} }
if ($admin_create) { if ($admin_create) {
require Bugzilla::Util;
import Bugzilla::Util 'is_7bit_clean';
while( $realname eq "" ) { while( $realname eq "" ) {
print "Enter the real name of the administrator: "; print "Enter the real name of the administrator: ";
$realname = $answer{'ADMIN_REALNAME'} $realname = $answer{'ADMIN_REALNAME'}
...@@ -4466,9 +4465,6 @@ if ($sth->rows == 0) { ...@@ -4466,9 +4465,6 @@ if ($sth->rows == 0) {
} }
} }
# Crypt the administrator's password
my $cryptedpassword = bz_crypt($pass1);
if ($^O !~ /MSWin32/i) { if ($^O !~ /MSWin32/i) {
system("stty","echo"); # re-enable input echoing system("stty","echo"); # re-enable input echoing
} }
...@@ -4478,12 +4474,7 @@ if ($sth->rows == 0) { ...@@ -4478,12 +4474,7 @@ if ($sth->rows == 0) {
$SIG{QUIT} = 'DEFAULT'; $SIG{QUIT} = 'DEFAULT';
$SIG{TERM} = 'DEFAULT'; $SIG{TERM} = 'DEFAULT';
$dbh->do( insert_new_user($login, $realname, $pass1);
q{INSERT INTO profiles (login_name, realname, cryptpassword,
disabledtext, refreshed_when)
VALUES (?, ?, ?, ?, ?)},
undef, $login, $realname, $cryptedpassword,
'', '1900-01-01 00:00:00');
} }
# Put the admin in each group if not already # Put the admin in each group if not already
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment