Configuration question

Hi:

I am trying to figure out how to do the following and any help will be greatly
appreciated.

When someone sends an email the first time to RT, his account is automatically
created with NO-PASSWORD in RT database. Instead of this, I like his account
be created with a RANDOM password and then the password be sent to the requestor
of the email automatically. I see there is a “ResetPassword” function in
’lib/RT/User_Overlay.pm’ but can’t seems to figure out how to get that working.

Also I read something about RT_ResetPassword Global template but can’t seems to
find that either.

Any help or tips?

Thanks in advance.

Hammad

When someone sends an email the first time to RT, his account is automatically
created with NO-PASSWORD in RT database. Instead of this, I like his account
be created with a RANDOM password and then the password be sent to the requestor
of the email automatically. I see there is a “ResetPassword” function in
’lib/RT/User_Overlay.pm’ but can’t seems to figure out how to get that working.

Here’s a slightly improved version of the scrip I posted a few days ago
that does this.

[How can this get into the FAQ or the contrib directory, since it
seems to come up pretty often…?]

The following scrip and template are running on RT 3.0.2 plus a couple
of my patches which I’m also appending below.

Scrip & Template to automatically set random password for a newly-created
unprivileged user (created by his/her first email message to a queue). The
scrip also emails the password to the new user so they can login.

NOTE: You MUST apply the source patches at the end of this page to
any version of RT before 3.0.4. (They will be included in 3.0.4)

This is just an example; of course the names of the scrip and template
can be different in your implementation.

  1. Add a global email template:

Name: “RT_PasswordChange”
---------------- Contents of template ----------------------------------

Greetings, {$Transaction->CreatorObj->Name()}

A login account has been created for you automatically
with your first request to this tracking system.
To use it, go to the following URL with your browser:

{$RT::WebURL}

To login, enter the username "{$Transaction->CreatorObj->Name()}"
and the password “{$Argument}”.

Please contact {$RT::OwnerEmail} if you have any problems or questions.

Enjoy,

– Your RT Administrator
---------------- End Contents of template ----------------------------------

  1. Add a new global scrip called “Create Password”, with the following
    settings:

Condition: "On Create"
Action: "User Defined"
Template: “RT_PasswordChange"
Set custom action condition and cleanup code to “1;”.
All of the action is in the “preparation” code, which is:
----------start code-------------
{
my ($user) = $self->TransactionObj->CreatorObj;
if (($user->id != $RT::Nobody->id) && (!$user->Privileged) &&
$user->__Value(‘Password’) eq ‘NO-PASSWORD’ && $user->Name =~ /@/) {
my ($stat, $pass) = $self->TransactionObj->CreatorObj->SetRandomPassword();
if ($stat) {
unless ($self->TemplateObj) {
$RT::Logger->crit( “$user tried to send “. $user->Name .
” a password reminder, but doesn’t have a template!”);
die “failed to find template”;
}
my $email = RT::Action::SendEmail->new(ScripObj => $self->ScripObj,
TemplateObj => $self->TemplateObj, TicketObj => $self->TicketObj,
TransactionObj => $self->TransactionObj, Argument => $pass);
@{ $email->{‘To’} } = ( $user->EmailAddress );
my ($ret) = $email->Prepare() && $email->Commit();
$RT::Logger->crit(“Set Password scrip: $user: SendEmail failed sending “.
$user->Name . " the password setting reminder.”) unless ($ret);
} else {
$RT::Logger->crit(“Set Password Scrip: Failed to set password for: “”.
$user->Name.””, pass=”.$pass);
}
}
1;
}
----------------end scrip prepare code-----------------

  1. Finally apply the following source patches to fix a couple of bugs
    that interfered with this working.

---------------- Begin source patch ----------------------------------
*** RT/User_Overlay.pm.orig Mon May 12 20:31:24 2003
— RT/User_Overlay.pm Wed Jun 18 02:16:33 2003
*** 871,877 ****

  my $length = $min_length + int( rand( $max_length - $min_length ) );

! my $char = $self->GenerateRandomNextChar( $total_sum, $start_freq );
my @word = ( $char + $a );
for ( 2 … $length ) {
$char =
— 871,877 ----

  my $length = $min_length + int( rand( $max_length - $min_length ) );

! my $char = $self->_GenerateRandomNextChar( $total_sum, $start_freq );
my @word = ( $char + $a );
for ( 2 … $length ) {
$char =
*** RT/Template_Overlay.pm.orig Mon May 12 20:31:24 2003
— RT/Template_Overlay.pm Wed Jun 18 02:21:51 2003
*** 203,212 ****
my $self = shift;
my %args = (
Queue => undef,
! Name => undef
);

! return ( $self->LoadByCols( Name => $args{‘Name’}, Queue => {‘Queue’} ) );

}

— 203,213 ----
my $self = shift;
my %args = (
Queue => undef,
! Name => undef,
! @_
);

! return ( $self->LoadByCols( Name => $args{‘Name’}, Queue => $args{‘Queue’} ) );

}

rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

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

Hi All:

Anyone have any idea to when Password Reminder function will be available. I
kinda need it and wondering if someone can provide any help or tips to implement
it OR if someone is already using it and like to share.

Plz email me. Thanks for the help

Hammad

Hello,

I’m trying to implment the password reminder as specified here:
http://wiki.bestpractical.com/index.cgi?PasswordReminder

I have a fresh install of Request Tracker 3.4.4 from testing on Debian.

Nothing else has been done other then setup the database and the RT_SiteConfig to use mysql and my site title.

I followed the instructions and this is the error I recieve when attemtping to use he Reminder link:

  error:  Can't locate object method "new" via package "RT::Action::SendPasswordEmail" (perhaps you forgot to load "RT::Action::SendPasswordEmail"?) at /usr/share/request-tracker3.4/lib/RT/User_Overlay.pm line 803.
 
  context:  ...   
        799:  . " a password reminder " 
        800:  . "but couldn't find a password change template" ); 
        801:  } 
        802:   
        803:  my $notification = RT::Action::SendPasswordEmail->new( 
        804:  TemplateObj => $template, 
        805:  Argument => $pass 
        806:  ); 
        807:   
        ...   
 
  code stack:  /usr/share/request-tracker3.4/lib/RT/User_Overlay.pm:803
  /usr/local/share/request-tracker3.4/html/NoAuth/Reminder.html:37
  /usr/share/request-tracker3.4/html/autohandler:85

Any help would be appreciated.

Thank-you
Frank

Did you include the line:

require RT::Action::SendPasswordEmailFrom: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Frank
Balonis
Sent: Thursday, January 26, 2006 10:13 AM
To: rt-users@lists.bestpractical.com
Subject: [rt-users] Password Reminder

Hello,

I’m trying to implment the password reminder as specified here:
http://wiki.bestpractical.com/index.cgi?PasswordReminder

I have a fresh install of Request Tracker 3.4.4 from testing on Debian.

Nothing else has been done other then setup the database and the
RT_SiteConfig to use mysql and my site title.

I followed the instructions and this is the error I recieve when
attemtping to use he Reminder link:

error: Can’t locate object method “new” via package
"RT::Action::SendPasswordEmail" (perhaps you forgot to load
"RT::Action::SendPasswordEmail"?) at
/usr/share/request-tracker3.4/lib/RT/User_Overlay.pm line 803.

context: …
799: . " a password reminder "
800: . “but couldn’t find a password change template” );
801: }
802:
803: my $notification = RT::Action::SendPasswordEmail->new(
804: TemplateObj => $template,
805: Argument => $pass
806: );
807:

code stack:
/usr/share/request-tracker3.4/lib/RT/User_Overlay.pm:803
/usr/local/share/request-tracker3.4/html/NoAuth/Reminder.html:37
/usr/share/request-tracker3.4/html/autohandler:85

Any help would be appreciated.

Thank-you
Frank

  • NOTE: This message is intended only for the use of the individual or entity to whom it is addressed and contains information that is privileged, confidential and exempt from disclosure. If the reader of this message is not the intended recipient or an employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify me immediately via reply e-mail and please delete this communication.

Hello,

I’m trying to implment the password reminder as specified here:
http://wiki.bestpractical.com/index.cgi?PasswordReminder

I have a fresh install of Request Tracker 3.4.4 from testing on Debian.

Nothing else has been done other then setup the database and the RT_SiteConfig to use mysql and my site title.

I followed the instructions and this is the error I recieve when attemtping to use he Reminder link:

  error:  Can't locate object method "new" via package "RT::Action::SendPasswordEmail" (perhaps you forgot to load "RT::Action::SendPasswordEmail"?) at /usr/share/request-tracker3.4/lib/RT/User_Overlay.pm line 803.
 
  context:  ...   
        799:  . " a password reminder " 
        800:  . "but couldn't find a password change template" ); 
        801:  } 
        802:   
        803:  my $notification = RT::Action::SendPasswordEmail->new( 
        804:  TemplateObj => $template, 
        805:  Argument => $pass 
        806:  ); 
        807:   
        ...   
 
  code stack:  /usr/share/request-tracker3.4/lib/RT/User_Overlay.pm:803
  /usr/local/share/request-tracker3.4/html/NoAuth/Reminder.html:37
  /usr/share/request-tracker3.4/html/autohandler:85

Any help would be appreciated.

You’re missing the ResetPassword overlay that I provided when I originally
came up with this modification. The one that comes with RT by default
is old and doesn’t work because RT::Action::SendPasswordEmail never
existed on 3.4 as far as I could tell.

Travis
Travis Campbell - Unix Systems Administrator = travis@mpdtxmail.amd.com
5900 E. Ben White Blvd, Austin, TX 78741 = travis.campbell@amd.com
TEL: (512) 602-1888 PAG: (512) 604-0341 = webmaster@mpdtxmail.amd.com
"Does anything work as expected?" Yes. An axe through the CPU.

I did include it but I found that I mistyped the User_Local.pm name when I
saved it. Once I fixed that it worked like a charm.

Thanks,
Frank----- Original Message -----
From: “Travis Campbell” travis.campbell@amd.com
To: “Frank Balonis” rt-user@balonis.com
Cc: rt-users@lists.bestpractical.com
Sent: Monday, January 30, 2006 2:44 PM
Subject: Re: [rt-users] Password Reminder

On Thu, Jan 26, 2006 at 12:12:47PM -0500, Frank Balonis wrote:

Hello,

I’m trying to implment the password reminder as specified here:
http://wiki.bestpractical.com/index.cgi?PasswordReminder

I have a fresh install of Request Tracker 3.4.4 from testing on Debian.

Nothing else has been done other then setup the database and the
RT_SiteConfig to use mysql and my site title.

I followed the instructions and this is the error I recieve when
attemtping to use he Reminder link:

  error:  Can't locate object method "new" via package 

“RT::Action::SendPasswordEmail” (perhaps you forgot to load
"RT::Action::SendPasswordEmail"?) at
/usr/share/request-tracker3.4/lib/RT/User_Overlay.pm line 803.

  context:  ...
        799:  . " a password reminder "
        800:  . "but couldn't find a password change template" );
        801:  }
        802:
        803:  my $notification = RT::Action::SendPasswordEmail->new(
        804:  TemplateObj => $template,
        805:  Argument => $pass
        806:  );
        807:
        ...

  code stack: 

/usr/share/request-tracker3.4/lib/RT/User_Overlay.pm:803
/usr/local/share/request-tracker3.4/html/NoAuth/Reminder.html:37
/usr/share/request-tracker3.4/html/autohandler:85

Any help would be appreciated.

You’re missing the ResetPassword overlay that I provided when I originally
came up with this modification. The one that comes with RT by default
is old and doesn’t work because RT::Action::SendPasswordEmail never
existed on 3.4 as far as I could tell.

Travis

Travis Campbell - Unix Systems Administrator =
travis@mpdtxmail.amd.com
5900 E. Ben White Blvd, Austin, TX 78741 =
travis.campbell@amd.com
TEL: (512) 602-1888 PAG: (512) 604-0341 =
webmaster@mpdtxmail.amd.com

 "Does anything work as expected?"  Yes.  An axe through the CPU.