[ChangePassword] Fixed trigger to work with oracle
authorJonathan Bueno <jonathan.bueno@openbravo.com>
Fri, 22 Jan 2016 12:16:40 +0100
changeset 28665 c69185a63058
parent 28664 409b401e8f17
child 28666 d1a02b344ff9
[ChangePassword] Fixed trigger to work with oracle

Changed logic of trigger
src-db/database/model/triggers/AD_USER_EXPIRYPASS_TRG.xml
--- a/src-db/database/model/triggers/AD_USER_EXPIRYPASS_TRG.xml	Fri Jan 22 10:19:07 2016 +0100
+++ b/src-db/database/model/triggers/AD_USER_EXPIRYPASS_TRG.xml	Fri Jan 22 12:16:40 2016 +0100
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
   <database name="TRIGGER AD_USER_EXPIRYPASS_TRG">
-    <trigger name="AD_USER_EXPIRYPASS_TRG" table="AD_USER" fires="after" insert="false" update="true" delete="false" foreach="row">
+    <trigger name="AD_USER_EXPIRYPASS_TRG" table="AD_USER" fires="before" insert="false" update="true" delete="false" foreach="row">
       <body><![CDATA[
       
 /*************************************************************************
@@ -27,10 +27,8 @@
 
    IF (:OLD.password<>:NEW.password) THEN
      
-     UPDATE ad_user
-     SET lastupdatepassworddate = now()
-     WHERE ad_user_id=:NEW.ad_user_id;
-
+     :NEW.lastupdatepassworddate := now();
+     
    END IF;
  
    END AD_USER_EXPIRYPASS_TRG