Author: ilgrosso Date: Thu Jun 19 09:01:47 2014 New Revision: 1603768 URL: http://svn.apache.org/r1603768 Log: [SYNCOPE-507] Merge from 1_1_X
Modified: syncope/trunk/ (props changed) syncope/trunk/core/src/main/java/org/apache/syncope/core/security/SyncopeAuthenticationProvider.java syncope/trunk/core/src/main/resources/content.xml syncope/trunk/core/src/test/resources/content.xml Propchange: syncope/trunk/ ------------------------------------------------------------------------------ Merged /syncope/branches/1_1_X:r1602078-1603763 Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/security/SyncopeAuthenticationProvider.java URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/security/SyncopeAuthenticationProvider.java?rev=1603768&r1=1603767&r2=1603768&view=diff ============================================================================== --- syncope/trunk/core/src/main/java/org/apache/syncope/core/security/SyncopeAuthenticationProvider.java (original) +++ syncope/trunk/core/src/main/java/org/apache/syncope/core/security/SyncopeAuthenticationProvider.java Thu Jun 19 09:01:47 2014 @@ -163,7 +163,7 @@ public class SyncopeAuthenticationProvid LOG.debug("User {} successfully authenticated, with roles {}", authentication.getPrincipal(), token.getAuthorities()); - if (user != null) { + if (user != null && Boolean.valueOf(confDAO.find("log.lastlogindate", Boolean.toString(true)).getValue())) { user.setLastLoginDate(new Date()); user.setFailedLogins(0); userDAO.save(user); Modified: syncope/trunk/core/src/main/resources/content.xml URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/resources/content.xml?rev=1603768&r1=1603767&r2=1603768&view=diff ============================================================================== --- syncope/trunk/core/src/main/resources/content.xml (original) +++ syncope/trunk/core/src/main/resources/content.xml Thu Jun 19 09:01:47 2014 @@ -30,6 +30,8 @@ under the License. <SyncopeConf confKey="selfRegistration.allowed" confValue="true"/> <!-- when needing to provide more values, use '|' as separator and no spaces --> <SyncopeConf confKey="authentication.statuses" confValue="active"/> + <!-- Save user login date upon successful authentication --> + <SyncopeConf confKey="log.lastlogindate" confValue="true"/> <!-- Authentication and authorization --> <Entitlement name="SCHEMA_LIST"/> Modified: syncope/trunk/core/src/test/resources/content.xml URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/resources/content.xml?rev=1603768&r1=1603767&r2=1603768&view=diff ============================================================================== --- syncope/trunk/core/src/test/resources/content.xml (original) +++ syncope/trunk/core/src/test/resources/content.xml Thu Jun 19 09:01:47 2014 @@ -30,6 +30,8 @@ under the License. <SyncopeConf confKey="selfRegistration.allowed" confValue="true"/> <!-- when needing to provide more values, use '|' as separator and no spaces --> <SyncopeConf confKey="authentication.statuses" confValue="created|active"/> + <!-- Save user login date upon successful authentication --> + <SyncopeConf confKey="log.lastlogindate" confValue="true"/> <!-- sample policies --> <Policy DTYPE="SyncPolicy" id="1" description="global sync policy" type="GLOBAL_SYNC" specification="%3Corg.apache.syncope.common.types.SyncPolicySpec%3E%0A++%3CuAltSearchSchemas%2F%3E%0A++%3CrAltSearchSchemas%2F%3E%0A%3C%2Forg.apache.syncope.common.types.SyncPolicySpec%3E"/>