AutogeneratedPassword

From Request Tracker Wiki
Revision as of 16:03, 6 April 2016 by Admin (talk | contribs) (2 revisions imported)
Jump to navigation Jump to search

Solution for User Password + Viewing ticket status

The following template will send users an auto-generated random pronounceable password if inserted into an autoreply template. Users who have previously submitted tickets but not yet had a password assigned will have a password assigned and sent on submission of their first new ticket. (All previous tickets will still show up in the web ui) --JesseVincent

Add this line to the if statement if you do not want to auto generate a password for people that logon using ldap credentials from your domain. I had to do this because I am using RT::Authen::ExternalAuth.

($Ticket->RequestorAddresses !~ m/domain.com$/i) &&

Note: fixed variable case error below as described at http://gossamer-threads.com/lists/rt/users/26492?search_string=password;#26492

'

Subject: AutoReply: {$Ticket->Subject} Greetings, This message has been automatically generated in response to the creation of a helpdesk call: <code><pre> "{$Ticket-&gt;Subject()}", </pre></code> a summary of which appears below. There is no need to reply to this message right now. Your ticket has been assigned an ID of [{$rtname} #{$Ticket->id()}]. Please include this string in the subject line of all future correspondence about this issue. { *RT::User::GenerateRandomNextChar = \&RT::User::_GenerateRandomNextChar; if (($Transaction->CreatorObj->id != $RT::Nobody->id) && (!$Transaction->CreatorObj->Privileged) && ($Transaction->CreatorObj->__Value('Password') eq '<em>NO-PASSWORD</em>') ) { <code><pre> my $user = RT::User-&gt;new($RT::SystemUser); $user-&gt;Load($Transaction-&gt;CreatorObj-&gt;Id); my ($stat, $pass) = $user-&gt;SetRandomPassword(); if (!$stat) { $OUT .= </pre></code> "An internal error has occurred. RT was not able to set a password for you. Please contact your local RT administrator for assistance."; <code><pre> } </pre></code> $OUT .= " You can check the current status and history of your requests at: <code><pre> ".$RT::WebURL." </pre></code> When prompted, enter the following username and password: <code><pre> Username: ".$user-&gt;Name." Password: ".$pass." </pre></code> "; } } <code><pre> Thank you. {$Ticket-&gt;QueueObj-&gt;CorrespondAddress()} </pre></code> <hr /> {$Transaction->Content()}

'