[ChangePassword] Fixed trigger to work with oracle
authorJonathan Bueno <jonathan.bueno@openbravo.com>
Thu, 21 Jan 2016 10:17:24 +0100
changeset 28661 55e212abb741
parent 28660 27a48364f2df
child 28662 788fed01e2a5
[ChangePassword] Fixed trigger to work with oracle
src-db/database/model/triggers/AD_USER_EXPIRYPASS_TRG.xml
--- a/src-db/database/model/triggers/AD_USER_EXPIRYPASS_TRG.xml	Wed Jan 20 13:38:41 2016 +0100
+++ b/src-db/database/model/triggers/AD_USER_EXPIRYPASS_TRG.xml	Thu Jan 21 10:17:24 2016 +0100
@@ -17,21 +17,23 @@
 * The Initial Developer of the Original Code is Openbravo SLU
 * All portions are Copyright (C) 2015 Openbravo SLU
 * All Rights Reserved.
-* Contributor(s):  __JBU____________________________________.
+* Contributor(s):  ______________________________________.
 ************************************************************************/
  
  BEGIN
  
-   IF AD_isTriggerEnabled()='N' THEN IF UPDATING THEN RETURN OLD; ELSE RETURN NEW; END IF; 
+   IF AD_isTriggerEnabled()='N' THEN RETURN;
    END IF;
 
-   IF :OLD.password<>:NEW.password THEN
+   IF (:OLD.password<>:NEW.password) THEN
      
-   UPDATE ad_user
-   SET lastupdatepassworddate = now()
-   WHERE ad_user_id=:NEW.ad_user_id;
+     UPDATE ad_user
+     SET lastupdatepassworddate = now()
+     WHERE ad_user_id=:NEW.ad_user_id;
 
-   ELSE RETURN NEW; END IF;
+   ELSE 
+     RETURN NEW; 
+   END IF;
  
    END AD_USER_EXPIRYPASS_TRG
 ]]></body>