X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FUser%2FPrefs.html;h=884cf85e4060081cd3d6ef617d5cb092507ef22c;hb=e70abd21bab68b23488f7ef1ee2e693a3b365691;hp=f52fdcbdf9da6f4a18254a7553539d8a4bc9afa7;hpb=b4b0c7e72d7eaee2fbfc7022022c9698323203dd;p=freeside.git
diff --git a/rt/share/html/User/Prefs.html b/rt/share/html/User/Prefs.html
index f52fdcbdf..884cf85e4 100755
--- a/rt/share/html/User/Prefs.html
+++ b/rt/share/html/User/Prefs.html
@@ -107,27 +107,13 @@
% $m->callback( %ARGS, UserObj => $UserObj, CallbackName => 'FormLeftColumn' );
-% unless (RT->Config->Get('WebExternalAuth') and !RT->Config->Get('WebFallbackToInternalAuth')) {
+
<&| /Widgets/TitleBox, title => loc('Password'), id => "user-prefs-password" &>
-
+<& /Elements/EditPassword,
+ User => $UserObj,
+ Name => [qw(CurrentPass Pass1 Pass2)],
+&>
&>
-% }
<&| /Widgets/TitleBox, title => loc('Location'), id => "user-prefs-location" &>
@@ -221,6 +207,7 @@ unless ( $UserObj->id ) {
if $Name;
Abort(loc("Couldn't load user"));
}
+$id = $UserObj->id;
my @results;
@@ -259,13 +246,14 @@ if ( $SetPrivileged and $Privileged != $UserObj->Privileged ) {
push @results, loc('Privileged status: [_1]', loc_fuzzy($msg));
}
-#TODO: make this report errors properly
-if ( defined $Pass1 and length $Pass1 and $Pass1 eq $Pass2 and !$UserObj->IsPassword($Pass1) ) {
- my ($code, $msg);
- ($code, $msg) = $UserObj->SetPassword($Pass1);
- push @results, loc('Password: [_1]', loc_fuzzy($msg));
-} elsif ( defined $Pass1 && length $Pass1 && $Pass1 ne $Pass2 ) {
- push @results, loc("Passwords do not match. Your password has not been changed");
+my %password_cond = $UserObj->CurrentUserRequireToSetPassword;
+if (defined $Pass1 && length $Pass1 ) {
+ my ($status, $msg) = $UserObj->SafeSetPassword(
+ Current => $CurrentPass,
+ New => $Pass1,
+ Confirmation => $Pass2,
+ );
+ push @results, loc("Password: [_1]", $msg);
}
if ( $ARGS{'ResetAuthToken'} ) {
@@ -308,7 +296,8 @@ $City => undef
$State => undef
$Zip => undef
$Country => undef
+$CurrentPass => undef
$Pass1 => undef
-$Pass2=> undef
+$Pass2 => undef
$Create=> undef
%ARGS>
|