A problem about adding users!

317 views
Skip to first unread message

Leon Fu

unread,
Mar 7, 2008, 1:13:23 AM3/7/08
to support-...@lists.mozilla.org
Mr or Ms,
I have a problem about adding users into bugzilla.

I just want to add a common user by SQL command not by the web
interface.
The command is :
insert into
profiles(login_name,cryptpassword,realname,disabledtext,refreshed_when)values('us...@sohu.com','NbSAivcMGLViQ','myname','null','2008-03-07 13:28:35')
then I got a userid '210' . Then I added the mail address into the cc
list, but us...@sohu.com could not recieve any mails.Then I found I could
not login the bugzilla by us...@sohu.com. That meant the user was not be
added successfully.

I have no idea with this problem .Could you help me ? Thank you very
much.


Leon Fu

Tosh, Michael J

unread,
Mar 7, 2008, 11:43:02 AM3/7/08
to Leon Fu, support-...@lists.mozilla.org
> I just want to add a common user by SQL command not by the
> web interface.
If you need to create a user via a command line, I would recommend using
the perlmodules within bugzilla. This will encrypt the password and
turn on email prefs based on the defaults.

$ perl -w
use Bugzilla;
use Bugzilla::User;
my $user = Bugzilla::User->create({
login_name => 'us...@sohu.com',
realname => 'myname',
cryptpassword => 'unencryptedpassword',
disable_mail => 0});

print "Account for " . $user->login_name . " was created.\n";


> values(...,'null',...)
Oh, and you shouldn't quote 'null'. it should be NULL without quotes.
If you look at the value in the database, I suspect you'll find it has
'null' as a string instead of a NULL value. That would prevent the user
from logging in.

Tosh

Reply all
Reply to author
Forward
0 new messages