RT password stored in db

Can any one tell me how the password is stored in rt. (like the function) i need to write a script to copy users/pass from a different db we already have setup (where password is stored in plain text).
Thanks

-Karl Pietri
Northview Public Schools
616-365-6126

Karl Pietri wrote:

Can any one tell me how the password is stored in rt. (like the
function) i need to write a script to copy users/pass from a different
db we already have setup (where password is stored in plain text).
Thanks
http://wiki.bestpractical.com/cgi-bin/index.cgi?FAQ

Should have been a little more detailed. I have no
programing skill in perl so i am writing the password
converter in php.
-----from User_Overlay.pm-------
returns an MD5 hash of the password passed in, in
base64 encoding.

=cut

sub _GeneratePassword {
my $self = shift;
my $password = shift;

my $md5 = Digest::MD5->new();
$md5->add($password);
return ($md5->b64digest);

}

I have tryed various combinations of md5 and
base64_encode (and even decode) in php to try and match
it. Http://ww2.nvps.net/~karl/password.php so far none
have worked. Any ideas out there?

-Karl Pietri
(616) 365-6126
LAN Technician
Northview Public Schools
Grand Rapids, MI-----Original Message-----
From: “Karl Pietri” kpietri@nvps.net
To: rt-users@lists.bestpractical.com
Date: Mon, 2 Feb 2004 13:38:50 -0500
Subject: [rt-users] RT password stored in db

Can any one tell me how the password is stored in
rt. (like the function) i need to write a script to
copy users/pass from a different db we already have
setup (where password is stored in plain text).
Thanks

-Karl Pietri
Northview Public Schools
616-365-6126

Karl R Pietri wrote:

Should have been a little more detailed. I have no
programing skill in perl so i am writing the password
converter in php.
-----from User_Overlay.pm-------
returns an MD5 hash of the password passed in, in
base64 encoding.

=cut

sub _GeneratePassword {
my $self = shift;
my $password = shift;

my $md5 = Digest::MD5->new();
$md5->add($password);
return ($md5->b64digest);

}

I have tryed various combinations of md5 and
base64_encode (and even decode) in php to try and match
it. Http://ww2.nvps.net/~karl/password.php so far none
have worked. Any ideas out there?

I don’t know php at all but I think you should use
base64_encode(md5(‘password’))

Ok i have figured this out. Might want to add it to the wiki (not sure).
to generate the same password as rt in php you need to have php 5.0.0
(currently in beta) and use this code

substr(base64_encode(md5($pass,true)),0,-2) //the substr is to remove the ==
that for some reason is generated at the end of the string

Thanks for the help.

-Karl Pietri
(616) 365-6126
LAN Technician
Northview Public Schools
Grand Rapids, MI----- Original Message -----
From: “Ruslan U. Zakirov” cubic@acronis.ru
To: “Karl R Pietri” KPietri@nvps.net
Cc: rt-users@lists.bestpractical.com
Sent: Monday, February 02, 2004 2:17 PM
Subject: Re: [rt-users] RT password stored in db

Karl R Pietri wrote:

Should have been a little more detailed. I have no
programing skill in perl so i am writing the password
converter in php.
-----from User_Overlay.pm-------
returns an MD5 hash of the password passed in, in
base64 encoding.

=cut

sub _GeneratePassword {
my $self = shift;
my $password = shift;

my $md5 = Digest::MD5->new();
$md5->add($password);
return ($md5->b64digest);

}

I have tryed various combinations of md5 and
base64_encode (and even decode) in php to try and match
it. Http://ww2.nvps.net/~karl/password.php so far none
have worked. Any ideas out there?

I don’t know php at all but I think you should use
base64_encode(md5(‘password’))

-Karl Pietri
(616) 365-6126
LAN Technician
Northview Public Schools
Grand Rapids, MI

-----Original Message-----
From: “Karl Pietri” kpietri@nvps.net
To: rt-users@lists.bestpractical.com
Date: Mon, 2 Feb 2004 13:38:50 -0500
Subject: [rt-users] RT password stored in db

Can any one tell me how the password is stored in
rt. (like the function) i need to write a script to
copy users/pass from a different db we already have
setup (where password is stored in plain text).
Thanks

-Karl Pietri
Northview Public Schools
616-365-6126


rt-users mailing list
rt-users@lists.bestpractical.com
The rt-users Archives

Have you read the FAQ? The RT FAQ Manager lives at http://fsck.com/rtfm


rt-users mailing list
rt-users@lists.bestpractical.com
The rt-users Archives

Have you read the FAQ? The RT FAQ Manager lives at http://fsck.com/rtfm

Karl Pietri wrote:

Can any one tell me how the password is stored in rt. (like the function) i need to write a script to copy users/pass from a different db we already have setup (where password is stored in plain text).
Thanks

This is what you should do in your script

my $new_user = new RT::User($CurrentUser);
$new_user->Load($user_name);
$new_user->SetPassword($pass);

You can read more by running this as non-root user

perldoc /opt/rt3/lib/RT/User.pm

Plus read the archive to get more info posted by seph on rt-users
mailing list

-Karl Pietri
Northview Public Schools
616-365-6126


rt-users mailing list
rt-users@lists.bestpractical.com
The rt-users Archives

Have you read the FAQ? The RT FAQ Manager lives at http://fsck.com/rtfm

Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
There’s no place like 127.0.0.1