From 5753743d65eecd0a41271059a42f5aa8d5097291 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Mon, 9 Mar 2009 16:33:43 +0000 Subject: [PATCH] - LSldapObjet : Ajout de la gestion de l'evenement before_create --- trunk/includes/class/class.LSldapObject.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/trunk/includes/class/class.LSldapObject.php b/trunk/includes/class/class.LSldapObject.php index b10f000e..434e2737 100644 --- a/trunk/includes/class/class.LSldapObject.php +++ b/trunk/includes/class/class.LSldapObject.php @@ -558,6 +558,12 @@ class LSldapObject { if($dn) { $this -> dn=$dn; LSdebug($submitData); + if ($new) { + if (!$this -> fireEvent('before_create')) { + LSerror :: addErrorCode('LSldapObject_20'); + return; + } + } if (!LSldap :: update($this -> getType(),$dn, $submitData)) { return; } @@ -1893,8 +1899,9 @@ LSerror :: defineError('LSldapObject_19', _("LSldapObject : Error during actions to be executed after deleting the objet.") ); -// 20 : not used - +LSerror :: defineError('LSldapObject_20', +_("LSldapObject : Error during the actions to be executed before creating the object.") +); LSerror :: defineError('LSldapObject_21', _("LSldapObject : Error during the actions to be executed after creating the object. It was created anyway.") );