diff options
| author | ivan <ivan> | 2010-05-18 18:49:59 +0000 |
|---|---|---|
| committer | ivan <ivan> | 2010-05-18 18:49:59 +0000 |
| commit | e70abd21bab68b23488f7ef1ee2e693a3b365691 (patch) | |
| tree | 75986ffa9ba6ab4f961f9033468a1344e1653408 /rt/share/html/SelfService | |
| parent | b4b0c7e72d7eaee2fbfc7022022c9698323203dd (diff) | |
import rt 3.8.8
Diffstat (limited to 'rt/share/html/SelfService')
| -rwxr-xr-x | rt/share/html/SelfService/Error.html | 2 | ||||
| -rwxr-xr-x | rt/share/html/SelfService/Prefs.html | 34 |
2 files changed, 20 insertions, 16 deletions
diff --git a/rt/share/html/SelfService/Error.html b/rt/share/html/SelfService/Error.html index 9c81ebbe6..8956c3ea1 100755 --- a/rt/share/html/SelfService/Error.html +++ b/rt/share/html/SelfService/Error.html @@ -66,6 +66,6 @@ $Why => loc("the calling component did not specify why") </%args> <%INIT> -$Details ||= "No details"; +$Details ||= loc("No details"); $RT::Logger->error("WebRT: $Why ($Details)"); </%INIT> diff --git a/rt/share/html/SelfService/Prefs.html b/rt/share/html/SelfService/Prefs.html index dabab7937..468a3d508 100755 --- a/rt/share/html/SelfService/Prefs.html +++ b/rt/share/html/SelfService/Prefs.html @@ -50,13 +50,14 @@ <& /Elements/ListActions, actions => \@results &> <form method="post"> -% unless (RT->Config->Get('WebExternalAuth') and !RT->Config->Get('WebFallbackToInternalAuth')) { <&| /Widgets/TitleBox, title => loc('Change password') &> -<&|/l&>New password</&>: <input type="password" name="NewPass1" size="16" autocomplete="off" /> -<&|/l&>Confirm</&>: <input type="password" name="NewPass2" size="16" autocomplete="off" /> +<& /Elements/EditPassword, + User => $user, + Name => [qw(CurrentPass NewPass1 NewPass2)], +&> </&> + <br /> -% } <& /Elements/Submit, Label => loc('Save Changes') &> </form> @@ -64,29 +65,32 @@ <%INIT> my @results; -if ($NewPass1) { - if ($NewPass1 ne $NewPass2) { - push (@results, "Passwords did not match."); - } - else { - my ($val, $msg)=$session{'CurrentUser'}->UserObj->SetPassword($NewPass1); - push (@results, "Password: ".$msg); - } +my $user = $session{'CurrentUser'}->UserObj; + +if (defined $NewPass1 && length $NewPass1 ) { + my ($status, $msg) = $user->SafeSetPassword( + Current => $CurrentPass, + New => $NewPass1, + Confirmation => $NewPass2, + ); + push @results, loc("Password: [_1]", $msg); } + if ($Signature) { $Signature =~ s/(\r\n|\r)/\n/g; - if ($Signature ne $session{'CurrentUser'}->UserObj->Signature) { - my ($val, $msg)=$session{'CurrentUser'}->UserObj->SetSignature($Signature); + if ($Signature ne $user->Signature) { + my ($val, $msg) = $user->SetSignature($Signature); push (@results, "Signature: ".$msg); } } -#A hack to make sure that session gets rewritten. +#A hack to make sure that session gets rewritten. $session{'i'}++; </%INIT> <%ARGS> $Signature => undef +$CurrentPass => undef $NewPass1 => undef $NewPass2 => undef </%ARGS> |
