← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20979: Users. Hiding password fields for external auth users in account screen.

 

------------------------------------------------------------
revno: 20979
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2015-11-08 17:58:48 +0100
message:
  Users. Hiding password fields for external auth users in account screen.
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/useraccount/updateUserAccountForm.vm
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/useraccount/action/UpdateUserAccountAction.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/useraccount/updateUserAccountForm.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/useraccount/updateUserAccountForm.vm	2013-04-30 07:32:39 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/useraccount/updateUserAccountForm.vm	2015-11-08 16:58:48 +0000
@@ -23,6 +23,7 @@
         <td><label for="surname">$i18n.getString( "last_name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
         <td><input type="text" id="surname" name="surname" value="$!encoder.htmlEncode( $!userCredentials.user.surname )"></td>
     </tr>
+    #if( !$userCredentials.externalAuth )
 	<tr>
 		<td><label for="rawPassword">$i18n.getString( "old_password" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
 		<td><input type="password" id="oldPassword" name="oldPassword"></td>
@@ -31,6 +32,7 @@
 		<td><label for="rawPassword">$i18n.getString( "new_password" )</label></td>
 		<td><input type="password" id="rawPassword" name="rawPassword"></td>
 	</tr>
+	#end
 	<tr>
 		<td><label for="retypePassword">$i18n.getString( "retype_new_password" )</label></td>
 		<td><input type="password" id="retypePassword" name="retypePassword"></td>

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/useraccount/action/UpdateUserAccountAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/useraccount/action/UpdateUserAccountAction.java	2015-08-25 13:54:00 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/useraccount/action/UpdateUserAccountAction.java	2015-11-08 16:58:48 +0000
@@ -163,12 +163,9 @@
         user.setFirstName( firstName );
         user.setEmail( email );
         user.setPhoneNumber( phoneNumber );
-
-        if ( rawPassword != null )
-        {
-            userService.encodeAndSetPassword( user, rawPassword );
-        }
-
+        
+        userService.encodeAndSetPassword( user, rawPassword );
+        
         userService.updateUserCredentials( user.getUserCredentials() );
         userService.updateUser( user );