
additional to previous email The 'lost your password' functionality is on the customer login but only works with existing customers. Would it be possible to remove the customer choose password and have the system create the new account then post the password to the customers email address? Philippa

Hi Philippa, On Thu, Mar 13, 2003 at 09:02:26AM -0000, Strange, PJ (Philippa) wrote:
additional to previous email
The 'lost your password' functionality is on the customer login but only works with existing customers.
Would it be possible to remove the customer choose password and have the system create the new account then post the password to the customers email address?
A cool idea. It's also a check if the used email address of the requestor is valid. I added it to the CVS. Thanks!
Philippa
Martin -- Martin Edenhofer - <martin at edenhofer.de> - http://martin.edenhofer.de/ -- "The number of Unix installations has grown to 10, with more expected." The Unix Programmer's Manual, 2nd Edition, June 1972

On Thu, 13 Mar 2003, Strange, PJ (Philippa) wrote:
additional to previous email
The 'lost your password' functionality is on the customer login but only works with existing customers.
Would it be possible to remove the customer choose password and have the system create the new account then post the password to the customers email address?
First, many thanks for otrs, we just love it. It is a major improvement over the web form to mailing list mess we used to have. And now on to the content. Here's what I use to 'inject' customer usernames into the otrs, we wanted their customer id to be their email address, always and forever: When a person sends mail to otrs@, their email address gets added to the customer_user table. We then tell them to go to the customer interface and request a new password. I'm sure it wouldn't be too tough to change this around to create the password for them and mail it with Net:SMTP. In .procmailrc: # -- # Example for assigning the "email as customer ID" automaticaly. # -- :0hc CUSTOMERID=|formail -X "From:"|perl -e '$i=<STDIN>; $i=~s/\(.*?\)//; $i=~s/.+?([\w\-\&\.]+\@[\w\-\&\.]+)(.+?|)/$1/g; print $i' :0hc | /opt/otrs/bin/inject-otrs.pl $CUSTOMERID #--Begin perl-- #!/usr/bin/perl # inject-otrs.pl use DBI; use DBD::mysql; $databasehost = 'localhost'; $database = 'otrs'; $user = 'otrs'; $pw = 'notmypassword'; $dbh = DBI->connect("DBI:mysql:$database", $user, $pw); #If I already exist, don't add me: $exists = 0; $emailaddress = $ARGV[0]; $emailaddress =~ tr/A-Z/a-z/; ($username,$domain) = split('\@',$emailaddress); $statement = "select * from customer_user where login = '$username'"; #print "$statement\n"; $sth = $dbh->prepare($statement) or die "Can't prepare $statement: $dbh->errstr\n"; $rv = $sth->execute(); while(@row = $sth->fetchrow_array) { if ($row[0] ne '0') { $exists = 1; #print "$emailaddress already exists\n"; } } $sth->finish(); # I don't exist, add me if ($exists == 0) { print "$emailaddress does not exist, inserting\n"; $statement = "insert into customer_user (login, customer_id, email, valid_id, create_time, comment) values('$username','$emailaddress','$emailaddress','1', NOW(), 'New Customer Insert')"; print "$statement\n"; $sth = $dbh->prepare($statement) or die "Can't prepare $statement: $dbh->errstr\n"; $rv = $sth->execute(); $sth->finish; } $dbh->disconnect(); #----End Perl Not for the faint of heart, but it works for us. -- Corey Betka

Hi Corey,
I ike your perl script, but I have a small thing to change, but I don't
know what to change.
I received an email wher the from line was spliited in 2 lines, like:
From: =?iso-8859-1?Q?=22Hoedel=2C_Doedel=2C_HO=22?=
On Thu, 13 Mar 2003, Strange, PJ (Philippa) wrote:
additional to previous email
The 'lost your password' functionality is on the customer login but only works with existing customers.
Would it be possible to remove the customer choose password and have the system create the new account then post the password to the customers email address?
First, many thanks for otrs, we just love it. It is a major improvement over the web form to mailing list mess we used to have. And now on to the content.
Here's what I use to 'inject' customer usernames into the otrs, we wanted their customer id to be their email address, always and forever:
When a person sends mail to otrs@, their email address gets added to the customer_user table. We then tell them to go to the customer interface and request a new password. I'm sure it wouldn't be too tough to change this around to create the password for them and mail it with Net:SMTP.
In .procmailrc: # -- # Example for assigning the "email as customer ID" automaticaly. # -- :0hc CUSTOMERID=|formail -X "From:"|perl -e '$i=<STDIN>; $i=~s/\(.*?\)//; $i=~s/.+?([\w\-\&\.]+\@[\w\-\&\.]+)(.+?|)/$1/g; print $i'
:0hc | /opt/otrs/bin/inject-otrs.pl $CUSTOMERID
#--Begin perl-- #!/usr/bin/perl # inject-otrs.pl
use DBI; use DBD::mysql;
$databasehost = 'localhost'; $database = 'otrs'; $user = 'otrs'; $pw = 'notmypassword';
$dbh = DBI->connect("DBI:mysql:$database", $user, $pw);
#If I already exist, don't add me: $exists = 0; $emailaddress = $ARGV[0]; $emailaddress =~ tr/A-Z/a-z/; ($username,$domain) = split('\@',$emailaddress);
$statement = "select * from customer_user where login = '$username'"; #print "$statement\n"; $sth = $dbh->prepare($statement) or die "Can't prepare $statement: $dbh->errstr\n"; $rv = $sth->execute();
while(@row = $sth->fetchrow_array) { if ($row[0] ne '0') { $exists = 1; #print "$emailaddress already exists\n"; } }
$sth->finish();
# I don't exist, add me if ($exists == 0) { print "$emailaddress does not exist, inserting\n"; $statement = "insert into customer_user (login, customer_id, email, valid_id, create_time, comment) values('$username','$emailaddress','$emailaddress','1', NOW(), 'New Customer Insert')";
print "$statement\n"; $sth = $dbh->prepare($statement) or die "Can't prepare $statement: $dbh->errstr\n"; $rv = $sth->execute(); $sth->finish; }
$dbh->disconnect();
#----End Perl
Not for the faint of heart, but it works for us.
participants (4)
-
Christoph Kaulich
-
Corey Betka
-
Martin Edenhofer
-
Strange, PJ (Philippa)