mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-18 00:09:06 +01:00
- LSldapObject :
-> Suppression des constructeurs inutiles dans les classes filles. -> Methode listObjectName() : rustine pour gérer l'utili- sation des subDnNames dans les LSformats. Ceci devra être corrigé lors de la creation de LSsearch.
This commit is contained in:
parent
505268a227
commit
713cccedb1
4 changed files with 15 additions and 66 deletions
|
@ -55,23 +55,18 @@ class LSldapObject {
|
||||||
*
|
*
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*
|
*
|
||||||
* @param[in] $type_name [<b>required</b>] 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.
|
* @retval boolean true si l'objet a été construit, false sinon.
|
||||||
*/
|
*/
|
||||||
function LSldapObject($type_name,$config='auto') {
|
function LSldapObject() {
|
||||||
$this -> type_name = $type_name;
|
$this -> type_name = get_class($this);
|
||||||
$this -> config = $config;
|
if(is_array($GLOBALS['LSobjects'][$this -> type_name])) {
|
||||||
if($config=='auto') {
|
$this -> config = $GLOBALS['LSobjects'][$this -> type_name];
|
||||||
if(isset($GLOBALS['LSobjects'][$type_name])) {
|
|
||||||
$this -> config = $GLOBALS['LSobjects'][$type_name];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
LSerror :: addErrorCode('LSldapObject_01');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
LSerror :: addErrorCode('LSldapObject_01');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
foreach($this -> config['attrs'] as $attr_name => $attr_config) {
|
foreach($this -> config['attrs'] as $attr_name => $attr_config) {
|
||||||
if(!$this -> attrs[$attr_name]=new LSattribute($attr_name,$attr_config,$this)) {
|
if(!$this -> attrs[$attr_name]=new LSattribute($attr_name,$attr_config,$this)) {
|
||||||
return;
|
return;
|
||||||
|
@ -935,9 +930,12 @@ class LSldapObject {
|
||||||
|
|
||||||
// Lancement de la recherche
|
// Lancement de la recherche
|
||||||
$ret=$this -> search ($filter,$sbasedn,$sparams);
|
$ret=$this -> search ($filter,$sbasedn,$sparams);
|
||||||
|
|
||||||
if (is_array($ret)) {
|
if (is_array($ret)) {
|
||||||
foreach($ret as $obj) {
|
foreach($ret as $obj) {
|
||||||
|
if (in_array('subDnName',$attrs)) {
|
||||||
|
$obj['attrs']['subDnName']=$this -> getSubDnName($obj['dn']);
|
||||||
|
}
|
||||||
$retInfos[$obj['dn']] = getFData($displayFormat,$obj['attrs']);
|
$retInfos[$obj['dn']] = getFData($displayFormat,$obj['attrs']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,23 +26,7 @@
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*/
|
*/
|
||||||
class LSeecompany extends LSldapObject {
|
class LSeecompany extends LSldapObject {
|
||||||
|
// ~
|
||||||
/**
|
|
||||||
* Constructeur
|
|
||||||
*
|
|
||||||
* Cette methode construit l'objet et définis la configuration.
|
|
||||||
*
|
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
|
||||||
*
|
|
||||||
* @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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -30,23 +30,6 @@ class LSeegroup extends LSldapObject {
|
||||||
var $userObjectType = 'LSeepeople';
|
var $userObjectType = 'LSeepeople';
|
||||||
var $memberAttr = 'uniqueMember';
|
var $memberAttr = 'uniqueMember';
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructeur
|
|
||||||
*
|
|
||||||
* Cette methode construit l'objet et définis la configuration.
|
|
||||||
*
|
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
|
||||||
*
|
|
||||||
* @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 ========== */
|
/* ========== Members ========== */
|
||||||
/**
|
/**
|
||||||
* Retourne la valeur clef d'un membre
|
* Retourne la valeur clef d'un membre
|
||||||
|
|
|
@ -26,23 +26,7 @@
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
*/
|
*/
|
||||||
class LSeepeople extends LSldapObject {
|
class LSeepeople extends LSldapObject {
|
||||||
|
// ~
|
||||||
/**
|
|
||||||
* Constructeur
|
|
||||||
*
|
|
||||||
* Cette methode construit l'objet et définis la configuration.
|
|
||||||
*
|
|
||||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
|
||||||
*
|
|
||||||
* @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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in a new issue