Typo in User::ResetPassword() in RT 3.2.1

While looking at
<URL:http://rt3.fsck.com/Ticket/Display.html?id=2934&user=guest&pass=guest?
trying to set up a scrip to generate and submit password to new users,
I discovered a typo in the ResetPassword() implemenation in
User_Overlay.pm for RT versjon 3.2.1.

Here is a patch to make sure the template loaded for non-privileged
users matches the name specified in the documentation, and to make
sure it is different from the one loaded for privileged users.

— lib/RT/User_Overlay.pm 2004-07-12 20:00:53.000000000 +0200
+++ /tmp/User_Overlay.pm 2004-08-26 15:10:19.000000000 +0200
@@ -742,7 +742,7 @@
$template->LoadGlobalTemplate(‘RT_PasswordChange_Privileged’);
}
else {

  •    $template->LoadGlobalTemplate('RT_PasswordChange_Privileged');
    
  •    $template->LoadGlobalTemplate('RT_PasswordChange_NonPrivileged');
    

    }

    unless ( $template->Id ) {

[Petter Reinholdtsen]

I discovered a typo in the ResetPassword() implemenation in
User_Overlay.pm for RT versjon 3.2.1.

It is worse. The ResetPassword() function references a missing class.
The call to RT::Action::SendPasswordEmail->new() fail, because there
is no such class in RT 3.2.1.

Did someone forget to include a file in the tarball?

[Jesse Vincent]

No, it’s an unused function. A stub for future functionality.
Patched appreciated.

OK. Which approach do you recommend? Implementing
RT::Action::SendPasswordEmail or rewriting ResetPassword to use
RT::Action::SendEmail directly? The last approach would be easiest.

As for my problem, I ended up using the original scrip in
<URL:http://rt3.fsck.com/Ticket/Display.html?
id=2934&user=guest&pass=guest>,
and modifying it slightly to add the missing CurrentUser argument. It
seem to work now.

Wait. you do know about the example template on the wiki which does
this for you, rihgt?

(BTW: Why did you take this discussion off the list? I would expect
it to be useful to see your replies for the rest of the readers of
the
list as well.)

Unintentional. Sorry.

[Jesse Vincent]

Wait. you do know about the example template on the wiki which does
this for you, rihgt?

Now I am. Thank you for the pointer. But I’m not quite happy with
either solution. I would prefer a solution which didn’t put the
generated password into the RT ticket history. I’m still
investigating how to do this.

Regarding ResetPassword(), I am still curios about your view on this: