From b102662c11390d9220ef7a935ce847f18ba221fb Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 18 May 2010 19:20:29 +0000 Subject: merging rt \3.8.8 to HEAD --- rt/share/html/Admin/Users/Modify.html | 52 ++++++++++++----------------------- 1 file changed, 18 insertions(+), 34 deletions(-) (limited to 'rt/share/html/Admin/Users/Modify.html') diff --git a/rt/share/html/Admin/Users/Modify.html b/rt/share/html/Admin/Users/Modify.html index be67f35db..70650a47d 100755 --- a/rt/share/html/Admin/Users/Modify.html +++ b/rt/share/html/Admin/Users/Modify.html @@ -119,26 +119,11 @@ /> <&|/l&>Let this user be granted rights
- -% unless (RT->Config->Get('WebExternalAuth') and !RT->Config->Get('WebFallbackToInternalAuth')) { - - - - - - - - -
-<&|/l&>New Password: - - -
-<&|/l&>Retype Password: - - -
-% } + +<& /Elements/EditPassword, + User => $UserObj, + Name => [qw(CurrentPass Pass1 Pass2)], +&> % $m->callback( %ARGS, CallbackName => 'LeftColumnBottom', UserObj => $UserObj ); @@ -372,22 +357,20 @@ if ($UserObj->Id && $id ne 'new') { # }}} } + +my %password_cond = $UserObj->CurrentUserRequireToSetPassword; if ( $UserObj->Id ) { - my $password_not_set; # Deal with Password field - if ( !$Pass1 and !$Pass2 ) { - $password_not_set = 1; - } elsif ( $Pass1 ne $Pass2 ) { - $password_not_set = 1; - push @results, loc("Passwords do not match."); - } elsif ( $Pass1 eq $Pass2 and !$UserObj->IsPassword($Pass1) ) { - my ($code, $msg) = $UserObj->SetPassword($Pass1); - push @results, loc_fuzzy($msg); - $password_not_set = 1 unless $code; + my ($status, $msg) = $UserObj->SafeSetPassword( + Current => $CurrentPass, + New => $Pass1, + Confirmation => $Pass2, + ); + push @results, $msg; + + if ( $id eq 'new' && !$status ) { + push @results, loc("A password was not set, so user won't be able to login."); } - if ($id eq 'new' and $password_not_set) { - push @results, loc("A password was not set, so user won't be able to login."); - } } @@ -439,8 +422,9 @@ $City => undef $State => undef $Zip => undef $Country => undef +$CurrentPass => undef $Pass1 => undef -$Pass2=> undef +$Pass2 => undef $Create=> undef $OnlySearchForCustomers => undef $OnlySearchForServices => undef -- cgit v1.2.1