dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #12664
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3947: Fixed bug related to user credentials in UpdateUserAction.
------------------------------------------------------------
revno: 3947
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2011-06-19 11:32:40 +0200
message:
Fixed bug related to user credentials in UpdateUserAction.
modified:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/GetUserListAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/UpdateUserAction.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-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/GetUserListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/GetUserListAction.java 2011-05-06 11:10:34 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/GetUserListAction.java 2011-06-19 09:32:40 +0000
@@ -122,9 +122,8 @@
Collections.sort( userCredentialsList, new UsernameComparator() );
User currentUser = userService.getUser( currentUserService.getCurrentUser().getId() );
- UserCredentials userCredentials = userService.getUserCredentials( currentUser );
- currentUserName = userCredentials.getUsername();
+ currentUserName = currentUser.getUserCredentials().getUsername();
return SUCCESS;
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/UpdateUserAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/UpdateUserAction.java 2011-06-11 08:15:29 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/UpdateUserAction.java 2011-06-19 09:32:40 +0000
@@ -181,20 +181,20 @@
UserCredentials userCredentials = userService.getUserCredentials( user );
- Set<UserAuthorityGroup> authorityGroups = userCredentials.getUserAuthorityGroups();
+ Set<UserAuthorityGroup> userAuthorityGroups = new HashSet<UserAuthorityGroup>();
- authorityGroups.clear();
-
for ( String id : selectedList )
{
UserAuthorityGroup group = userService.getUserAuthorityGroup( Integer.parseInt( id ) );
if ( currentUserCredentials != null && currentUserCredentials.canIssue( group ) )
{
- authorityGroups.add( group );
+ userAuthorityGroups.add( group );
}
}
+ userCredentials.setUserAuthorityGroups( userAuthorityGroups );
+
if ( rawPassword != null )
{
userCredentials.setPassword( passwordManager.encodePassword( userCredentials.getUsername(), rawPassword ) );