[rt-users] Solution for User Password + Viewing ticket status

Jesse Vincent jesse at bestpractical.com
Thu Nov 7 22:33:04 EST 2002


The following template will send users an autogenerated random
pronouncable password based 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) 

Best,
	Jesse

=============== CUT HERE =====================

{
*RT::User::GenerateRandomNextChar = \&RT::User::_GenerateRandomNextChar;


if (($Transaction->CreatorObj->id != $RT::Nobody->id) &&
    (!$Transaction->CreatorObj->Privileged) &&
    ($Transaction->CreatorObj->__Value('Password') eq '*NO-PASSWORD*')
    ) {

        my $user = RT::User->new($RT::SystemUser);
        $user->Load($Transaction->CreatorObj->Id);
        my ($stat, $pass) = $user->SetRandomPassword();

        if (!$stat) {
                $OUT .=
"An internal error has occurred. RT was not able to set a password for you.
Please contact your local RT administrator for assistance.";

        }


$out .= "
You can check the current status and history of your requests at:

        ".$RT::WebURL."

When prompted, enter the following username and password:

        Username: ".$user->Name."
        Password: ".$pass."
";
}
}

================ CUT HERE ===================


-- 
»|« http://www.bestpractical.com/rt  -- Trouble Ticketing. Free.



More information about the rt-users mailing list