From e5480740cffb498dbc2a523fc20d2ac26be964b4 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Thu, 22 Jan 2009 15:35:37 +0000 Subject: [PATCH] =?UTF-8?q?-=20LSldapObject=20:=20Ajout=20de=20fireEvent?= =?UTF-8?q?=20sur=20les=20LSattributes=20de=20l'objet=20=20=20dans=20les?= =?UTF-8?q?=20m=C3=A9thodes=20beforeDelete()=20et=20afterDelete()=20-=20Co?= =?UTF-8?q?nfig.=20LSeepeople=20:=20oubli=20generate=5FsambaSID()=20->=20g?= =?UTF-8?q?enerate=5FsambaUserSID()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LSobjects/config.LSobjects.LSeepeople.php | 2 +- trunk/includes/class/class.LSldapObject.php | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/trunk/conf/LSobjects/config.LSobjects.LSeepeople.php b/trunk/conf/LSobjects/config.LSobjects.LSeepeople.php index 2356c62c..3b0f021e 100644 --- a/trunk/conf/LSobjects/config.LSobjects.LSeepeople.php +++ b/trunk/conf/LSobjects/config.LSobjects.LSeepeople.php @@ -325,7 +325,7 @@ $GLOBALS['LSobjects']['LSeepeople'] = array ( 'ldap_type' => 'ascii', 'html_type' => 'text', 'required' => 1, - 'generate_function' => 'generate_sambaSID', + 'generate_function' => 'generate_sambaUserSID', 'rights' => array( 'admin' => 'r' ), diff --git a/trunk/includes/class/class.LSldapObject.php b/trunk/includes/class/class.LSldapObject.php index f4f44295..bcdc947e 100644 --- a/trunk/includes/class/class.LSldapObject.php +++ b/trunk/includes/class/class.LSldapObject.php @@ -1226,7 +1226,15 @@ class LSldapObject { * @retval True en cas de cas ce succès, False sinon. */ function beforeDelete() { - return $this -> updateLSrelationsCache(); + $return = $this -> updateLSrelationsCache(); + + foreach(array_keys($this -> attrs) as $attr_name) { + if (!$this -> attrs[$attr_name] -> fireEvent('before_delete')) { + $return = false; + } + } + + return $return; } /** @@ -1277,6 +1285,12 @@ class LSldapObject { } } + foreach(array_keys($this -> attrs) as $attr_name) { + if (!$this -> attrs[$attr_name] -> fireEvent('after_delete')) { + $error = true; + } + } + return !$error; }