dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #19876
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8853: Added property UserCredentials.selfRegistered
------------------------------------------------------------
revno: 8853
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2012-11-04 12:06:31 +0300
message:
Added property UserCredentials.selfRegistered
modified:
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/startup/TableAlteror.java
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/UserCredentials.hbm.xml
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AccountController.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-api/src/main/java/org/hisp/dhis/user/UserCredentials.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserCredentials.java 2012-10-31 05:41:46 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserCredentials.java 2012-11-04 09:06:31 +0000
@@ -100,6 +100,11 @@
* The timestamp representing when the restore window expires.
*/
private Date restoreExpiry;
+
+ /**
+ * Indicates whether this user was originally self registered.
+ */
+ private boolean selfRegistered;
// -------------------------------------------------------------------------
// Logic
@@ -411,4 +416,14 @@
{
this.restoreExpiry = restoreExpiry;
}
+
+ public boolean isSelfRegistered()
+ {
+ return selfRegistered;
+ }
+
+ public void setSelfRegistered( boolean selfRegistered )
+ {
+ this.selfRegistered = selfRegistered;
+ }
}
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2012-11-01 14:25:50 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2012-11-04 09:06:31 +0000
@@ -441,6 +441,8 @@
executeSql( "update chart set userorganisationunitchildren = false where userorganisationunitchildren is null" );
executeSql( "update chart set userorganisationunit = false where userorganisationunit is null" );
+ executeSql( "update users set selfregistered = false where selfregistered is null" );
+
// report, reporttable, chart groups
executeSql( "DROP TABLE reportgroupmembers" );
=== 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 2012-10-29 14:34:57 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/UserCredentials.hbm.xml 2012-11-04 09:06:31 +0000
@@ -36,7 +36,9 @@
<property name="restoreCode" />
- <property name="restoreExpiry" type="timestamp" />
+ <property name="restoreExpiry" type="timestamp" />
+
+ <property name="selfRegistered" />
</class>
</hibernate-mapping>
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AccountController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AccountController.java 2012-11-04 08:37:25 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AccountController.java 2012-11-04 09:06:31 +0000
@@ -314,6 +314,7 @@
credentials = new UserCredentials();
credentials.setUsername( username );
credentials.setPassword( passwordManager.encodePassword( username, password ) );
+ credentials.setSelfRegistered( true );
credentials.setUser( user );
credentials.getUserAuthorityGroups().add( userRole );