Author: ilgrosso
Date: Mon Jul  7 09:41:20 2014
New Revision: 1608388

URL: http://svn.apache.org/r1608388
Log:
Merge from 1_2_X

Modified:
    syncope/trunk/   (props changed)
    syncope/trunk/CHANGES
    
syncope/trunk/core/src/main/java/org/apache/syncope/core/security/SyncopeAuthenticationProvider.java
    syncope/trunk/src/site/xdoc/downloads.xml

Propchange: syncope/trunk/
------------------------------------------------------------------------------
  Merged /syncope/branches/1_2_X:r1608352-1608387
  Merged /syncope/branches/1_1_X:r1607405-1608365

Modified: syncope/trunk/CHANGES
URL: 
http://svn.apache.org/viewvc/syncope/trunk/CHANGES?rev=1608388&r1=1608387&r2=1608388&view=diff
==============================================================================
--- syncope/trunk/CHANGES (original)
+++ syncope/trunk/CHANGES Mon Jul  7 09:41:20 2014
@@ -2,10 +2,30 @@ Apache Syncope - CHANGES
 Licensed under Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0
 
--------------------------------------------------------------------------------
 
+Release Notes - Syncope - Version 1.1.8
+================================================================================
+** Bug
+    * [SYNCOPE-499] - Deletion of role set as parent role in template 
generates exception
+    * [SYNCOPE-500] - Wrong (unwanted) derived attribute insertion addition in 
membership modal page
+    * [SYNCOPE-501] - Virtual attribute propagation not working when updating 
only virtual attributes
+    * [SYNCOPE-504] - Sync/Push actions shouldn't be executed in dryrun
+    * [SYNCOPE-509] - In Task page after change of number of rows (to display) 
is erroneously added a column to tasks table
+    * [SYNCOPE-512] - If there are no roles in edit user modal page is 
possible to create membership between root (fake) role and user
+    * [SYNCOPE-515] - Bad integration test causes role ownership conflicts
+
+** Improvement
+    * [SYNCOPE-485] - Upgrade to Activiti 5.15.1
+    * [SYNCOPE-486] - Update Selenium test configuration
+    * [SYNCOPE-507] - User login date conditional logging
+    * [SYNCOPE-511] - Enhance synchronization report information
+    * [SYNCOPE-519] - Report default values for connector properties
+    * [SYNCOPE-520] - Move reset sync token to resource actions
+
 Release Notes - Syncope - Version 1.1.7
 
================================================================================
 ** Bug
     * [SYNCOPE-484] - Reports and Content export fails over HTTPS connection
+
 ** Improvement
     * [SYNCOPE-487] - make Velocity tools available in templates for 
notifications
 

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=1608388&r1=1608387&r2=1608388&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
 Mon Jul  7 09:41:20 2014
@@ -22,9 +22,7 @@ import java.util.Collections;
 import java.util.Date;
 import java.util.Iterator;
 import java.util.Set;
-
 import javax.annotation.Resource;
-
 import org.apache.syncope.common.types.AttributableType;
 import org.apache.syncope.common.types.AuditElements;
 import org.apache.syncope.common.types.AuditElements.Result;
@@ -144,18 +142,17 @@ public class SyncopeAuthenticationProvid
                 }
 
                 CAttr authStatuses = confDAO.find("authentication.statuses");
-                if (authStatuses != null) {
-                    if 
(!authStatuses.getValuesAsStrings().contains(user.getStatus())) {
-                        throw new DisabledException("User " + 
user.getUsername() + " not allowed to authenticate");
-                    }
+                if (authStatuses != null && 
!authStatuses.getValuesAsStrings().contains(user.getStatus())) {
+                    throw new DisabledException("User " + user.getUsername() + 
" not allowed to authenticate");
                 }
 
                 authenticated = authenticate(user, 
authentication.getCredentials().toString());
+
+                updateLoginAttributes(user, authenticated);
             }
         }
 
         UsernamePasswordAuthenticationToken token;
-
         if (authenticated) {
             token = new UsernamePasswordAuthenticationToken(
                     authentication.getPrincipal(),
@@ -177,20 +174,7 @@ public class SyncopeAuthenticationProvid
 
             LOG.debug("User {} successfully authenticated, with roles {}",
                     authentication.getPrincipal(), token.getAuthorities());
-
-            if (user != null && confDAO.find("log.lastlogindate", 
Boolean.toString(true)).
-                    getValues().get(0).getBooleanValue()) {
-
-                user.setLastLoginDate(new Date());
-                user.setFailedLogins(0);
-                userDAO.save(user);
-            }
         } else {
-            if (user != null) {
-                user.setFailedLogins(user.getFailedLogins() + 1);
-                userDAO.save(user);
-            }
-
             auditManager.audit(
                     AuditElements.EventCategoryType.REST,
                     "AuthenticationController",
@@ -210,6 +194,29 @@ public class SyncopeAuthenticationProvid
         return token;
     }
 
+    private void updateLoginAttributes(SyncopeUser user, boolean 
authenticated) {
+        boolean userModified = false;
+
+        if (authenticated) {
+            if (confDAO.find("log.lastlogindate", 
Boolean.toString(true)).getValues().get(0).getBooleanValue()) {
+                user.setLastLoginDate(new Date());
+                userModified = true;
+            }
+
+            if (user.getFailedLogins() != 0) {
+                user.setFailedLogins(0);
+                userModified = true;
+            }
+        } else {
+            user.setFailedLogins(user.getFailedLogins() + 1);
+            userModified = true;
+        }
+
+        if (userModified) {
+            userDAO.save(user);
+        }
+    }
+
     protected Set<ExternalResource> getPassthroughResources(final SyncopeUser 
user) {
         Set<ExternalResource> result = null;
 
@@ -244,7 +251,7 @@ public class SyncopeAuthenticationProvid
                 result.retainAll(global.getResources());
             }
         }
-        
+
         if (result == null) {
             result = Collections.emptySet();
         }
@@ -259,7 +266,7 @@ public class SyncopeAuthenticationProvid
         final AttributableUtil attrUtil = 
AttributableUtil.getInstance(AttributableType.USER);
         for (Iterator<ExternalResource> itor = 
getPassthroughResources(user).iterator();
                 itor.hasNext() && !authenticated;) {
-            
+
             ExternalResource resource = itor.next();
             String accountId = null;
             try {

Modified: syncope/trunk/src/site/xdoc/downloads.xml
URL: 
http://svn.apache.org/viewvc/syncope/trunk/src/site/xdoc/downloads.xml?rev=1608388&r1=1608387&r2=1608388&view=diff
==============================================================================
--- syncope/trunk/src/site/xdoc/downloads.xml (original)
+++ syncope/trunk/src/site/xdoc/downloads.xml Mon Jul  7 09:41:20 2014
@@ -57,8 +57,8 @@ under the License.
     </section>
 
     <section name="Current Releases">
-      <subsection name="1.1.7 Ad libitum">
-        <p>Release date: Apr 11th, 2014</p>
+      <subsection name="1.1.8 Ad libitum">
+        <p>Release date: Jul 3rd, 2014</p>
         <p>
           <a 
href="https://cwiki.apache.org/confluence/display/SYNCOPE/Ad+libitum";>Release 
notes</a>
         </p>
@@ -72,22 +72,22 @@ under the License.
           <tbody>
             <tr>
               <td>
-                <a 
href="http://www.apache.org/dyn/closer.cgi/syncope/1.1.7/syncope-1.1.7-source-release.zip";>syncope-1.1.7-source-release.zip</a>
+                <a 
href="http://www.apache.org/dyn/closer.cgi/syncope/1.1.8/syncope-1.1.8-source-release.zip";>syncope-1.1.8-source-release.zip</a>
               </td>
               <td>
-                <a 
href="http://www.apache.org/dist/syncope/1.1.7/syncope-1.1.7-source-release.zip.asc";>asc</a>
 
-                <a 
href="http://www.apache.org/dist/syncope/1.1.7/syncope-1.1.7-source-release.zip.md5";>md5</a>
 
-                <a 
href="http://www.apache.org/dist/syncope/1.1.7/syncope-1.1.7-source-release.zip.sha1";>sha1</a>
+                <a 
href="http://www.apache.org/dist/syncope/1.1.8/syncope-1.1.8-source-release.zip.asc";>asc</a>
 
+                <a 
href="http://www.apache.org/dist/syncope/1.1.8/syncope-1.1.8-source-release.zip.md5";>md5</a>
 
+                <a 
href="http://www.apache.org/dist/syncope/1.1.8/syncope-1.1.8-source-release.zip.sha1";>sha1</a>
               </td>
             </tr>
             <tr>
               <td>
-                <a 
href="http://www.apache.org/dyn/closer.cgi/syncope/1.1.7/syncope-standalone-1.1.7-distribution.zip";>syncope-standalone-1.1.7-distribution.zip</a>
+                <a 
href="http://www.apache.org/dyn/closer.cgi/syncope/1.1.8/syncope-standalone-1.1.8-distribution.zip";>syncope-standalone-1.1.8-distribution.zip</a>
               </td>
               <td>
-                <a 
href="http://www.apache.org/dist/syncope/1.1.7/syncope-standalone-1.1.7-distribution.zip.asc";>asc</a>
 
-                <a 
href="http://www.apache.org/dist/syncope/1.1.7/syncope-standalone-1.1.7-distribution.zip.md5";>md5</a>
 
-                <a 
href="http://www.apache.org/dist/syncope/1.1.7/syncope-standalone-1.1.7-distribution.zip.sha1";>sha1</a>
+                <a 
href="http://www.apache.org/dist/syncope/1.1.8/syncope-standalone-1.1.8-distribution.zip.asc";>asc</a>
 
+                <a 
href="http://www.apache.org/dist/syncope/1.1.8/syncope-standalone-1.1.8-distribution.zip.md5";>md5</a>
 
+                <a 
href="http://www.apache.org/dist/syncope/1.1.8/syncope-standalone-1.1.8-distribution.zip.sha1";>sha1</a>
               </td>
             </tr>
           </tbody>
@@ -122,8 +122,8 @@ under the License.
     </section>
 
     <section name="Older Releases">
-      <subsection name="1.1.6 Ad libitum">
-        <p>Release date: Feb 22nd, 2014</p>
+      <subsection name="1.1.7 Ad libitum">
+        <p>Release date: Apr 11th, 2014</p>
         <p>
           <a 
href="https://cwiki.apache.org/confluence/display/SYNCOPE/Ad+libitum";>Release 
notes</a>
         </p>
@@ -137,22 +137,22 @@ under the License.
           <tbody>
             <tr>
               <td>
-                <a 
href="http://archive.apache.org/dist/syncope/1.1.6/syncope-1.1.6-source-release.zip";>syncope-1.1.6-source-release.zip</a>
+                <a 
href="http://archive.apache.org/dist/syncope/1.1.7/syncope-1.1.7-source-release.zip";>syncope-1.1.7-source-release.zip</a>
               </td>
               <td>
-                <a 
href="http://archive.apache.org/dist/syncope/1.1.6/syncope-1.1.6-source-release.zip.asc";>asc</a>
 
-                <a 
href="http://archive.apache.org/dist/syncope/1.1.6/syncope-1.1.6-source-release.zip.md5";>md5</a>
 
-                <a 
href="http://archive.apache.org/dist/syncope/1.1.6/syncope-1.1.6-source-release.zip.sha1";>sha1</a>
+                <a 
href="http://archive.apache.org/dist/syncope/1.1.7/syncope-1.1.7-source-release.zip.asc";>asc</a>
 
+                <a 
href="http://archive.apache.org/dist/syncope/1.1.7/syncope-1.1.7-source-release.zip.md5";>md5</a>
 
+                <a 
href="http://archive.apache.org/dist/syncope/1.1.7/syncope-1.1.7-source-release.zip.sha1";>sha1</a>
               </td>
             </tr>
             <tr>
               <td>
-                <a 
href="http://archive.apache.org/dist/syncope/1.1.6/syncope-standalone-1.1.6-distribution.zip";>syncope-standalone-1.1.6-distribution.zip</a>
+                <a 
href="http://archive.apache.org/dist/syncope/1.1.7/syncope-standalone-1.1.7-distribution.zip";>syncope-standalone-1.1.7-distribution.zip</a>
               </td>
               <td>
-                <a 
href="http://archive.apache.org/dist/syncope/1.1.6/syncope-standalone-1.1.6-distribution.zip.asc";>asc</a>
 
-                <a 
href="http://archive.apache.org/dist/syncope/1.1.6/syncope-standalone-1.1.6-distribution.zip.md5";>md5</a>
 
-                <a 
href="http://archive.apache.org/dist/syncope/1.1.6/syncope-standalone-1.1.6-distribution.zip.sha1";>sha1</a>
+                <a 
href="http://archive.apache.org/dist/syncope/1.1.7/syncope-standalone-1.1.7-distribution.zip.asc";>asc</a>
 
+                <a 
href="http://archive.apache.org/dist/syncope/1.1.7/syncope-standalone-1.1.7-distribution.zip.md5";>md5</a>
 
+                <a 
href="http://archive.apache.org/dist/syncope/1.1.7/syncope-standalone-1.1.7-distribution.zip.sha1";>sha1</a>
               </td>
             </tr>
           </tbody>


Reply via email to