From 713cccedb19cd84cc79e3d56470e69577ead5ac3 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Sun, 22 Mar 2009 13:20:22 +0000 Subject: [PATCH] =?UTF-8?q?-=20LSldapObject=20:=20=09->=20Suppression=20de?= =?UTF-8?q?s=20constructeurs=20inutiles=20dans=20les=20classes=20=09=09=20?= =?UTF-8?q?filles.=20=09->=20Methode=20listObjectName()=20:=20rustine=20po?= =?UTF-8?q?ur=20g=C3=A9rer=20l'utili-=20=09=09=20sation=20des=20subDnNames?= =?UTF-8?q?=20dans=20les=20LSformats.=20Ceci=20devra=20=09=09=20=C3=AAtre?= =?UTF-8?q?=20corrig=C3=A9=20lors=20de=20la=20creation=20de=20LSsearch.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trunk/includes/class/class.LSldapObject.php | 28 +++++++++---------- .../class/class.LSobjects.LSeecompany.php | 18 +----------- .../class/class.LSobjects.LSeegroup.php | 17 ----------- .../class/class.LSobjects.LSeepeople.php | 18 +----------- 4 files changed, 15 insertions(+), 66 deletions(-) diff --git a/trunk/includes/class/class.LSldapObject.php b/trunk/includes/class/class.LSldapObject.php index baf97fb5..291dca5f 100644 --- a/trunk/includes/class/class.LSldapObject.php +++ b/trunk/includes/class/class.LSldapObject.php @@ -55,23 +55,18 @@ class LSldapObject { * * @author Benjamin Renard * - * @param[in] $type_name [required] string Le nom du type de l'objet - * @param[in] $config array La configuration de l'objet - * * @retval boolean true si l'objet a été construit, false sinon. */ - function LSldapObject($type_name,$config='auto') { - $this -> type_name = $type_name; - $this -> config = $config; - if($config=='auto') { - if(isset($GLOBALS['LSobjects'][$type_name])) { - $this -> config = $GLOBALS['LSobjects'][$type_name]; - } - else { - LSerror :: addErrorCode('LSldapObject_01'); - return; - } + function LSldapObject() { + $this -> type_name = get_class($this); + if(is_array($GLOBALS['LSobjects'][$this -> type_name])) { + $this -> config = $GLOBALS['LSobjects'][$this -> type_name]; } + else { + LSerror :: addErrorCode('LSldapObject_01'); + return; + } + foreach($this -> config['attrs'] as $attr_name => $attr_config) { if(!$this -> attrs[$attr_name]=new LSattribute($attr_name,$attr_config,$this)) { return; @@ -935,9 +930,12 @@ class LSldapObject { // Lancement de la recherche $ret=$this -> search ($filter,$sbasedn,$sparams); - + if (is_array($ret)) { foreach($ret as $obj) { + if (in_array('subDnName',$attrs)) { + $obj['attrs']['subDnName']=$this -> getSubDnName($obj['dn']); + } $retInfos[$obj['dn']] = getFData($displayFormat,$obj['attrs']); } } diff --git a/trunk/includes/class/class.LSobjects.LSeecompany.php b/trunk/includes/class/class.LSobjects.LSeecompany.php index 71023770..d2fe6470 100644 --- a/trunk/includes/class/class.LSobjects.LSeecompany.php +++ b/trunk/includes/class/class.LSobjects.LSeecompany.php @@ -26,23 +26,7 @@ * @author Benjamin Renard */ class LSeecompany extends LSldapObject { - - /** - * Constructeur - * - * Cette methode construit l'objet et définis la configuration. - * - * @author Benjamin Renard - * - * @param[in] $config array La configuration de l'objet - * - * @retval boolean true si l'objet a été construit, false sinon. - * - * @see LSldapObject::LSldapObject() - */ - function LSeecompany ($config='auto') { - $this -> LSldapObject('LSeecompany',$config); - } + // ~ } ?> diff --git a/trunk/includes/class/class.LSobjects.LSeegroup.php b/trunk/includes/class/class.LSobjects.LSeegroup.php index a6113de9..61a77dba 100644 --- a/trunk/includes/class/class.LSobjects.LSeegroup.php +++ b/trunk/includes/class/class.LSobjects.LSeegroup.php @@ -30,23 +30,6 @@ class LSeegroup extends LSldapObject { var $userObjectType = 'LSeepeople'; var $memberAttr = 'uniqueMember'; - /** - * Constructeur - * - * Cette methode construit l'objet et définis la configuration. - * - * @author Benjamin Renard - * - * @param[in] $config array La configuration de l'objet - * - * @retval boolean true si l'objet a été construit, false sinon. - * - * @see LSldapObject::LSldapObject() - */ - function LSeegroup ($config='auto') { - $this -> LSldapObject('LSeegroup',$config); - } - /* ========== Members ========== */ /** * Retourne la valeur clef d'un membre diff --git a/trunk/includes/class/class.LSobjects.LSeepeople.php b/trunk/includes/class/class.LSobjects.LSeepeople.php index f5209dd4..fc25d3ba 100644 --- a/trunk/includes/class/class.LSobjects.LSeepeople.php +++ b/trunk/includes/class/class.LSobjects.LSeepeople.php @@ -26,23 +26,7 @@ * @author Benjamin Renard */ class LSeepeople extends LSldapObject { - - /** - * Constructeur - * - * Cette methode construit l'objet et définis la configuration. - * - * @author Benjamin Renard - * - * @param[in] $config array La configuration de l'objet - * - * @retval boolean true si l'objet a été construit, false sinon. - * - * @see LSldapObject::LSldapObject() - */ - function LSeepeople ($config='auto') { - return $this -> LSldapObject('LSeepeople',$config); - } + // ~ } ?>