[freeside-commits] freeside/rt/share/html/Admin/Users Modify.html, 1.2, 1.3

Ivan,,, ivan at wavetail.420.am
Tue May 18 12:20:30 PDT 2010


Update of /home/cvs/cvsroot/freeside/rt/share/html/Admin/Users
In directory wavetail.420.am:/tmp/cvs-serv2904/share/html/Admin/Users

Modified Files:
	Modify.html 
Log Message:
merging rt \3.8.8 to HEAD

Index: Modify.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/rt/share/html/Admin/Users/Modify.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -d -r1.2 -r1.3
--- Modify.html	3 Jan 2010 08:04:33 -0000	1.2
+++ Modify.html	18 May 2010 19:20:28 -0000	1.3
@@ -120,25 +120,10 @@
 <input type="hidden" class="hidden" name="SetPrivileged" value="1" />
 <input type="checkbox" class="checkbox" name="Privileged" value="1" <%$PrivilegedChecked||''%> /> <&|/l&>Let this user be granted rights</&><br />
 		    
-% unless (RT->Config->Get('WebExternalAuth') and !RT->Config->Get('WebFallbackToInternalAuth')) {
-<table>
-<tr>
-<td align="right">
-<&|/l&>New Password</&>:
-</td>
-<td align="left">
-<input type="password" name="Pass1" autocomplete="off" />
-</td>
-</tr>
-<tr><td align="right">
-<&|/l&>Retype Password</&>:
-</td>
-<td>
-<input type="password" name="Pass2" autocomplete="off" />
-</td>
-</tr>
-</table>
-% }
+<& /Elements/EditPassword,
+    User => $UserObj,
+    Name => [qw(CurrentPass Pass1 Pass2)],
+&>
 </&>
 % $m->callback( %ARGS, CallbackName => 'LeftColumnBottom', UserObj => $UserObj );
 </td>
@@ -372,20 +357,18 @@
     # }}}
 }
 
+
+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;
-    }
-    if ($id eq 'new' and $password_not_set) {
+    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.");
     } 
 }
@@ -439,6 +422,7 @@
 $State  => undef
 $Zip  => undef
 $Country => undef
+$CurrentPass => undef
 $Pass1 => undef
 $Pass2=> undef
 $Create=> undef



More information about the freeside-commits mailing list