dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #40421
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20501: renamed UserCredentials.user => UserCredentials.userInfo (user will be used to tell who -created-...
------------------------------------------------------------
revno: 20501
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2015-10-05 14:55:19 +0700
message:
renamed UserCredentials.user => UserCredentials.userInfo (user will be used to tell who -created- the userCredentials instead)
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserAuthorityGroup.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserCredentials.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/security/DefaultSecurityService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/listener/UnregisteredSMSListener.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultCurrentUserService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.java
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/UserCredentials.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/security/SecurityServiceTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/user/UserSettingServiceTest.java
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultObjectBridge.java
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java
dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java
dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/mock/MockCurrentUserService.java
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AccountController.java
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DataApprovalController.java
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/user/UserController.java
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/useraccount/updateUserProfileForm.vm
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetUserAction.java
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/DatabaseAutomaticAccessProvider.java
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/useraccount/action/IsInviteTokenValidAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/AddUserAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/ValidateInviteAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/responseUsers.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateUserForm.vm
--
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-api/src/main/java/org/hisp/dhis/user/UserAuthorityGroup.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserAuthorityGroup.java 2015-09-09 20:18:52 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserAuthorityGroup.java 2015-10-05 07:55:19 +0000
@@ -186,9 +186,9 @@
for ( UserCredentials userCredentials : members )
{
- if ( userCredentials.getUser() != null )
+ if ( userCredentials.getUserInfo() != null )
{
- users.add( userCredentials.getUser() );
+ users.add( userCredentials.getUserInfo() );
}
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserCredentials.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserCredentials.java 2015-08-06 14:04:41 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserCredentials.java 2015-10-05 07:55:19 +0000
@@ -71,9 +71,8 @@
/**
* Required and unique.
- * TODO: This must be renamed before we start using idObjectStore for UserCredentials
*/
- //private User user;
+ private User userInfo;
/**
* Required and unique.
@@ -365,7 +364,7 @@
{
return username;
}
-
+
/**
* Sets the last login property to the current date.
*/
@@ -484,14 +483,18 @@
// Getters and setters
// -------------------------------------------------------------------------
- @Override
@JsonProperty
@JsonView( DetailedView.class )
@JsonSerialize( as = BaseIdentifiableObject.class )
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
- public User getUser()
- {
- return super.getUser();
+ public User getUserInfo()
+ {
+ return userInfo;
+ }
+
+ public void setUserInfo( User userInfo )
+ {
+ this.userInfo = userInfo;
}
public String getPassword()
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/security/DefaultSecurityService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/security/DefaultSecurityService.java 2015-08-25 13:54:00 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/security/DefaultSecurityService.java 2015-10-05 07:55:19 +0000
@@ -163,13 +163,13 @@
return "email_not_configured_for_system";
}
- if ( credentials == null || credentials.getUser() == null )
+ if ( credentials == null || credentials.getUserInfo() == null )
{
log.warn( "Could not send restore/invite message as user is null: " + credentials );
return "no_user_credentials";
}
- if ( credentials.getUser().getEmail() == null || !ValidationUtils.emailIsValid( credentials.getUser().getEmail() ) )
+ if ( credentials.getUserInfo().getEmail() == null || !ValidationUtils.emailIsValid( credentials.getUserInfo().getEmail() ) )
{
log.warn( "Could not send restore/invite message as user has no email or email is invalid" );
return "user_does_not_have_valid_email";
@@ -227,7 +227,7 @@
String[] result = initRestore( credentials, restoreOptions );
Set<User> users = new HashSet<>();
- users.add( credentials.getUser() );
+ users.add( credentials.getUserInfo() );
Map<String, Object> vars = new HashMap<>();
vars.put( "applicationTitle", applicationTitle );
@@ -236,7 +236,7 @@
vars.put( "code", result[1] );
vars.put( "username", credentials.getUsername() );
- User user = credentials.getUser();
+ User user = credentials.getUserInfo();
Locale locale = (Locale) userSettingService.getUserSettingValue( user, UserSettingService.KEY_UI_LOCALE, LocaleManager.DHIS_STANDARD_LOCALE );
I18n i18n = i18nManager.getI18n( locale );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/listener/UnregisteredSMSListener.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/listener/UnregisteredSMSListener.java 2015-06-23 15:59:19 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/listener/UnregisteredSMSListener.java 2015-10-05 07:55:19 +0000
@@ -141,7 +141,7 @@
UserCredentials usercredential = new UserCredentials();
usercredential.setUsername( USER_NAME );
usercredential.setPassword( USER_NAME );
- usercredential.setUser( user );
+ usercredential.setUserInfo( user );
user.setSurname( USER_NAME );
user.setFirstName( USER_NAME );
user.setUserCredentials( usercredential );
@@ -152,7 +152,7 @@
}
// forward to user group by SMS, E-mail, DHIS conversation
- messageService.sendMessage( smsCommand.getName(), message, null, receivers, anonymousUser.getUser(),
+ messageService.sendMessage( smsCommand.getName(), message, null, receivers, anonymousUser.getUserInfo(),
false, false );
// confirm SMS was received and forwarded completely
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultCurrentUserService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultCurrentUserService.java 2015-09-03 03:11:47 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultCurrentUserService.java 2015-10-05 07:55:19 +0000
@@ -96,7 +96,7 @@
return null;
}
- return userCredentials.getUser();
+ return userCredentials.getUserInfo();
}
@Override
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.java 2015-09-23 07:46:33 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.java 2015-10-05 07:55:19 +0000
@@ -171,7 +171,7 @@
if ( credentials != null )
{
- save( name, value, credentials.getUser() );
+ save( name, value, credentials.getUserInfo() );
}
}
@@ -215,7 +215,7 @@
{
UserCredentials credentials = userService.getUserCredentialsByUsername( username );
- return getUserSetting( name, credentials == null ? null : credentials.getUser() );
+ return getUserSetting( name, credentials == null ? null : credentials.getUserInfo() );
}
private Serializable getUserSetting( String name, User currentUser )
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/UserCredentials.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/UserCredentials.hbm.xml 2014-12-30 13:02:09 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/UserCredentials.hbm.xml 2015-10-05 07:55:19 +0000
@@ -10,11 +10,11 @@
<id name="id" column="userid">
<generator class="foreign">
- <param name="property">user</param>
+ <param name="property">userInfo</param>
</generator>
</id>
- <one-to-one name="user" class="org.hisp.dhis.user.User" constrained="true" foreign-key="fk_user_userinfoid" />
+ <one-to-one name="userInfo" class="org.hisp.dhis.user.User" constrained="true" foreign-key="fk_user_userinfoid" />
<property name="username" column="username" not-null="true" unique="true" />
@@ -54,7 +54,7 @@
<property name="restoreExpiry" type="timestamp" />
<property name="selfRegistered" />
-
+
<property name="invitation" />
<property name="disabled" />
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/security/SecurityServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/security/SecurityServiceTest.java 2015-03-18 18:51:30 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/security/SecurityServiceTest.java 2015-10-05 07:55:19 +0000
@@ -66,7 +66,7 @@
User userA = createUser( 'A' );
userA.setEmail( "validA@xxxxxxxxx" );
userA.setUserCredentials( credentials );
- credentials.setUser( userA );
+ credentials.setUserInfo( userA );
userService.addUserCredentials( credentials );
otherCredentials = new UserCredentials();
@@ -76,7 +76,7 @@
User userB = createUser( 'B' );
userB.setEmail( "validB@xxxxxxxxx" );
userB.setUserCredentials( otherCredentials );
- otherCredentials.setUser( userB );
+ otherCredentials.setUserInfo( userB );
userService.addUserCredentials( otherCredentials );
}
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/user/UserSettingServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/user/UserSettingServiceTest.java 2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/user/UserSettingServiceTest.java 2015-10-05 07:55:19 +0000
@@ -59,7 +59,7 @@
testUser = createUser( 'D' );
userService.addUser( testUser );
UserCredentials userCredentials = testUser.getUserCredentials();
- userCredentials.setUser( testUser );
+ userCredentials.setUserInfo( testUser );
userService.addUserCredentials( userCredentials );
}
@@ -67,7 +67,7 @@
public void testShouldGetUserSettings()
{
UserCredentials userCredentials = testUser.getUserCredentials();
- userCredentials.setUser( testUser );
+ userCredentials.setUserInfo( testUser );
userService.addUserCredentials( userCredentials );
userSettingService.saveUserSetting( "mykey", "value", "username" );
Serializable preference = userSettingService.getUserSetting( "mykey", "username" );
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultObjectBridge.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultObjectBridge.java 2015-09-24 05:44:40 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultObjectBridge.java 2015-10-05 07:55:19 +0000
@@ -469,9 +469,9 @@
User user = (User) object;
UserCredentials userCredentials = usernameMap.get( user.getUsername() );
- if ( userCredentials != null && userCredentials.getUser() != null )
+ if ( userCredentials != null && userCredentials.getUserInfo() != null )
{
- objects.add( (T) userCredentials.getUser() );
+ objects.add( (T) userCredentials.getUserInfo() );
}
}
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java 2015-09-24 05:44:40 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java 2015-10-05 07:55:19 +0000
@@ -339,7 +339,7 @@
if ( object instanceof User && !options.isDryRun() )
{
- userCredentials.setUser( (User) object );
+ userCredentials.setUserInfo( (User) object );
userCredentials.setId( object.getId() );
if ( userCredentials.getPassword() != null )
=== modified file 'dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java'
--- dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java 2015-09-17 08:13:56 +0000
+++ dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java 2015-10-05 07:55:19 +0000
@@ -1129,7 +1129,7 @@
credentials.setName( "UserCredentials" + uniqueCharacter );
credentials.setUsername( "Username" + uniqueCharacter );
credentials.setPassword( "Password" + uniqueCharacter );
- credentials.setUser( user );
+ credentials.setUserInfo( user );
user.setUserCredentials( credentials );
return credentials;
@@ -1636,7 +1636,7 @@
user.getUserCredentials().getUserAuthorityGroups().add( userAuthorityGroup );
userService.addUser( user );
- user.getUserCredentials().setUser( user );
+ user.getUserCredentials().setUserInfo( user );
userService.addUserCredentials( user.getUserCredentials() );
List<GrantedAuthority> authorities = new ArrayList<>();
=== modified file 'dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/mock/MockCurrentUserService.java'
--- dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/mock/MockCurrentUserService.java 2015-09-03 03:11:47 +0000
+++ dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/mock/MockCurrentUserService.java 2015-10-05 07:55:19 +0000
@@ -76,7 +76,7 @@
user.setOrganisationUnits( organisationUnits );
user.setDataViewOrganisationUnits( dataViewOrganisationUnits );
user.setUserCredentials( credentials );
- credentials.setUser( user );
+ credentials.setUserInfo( user );
this.currentUser = user;
}
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AccountController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AccountController.java 2015-09-14 17:57:00 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AccountController.java 2015-10-05 07:55:19 +0000
@@ -359,7 +359,7 @@
throw new WebMessageException( WebMessageUtils.badRequest( "Unable to create invited user account" ) );
}
- User user = credentials.getUser();
+ User user = credentials.getUserInfo();
user.setFirstName( firstName );
user.setSurname( surname );
user.setEmail( email );
@@ -399,7 +399,7 @@
credentials.setUsername( username );
userService.encodeAndSetPassword( credentials, password );
credentials.setSelfRegistered( true );
- credentials.setUser( user );
+ credentials.setUserInfo( user );
credentials.getUserAuthorityGroups().add( userRole );
user.setUserCredentials( credentials );
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DataApprovalController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DataApprovalController.java 2015-08-30 14:51:28 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DataApprovalController.java 2015-10-05 07:55:19 +0000
@@ -401,7 +401,7 @@
User user = dataApprovalStateRequest.getAb() == null ?
currentUserService.getCurrentUser() :
- userService.getUserCredentialsByUsername( dataApprovalStateRequest.getAb() ).getUser();
+ userService.getUserCredentialsByUsername( dataApprovalStateRequest.getAb() ).getUserInfo();
Date approvalDate = dataApprovalStateRequest.getAd() == null ? new Date() : dataApprovalStateRequest.getAd();
@@ -522,7 +522,7 @@
}
User user = dataApprovalStateRequest.getAb() == null ?
- currentUserService.getCurrentUser() : userService.getUserCredentialsByUsername( dataApprovalStateRequest.getAb() ).getUser();
+ currentUserService.getCurrentUser() : userService.getUserCredentialsByUsername( dataApprovalStateRequest.getAb() ).getUserInfo();
Date approvalDate = (dataApprovalStateRequest.getAd() == null) ? new Date() : dataApprovalStateRequest.getAd();
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/user/UserController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/user/UserController.java 2015-09-24 05:44:40 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/user/UserController.java 2015-10-05 07:55:19 +0000
@@ -342,7 +342,7 @@
userService.encodeAndSetPassword( credentialsReplica, password );
userReplica.setUserCredentials( credentialsReplica );
- credentialsReplica.setUser( userReplica );
+ credentialsReplica.setUserInfo( userReplica );
userService.addUser( userReplica );
userService.addUserCredentials( credentialsReplica );
@@ -512,7 +512,7 @@
throw new WebMessageException( WebMessageUtils.conflict( "User credentials is not present" ) );
}
- credentials.setUser( user );
+ credentials.setUserInfo( user );
List<UserAuthorityGroup> userRoles = userService.getUserRolesByUid( getUids( credentials.getUserAuthorityGroups() ) );
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/useraccount/updateUserProfileForm.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/useraccount/updateUserProfileForm.vm 2013-06-06 09:55:20 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/useraccount/updateUserProfileForm.vm 2015-10-05 07:55:19 +0000
@@ -1,66 +1,66 @@
<script type="text/javascript" src="../dhis-web-commons/javascripts/useraccount/updateUserProfileForm.js"></script>
-<div id="updateProfileHeader">$encoder.htmlEncode( $userCredentials.user.getName() )</div>
+<div id="updateProfileHeader">$encoder.htmlEncode( $userCredentials.userInfo.getName() )</div>
<div id="updateProfileLink"><a class="blueButtonLink" href="../dhis-web-dashboard-integration/profile.action?id=${currentUser.uid}">$i18n.getString( "view_profile" )</a></div>
<form id="updateUserProfileForm" name="updateUserProfileForm" class="inputForm">
-<div><input type="hidden" id="id" name="id" value="$userCredentials.id"/></div>
+ <div><input type="hidden" id="id" name="id" value="$userCredentials.id"/></div>
-<table>
- <tr>
- <th colspan="2">$i18n.getString( "profile_details" )</th>
- </tr>
- <tr>
- <td><label for="email">$i18n.getString( "email" )</label></td>
- <td><input type="text" id="email" name="email" value="$!encoder.htmlEncode( $userCredentials.user.email )"></td>
- </tr>
- <tr>
- <td><label for="phoneNumber">$i18n.getString( "phone_number" )</label></td>
- <td><input type="text" id="phoneNumber" name="phoneNumber" value="$!encoder.htmlEncode( $userCredentials.user.phoneNumber )"></td>
- </tr>
- <tr>
- <td><label for="introduction">$i18n.getString( "introduction" )</label></td>
- <td><textarea id="introduction" name="introduction">$!encoder.htmlEncode( $!userCredentials.user.introduction )</textarea></td>
- </tr>
- <tr>
- <td><label for="jobTitle">$i18n.getString( "job_title" )</label></td>
- <td><input type="text" id="jobTitle" name="jobTitle" value="$!encoder.htmlEncode( $userCredentials.user.jobTitle )"></td>
- </tr>
- <tr>
- <td><label for="gender">$i18n.getString( "gender" )</label></td>
- <td><select type="text" id="gender" name="gender">
- <option value="gender_male" #if( $!userCredentials.user.gender == "gender_male" ) selected="selected"#end>$i18n.getString( "male" )</option>
- <option value="gender_female" #if( $!userCredentials.user.gender == "gender_female" ) selected="selected"#end>$i18n.getString( "female" )</option>
- <option value="gender_other" #if( $!userCredentials.user.gender == "gender_other" ) selected="selected"#end>$i18n.getString( "other" )</option>
- </select></td>
- </tr>
- <tr>
- <td><label for="birthday">$i18n.getString( "birthday" )</label></td>
- <td><input type="text" id="birthday" name="birthday" value="$!format.formatDate( $!userCredentials.user.birthday )"></td>
- </tr>
- <tr>
- <td><label for="nationality">$i18n.getString( "nationality" )</label></td>
- <td><input type="text" id="nationality" name="nationality" value="$!encoder.htmlEncode( $!userCredentials.user.nationality )"></td>
- </tr>
- <tr>
- <td><label for="employer">$i18n.getString( "employer" )</label></td>
- <td><input type="text" id="employer" name="employer" value="$!encoder.htmlEncode( $!userCredentials.user.employer )"></td>
- </tr>
- <tr>
- <td><label for="education">$i18n.getString( "education" )</label></td>
- <td><textarea id="education" name="education">$!encoder.htmlEncode( $!userCredentials.user.education )</textarea></td>
- </tr>
- <tr>
- <td><label for="interests">$i18n.getString( "interests" )</label></td>
- <td><textarea id="interests" name="interests">$!encoder.htmlEncode( $!userCredentials.user.interests )</textarea></td>
- </tr>
- <tr>
- <td><label for="languages">$i18n.getString( "languages" )</label></td>
- <td><textarea id="languages" name="languages">$!encoder.htmlEncode( $!userCredentials.user.languages )</textarea></td>
- </tr>
- <tr>
- <td></td>
- <td valign="top"><input type="submit" value="$i18n.getString( 'save' )" style="width:10em"/></td>
- </tr>
-</table>
+ <table>
+ <tr>
+ <th colspan="2">$i18n.getString( "profile_details" )</th>
+ </tr>
+ <tr>
+ <td><label for="email">$i18n.getString( "email" )</label></td>
+ <td><input type="text" id="email" name="email" value="$!encoder.htmlEncode( $userCredentials.userInfo.email )"></td>
+ </tr>
+ <tr>
+ <td><label for="phoneNumber">$i18n.getString( "phone_number" )</label></td>
+ <td><input type="text" id="phoneNumber" name="phoneNumber" value="$!encoder.htmlEncode( $userCredentials.userInfo.phoneNumber )"></td>
+ </tr>
+ <tr>
+ <td><label for="introduction">$i18n.getString( "introduction" )</label></td>
+ <td><textarea id="introduction" name="introduction">$!encoder.htmlEncode( $!userCredentials.userInfo.introduction )</textarea></td>
+ </tr>
+ <tr>
+ <td><label for="jobTitle">$i18n.getString( "job_title" )</label></td>
+ <td><input type="text" id="jobTitle" name="jobTitle" value="$!encoder.htmlEncode( $userCredentials.userInfo.jobTitle )"></td>
+ </tr>
+ <tr>
+ <td><label for="gender">$i18n.getString( "gender" )</label></td>
+ <td><select type="text" id="gender" name="gender">
+ <option value="gender_male" #if( $!userCredentials.userInfo.gender == "gender_male" ) selected="selected"#end>$i18n.getString( "male" )</option>
+ <option value="gender_female" #if( $!userCredentials.userInfo.gender == "gender_female" ) selected="selected"#end>$i18n.getString( "female" )</option>
+ <option value="gender_other" #if( $!userCredentials.userInfo.gender == "gender_other" ) selected="selected"#end>$i18n.getString( "other" )</option>
+ </select></td>
+ </tr>
+ <tr>
+ <td><label for="birthday">$i18n.getString( "birthday" )</label></td>
+ <td><input type="text" id="birthday" name="birthday" value="$!format.formatDate( $!userCredentials.userInfo.birthday )"></td>
+ </tr>
+ <tr>
+ <td><label for="nationality">$i18n.getString( "nationality" )</label></td>
+ <td><input type="text" id="nationality" name="nationality" value="$!encoder.htmlEncode( $!userCredentials.userInfo.nationality )"></td>
+ </tr>
+ <tr>
+ <td><label for="employer">$i18n.getString( "employer" )</label></td>
+ <td><input type="text" id="employer" name="employer" value="$!encoder.htmlEncode( $!userCredentials.userInfo.employer )"></td>
+ </tr>
+ <tr>
+ <td><label for="education">$i18n.getString( "education" )</label></td>
+ <td><textarea id="education" name="education">$!encoder.htmlEncode( $!userCredentials.userInfo.education )</textarea></td>
+ </tr>
+ <tr>
+ <td><label for="interests">$i18n.getString( "interests" )</label></td>
+ <td><textarea id="interests" name="interests">$!encoder.htmlEncode( $!userCredentials.userInfo.interests )</textarea></td>
+ </tr>
+ <tr>
+ <td><label for="languages">$i18n.getString( "languages" )</label></td>
+ <td><textarea id="languages" name="languages">$!encoder.htmlEncode( $!userCredentials.userInfo.languages )</textarea></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td valign="top"><input type="submit" value="$i18n.getString( 'save' )" style="width:10em"/></td>
+ </tr>
+ </table>
</form>
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetUserAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetUserAction.java 2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetUserAction.java 2015-10-05 07:55:19 +0000
@@ -91,7 +91,7 @@
{
UserCredentials credentials = userService.getUserCredentialsByUsername( username );
- user = credentials != null ? credentials.getUser() : null;
+ user = credentials != null ? credentials.getUserInfo() : null;
}
return SUCCESS;
}
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/DatabaseAutomaticAccessProvider.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/DatabaseAutomaticAccessProvider.java 2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/DatabaseAutomaticAccessProvider.java 2015-10-05 07:55:19 +0000
@@ -71,7 +71,7 @@
UserCredentials userCredentials = new UserCredentials();
userCredentials.setUsername( username );
- userCredentials.setUser( user );
+ userCredentials.setUserInfo( user );
userCredentials.getUserAuthorityGroups().add( userAuthorityGroup );
userService.encodeAndSetPassword( userCredentials, password );
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/useraccount/action/IsInviteTokenValidAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/useraccount/action/IsInviteTokenValidAction.java 2015-06-17 14:11:12 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/useraccount/action/IsInviteTokenValidAction.java 2015-10-05 07:55:19 +0000
@@ -127,7 +127,7 @@
return ERROR;
}
- email = userCredentials.getUser().getEmail();
+ email = userCredentials.getUserInfo().getEmail();
RestoreOptions restoreOptions = securityService.getRestoreOptions( token );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/AddUserAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/AddUserAction.java 2015-03-11 11:01:16 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/AddUserAction.java 2015-10-05 07:55:19 +0000
@@ -289,7 +289,7 @@
UserCredentials userCredentials = new UserCredentials();
User user = new User();
- userCredentials.setUser( user );
+ userCredentials.setUserInfo( user );
user.setUserCredentials( userCredentials );
userCredentials.setUsername( StringUtils.trimToNull( username ) );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/ValidateInviteAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/ValidateInviteAction.java 2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/ValidateInviteAction.java 2015-10-05 07:55:19 +0000
@@ -95,7 +95,7 @@
UserCredentials credentials = new UserCredentials();
User user = new User();
- credentials.setUser( user );
+ credentials.setUserInfo( user );
user.setUserCredentials( credentials );
user.setEmail( email );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/responseUsers.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/responseUsers.vm 2014-03-23 18:26:50 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/responseUsers.vm 2015-10-05 07:55:19 +0000
@@ -4,11 +4,11 @@
<user>
<id>$userCredentials.id</id>
<username>$encoder.xmlEncode( $userCredentials.username )</username>
- <surname>$encoder.xmlEncode( $userCredentials.user.surname )</surname>
- <firstName>$encoder.xmlEncode( $userCredentials.user.firstName )</firstName>
- <email>$!encoder.xmlEncode( $userCredentials.user.email )</email>
- <phoneNumber>$!encoder.xmlEncode( $userCredentials.user.phoneNumber )</phoneNumber>
- <numberOrgunit>$userCredentials.user.organisationUnits.size()</numberOrgunit>
+ <surname>$encoder.xmlEncode( $userCredentials.userInfo.surname )</surname>
+ <firstName>$encoder.xmlEncode( $userCredentials.userInfo.firstName )</firstName>
+ <email>$!encoder.xmlEncode( $userCredentials.userInfo.email )</email>
+ <phoneNumber>$!encoder.xmlEncode( $userCredentials.userInfo.phoneNumber )</phoneNumber>
+ <numberOrgunit>$userCredentials.userInfo.organisationUnits.size()</numberOrgunit>
</user>
#end
<currentUserName>$currentUsername</currentUserName>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateUserForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateUserForm.vm 2014-12-29 18:17:39 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateUserForm.vm 2015-10-05 07:55:19 +0000
@@ -7,7 +7,7 @@
rules["retypePassword"].required = false;
rules["inviteEmail"].required = false;
- validation2('updateUserForm', function( form ) {
+ validation2('updateUserForm', function(form) {
jQuery("#urSelected").children().attr("selected", "selected");
jQuery("#ugSelected").children().attr("selected", "selected");
jQuery("#dcSelected").children().attr("selected", "selected");
@@ -15,14 +15,14 @@
if( $('#orgUnitTree').find('.selected').size() == 0 ) {
setHeaderDelayMessage('$encoder.jsEncode( $i18n.getString( "data_capture_organisation_unit_required_for_user" ) )');
} else {
- $('#ouwtSelected').val( ouwtSelected[0] );
- selection.setSelected( ouwtSelected !== undefined ? ouwtSelected : [] );
+ $('#ouwtSelected').val(ouwtSelected[0]);
+ selection.setSelected(ouwtSelected !== undefined ? ouwtSelected : []);
form.submit();
}
}, {
'beforeValidateHandler': function() {
listValidator('urValidator', 'urSelected');
- #tblDynamicAttributesJavascript()
+ #tblDynamicAttributesJavascript()
},
'rules': rules
});
@@ -31,10 +31,10 @@
ouwtSelected = selection.getSelected();
selection.clearSelected(); // Sync ouwt from server
- selection.setOfflineLevel( 1 );
- selection.setMultipleSelectionAllowed( true );
- selection.setUnselectAllowed( true );
- selection.setAutoSelectRoot( false );
+ selection.setOfflineLevel(1);
+ selection.setMultipleSelectionAllowed(true);
+ selection.setUnselectAllowed(true);
+ selection.setAutoSelectRoot(false);
jQuery("#cancel").click(function() {
dhis2.commons.redirectCurrentPage('alluser.action');
@@ -56,7 +56,7 @@
search: $('#ugAvailableSearch'),
iterator: 'userGroups'
});
-
+
$('#dcAvailable').selected({
url: '../api/dimensions/constraints.json',
target: $('#dcSelected'),
@@ -67,149 +67,149 @@
</script>
<style type="text/css">
-div#orgUnitTree
-{
- width: 495px;
- border: 1px solid #ccc;
-}
+ div#orgUnitTree {
+ width : 495px;
+ border : 1px solid #ccc;
+ }
</style>
<h3>$i18n.getString( "edit_user" )</h3>
<form id="updateUserForm" action="updateUser.action" method="post" class="inputForm">
-<input type="hidden" id="ouwtSelected" name="ouwtSelected" value=""/>
-<div><input type="hidden" id="id" name="id" value="$userCredentials.id"/></div>
-
-<table>
+ <input type="hidden" id="ouwtSelected" name="ouwtSelected" value=""/>
+
+ <div><input type="hidden" id="id" name="id" value="$userCredentials.id"/></div>
+
+ <table>
<col style="width: 120px"/>
<col style="width: 350px"/>
<col/>
<col style="width: 350px"/>
- <tr>
- <th colspan="4">$i18n.getString( "details" )</th>
- </tr>
-
- <tr>
- <td><label for="username">$i18n.getString( "username" )</label></td>
- <td colspan="3"><input type="text" id="username" name="username" value="$encoder.htmlEncode( $userCredentials.username )" disabled="disabled" autocomplete="off"/></td>
- </tr>
-
- <tr>
- <td><label for="rawPassword">$i18n.getString( "password" )</label></td>
- <td colspan="3"><input type="password" id="rawPassword" name="rawPassword" autocomplete="off"></td>
- </tr>
-
- <tr>
- <td><label for="retypePassword">$i18n.getString( "retype_password" ) </label></td>
- <td colspan="3"><input type="password" id="retypePassword" name="retypePassword" autocomplete="off"></td>
- </tr>
-
- <tr>
- <td><label for="surname">$i18n.getString( "surname" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
- <td colspan="3"><input type="text" id="surname" name="surname" value="$encoder.htmlEncode( $userCredentials.user.surname )"></td>
- </tr>
-
- <tr>
- <td><label for="firstName">$i18n.getString( "firstName" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
- <td colspan="3"><input type="text" id="firstName" name="firstName" value="$encoder.htmlEncode( $userCredentials.user.firstName )"></td>
- </tr>
-
- <tr>
- <td><label for="email">$i18n.getString( "email" )</label></td>
- <td colspan="3"><input type="text" id="email" name="email" value="$!encoder.htmlEncode( $userCredentials.user.email )"></td>
- </tr>
-
- <tr>
- <td><label for="openId">$i18n.getString( "openid" )</label></td>
- <td colspan="3"><input type="text" id="openId" name="openId" value="$!encoder.htmlEncode( $userCredentials.openId )"></td>
- </tr>
-
- <tr>
- <td><label for="phoneNumber">$i18n.getString( "phone_number" )</label></td>
- <td colspan="3"><input type="text" id="phoneNumber" name="phoneNumber" value="$!encoder.htmlEncode( $userCredentials.user.phoneNumber )"></td>
- </tr>
-
- <tr>
- <td><label>$i18n.getString( "language" )</label></td>
- <td>
- <select id="localeUi" name="localeUi">
- #foreach( $locale in $availableLocales )
- <option value="$locale.toString()" #if( $locale == $currentLocale )selected="selected"#end>$locale.getDisplayName()</option>
- #end
- </select>
- </td>
- </tr>
-
- <tr>
- <td><label>$i18n.getString( "db_language" )</label></td>
- <td>
- <select id="localeDb" name="localeDb">
- <option value="">[$i18n.getString( "use_db_locale_no_translation" )]</option>
- #foreach( $locale in $availableLocalesDb )
- <option value="$locale.toString()" #if( $locale == $currentLocaleDb )selected="selected"#end>$locale.getDisplayName()</option>
- #end
- </select>
- </td>
- </tr>
-
-</table>
-
-#tblDynamicAttributes( {
+ <tr>
+ <th colspan="4">$i18n.getString( "details" )</th>
+ </tr>
+
+ <tr>
+ <td><label for="username">$i18n.getString( "username" )</label></td>
+ <td colspan="3"><input type="text" id="username" name="username" value="$encoder.htmlEncode( $userCredentials.username )" disabled="disabled" autocomplete="off"/></td>
+ </tr>
+
+ <tr>
+ <td><label for="rawPassword">$i18n.getString( "password" )</label></td>
+ <td colspan="3"><input type="password" id="rawPassword" name="rawPassword" autocomplete="off"></td>
+ </tr>
+
+ <tr>
+ <td><label for="retypePassword">$i18n.getString( "retype_password" ) </label></td>
+ <td colspan="3"><input type="password" id="retypePassword" name="retypePassword" autocomplete="off"></td>
+ </tr>
+
+ <tr>
+ <td><label for="surname">$i18n.getString( "surname" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
+ <td colspan="3"><input type="text" id="surname" name="surname" value="$encoder.htmlEncode( $userCredentials.userInfo.surname )"></td>
+ </tr>
+
+ <tr>
+ <td><label for="firstName">$i18n.getString( "firstName" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
+ <td colspan="3"><input type="text" id="firstName" name="firstName" value="$encoder.htmlEncode( $userCredentials.userInfo.firstName )"></td>
+ </tr>
+
+ <tr>
+ <td><label for="email">$i18n.getString( "email" )</label></td>
+ <td colspan="3"><input type="text" id="email" name="email" value="$!encoder.htmlEncode( $userCredentials.userInfo.email )"></td>
+ </tr>
+
+ <tr>
+ <td><label for="openId">$i18n.getString( "openid" )</label></td>
+ <td colspan="3"><input type="text" id="openId" name="openId" value="$!encoder.htmlEncode( $userCredentials.openId )"></td>
+ </tr>
+
+ <tr>
+ <td><label for="phoneNumber">$i18n.getString( "phone_number" )</label></td>
+ <td colspan="3"><input type="text" id="phoneNumber" name="phoneNumber" value="$!encoder.htmlEncode( $userCredentials.userInfo.phoneNumber )"></td>
+ </tr>
+
+ <tr>
+ <td><label>$i18n.getString( "language" )</label></td>
+ <td>
+ <select id="localeUi" name="localeUi">
+ #foreach( $locale in $availableLocales )
+ <option value="$locale.toString()" #if( $locale == $currentLocale )selected="selected"#end>$locale.getDisplayName()</option>
+ #end
+ </select>
+ </td>
+ </tr>
+
+ <tr>
+ <td><label>$i18n.getString( "db_language" )</label></td>
+ <td>
+ <select id="localeDb" name="localeDb">
+ <option value="">[$i18n.getString( "use_db_locale_no_translation" )]</option>
+ #foreach( $locale in $availableLocalesDb )
+ <option value="$locale.toString()" #if( $locale == $currentLocaleDb )selected="selected"#end>$locale.getDisplayName()</option>
+ #end
+ </select>
+ </td>
+ </tr>
+
+ </table>
+
+ #tblDynamicAttributes( {
"attributes": $attributes,
"attributeValues": $attributeValues
-})
+ })
-#jqSelected({
+ #jqSelected({
"prefix": "ur",
"required": true,
"i18n_available": "available_roles",
"i18n_selected": "selected_roles",
"objects": $userAuthorityGroups
-})
-
-<table style="margin-bottom: 20px;">
- <tr>
- <th>$i18n.getString( "data_capture_maintenance_org_units" )</th>
- <th></th>
- <th>$i18n.getString( "data_output_analysis_org_units" )</th>
- </tr>
- <tr>
- <td>
- #parse( "/dhis-web-commons/ouwt/orgunittree.vm" )
- </td>
- <td style="width: 26px"></td>
- <td>
- <div id="selectionTree"></div>
- </td>
- </tr>
-</table>
-
-<div id="showMoreOptions" style="margin-bottom: 20px;"><a href="javascript:showUserOptions()">$i18n.getString( "show_more_options" )</a></div>
-
-<div id="moreOptions" style="display:none">
-
-#jqSelected({
- "prefix": "ug",
- "i18n_available": "available_user_groups",
- "i18n_selected": "selected_user_groups",
- "objects": $userGroups
-})
-
-#jqSelected({
- "prefix": "dc",
- "i18n_available": "available_dimension_restrictions_for_data_analytics",
- "i18n_selected": "selected_dimension_restrictions_for_data_analytics",
- "objects": $dimensionConstraints
-})
-
-<div id="showFewerOptions" style="margin-bottom: 20px;"><a href="javascript:showUserOptions()">$i18n.getString( "show_fewer_options" )</a></div>
-
-</div>
-
-<p>
- <input type="submit" value="$i18n.getString( 'save' )" style="width:10em" />
- <input type="button" id="cancel" value="$i18n.getString( 'cancel' )" style="width:10em" />
-</p>
+ })
+
+ <table style="margin-bottom: 20px;">
+ <tr>
+ <th>$i18n.getString( "data_capture_maintenance_org_units" )</th>
+ <th></th>
+ <th>$i18n.getString( "data_output_analysis_org_units" )</th>
+ </tr>
+ <tr>
+ <td>
+ #parse( "/dhis-web-commons/ouwt/orgunittree.vm" )
+ </td>
+ <td style="width: 26px"></td>
+ <td>
+ <div id="selectionTree"></div>
+ </td>
+ </tr>
+ </table>
+
+ <div id="showMoreOptions" style="margin-bottom: 20px;"><a href="javascript:showUserOptions()">$i18n.getString( "show_more_options" )</a></div>
+
+ <div id="moreOptions" style="display:none">
+
+ #jqSelected({
+ "prefix": "ug",
+ "i18n_available": "available_user_groups",
+ "i18n_selected": "selected_user_groups",
+ "objects": $userGroups
+ })
+
+ #jqSelected({
+ "prefix": "dc",
+ "i18n_available": "available_dimension_restrictions_for_data_analytics",
+ "i18n_selected": "selected_dimension_restrictions_for_data_analytics",
+ "objects": $dimensionConstraints
+ })
+
+ <div id="showFewerOptions" style="margin-bottom: 20px;"><a href="javascript:showUserOptions()">$i18n.getString( "show_fewer_options" )</a></div>
+
+ </div>
+
+ <p>
+ <input type="submit" value="$i18n.getString( 'save' )" style="width:10em"/>
+ <input type="button" id="cancel" value="$i18n.getString( 'cancel' )" style="width:10em"/>
+ </p>
</form>