2 /*******************************************************************************
3 * Copyright (C) 2007 Easter-eggs
4 * http://ldapsaisie.labs.libre-entreprise.org
6 * Author: See AUTHORS file in top-level directory.
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License version 2
10 * as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 ******************************************************************************/
23 LSsession :: loadLSclass('LSattribute');
26 * Base d'un objet ldap
28 * Cette classe définis la base de tout objet ldap géré par LdapSaisie
30 * @author Benjamin Renard <brenard@easter-eggs.com>
34 var $config = array();
41 var $other_values=array();
43 var $_LSrelationsCache=array();
46 var $_objectEvents=array();
53 * Cette methode construit l'objet et définis la configuration.
54 * Elle lance la construction du tableau d'attributs représentés par un objet LSattribute.
56 * @author Benjamin Renard <brenard@easter-eggs.com>
58 * @retval boolean true si l'objet a été construit, false sinon.
60 function LSldapObject() {
61 $this -> type_name = get_class($this);
62 $config = LSconfig :: get('LSobjects.'.$this -> type_name);
63 if(is_array($config)) {
64 $this -> config = $config;
67 LSerror :: addErrorCode('LSldapObject_01');
71 foreach($this -> config['attrs'] as $attr_name => $attr_config) {
72 if(!$this -> attrs[$attr_name]=new LSattribute($attr_name,$attr_config,$this)) {
81 * Charge les données de l'objet
83 * Cette methode définis le DN de l'objet et charge les valeurs de attributs de l'objet
84 * Ã partir de l'annuaire.
86 * @author Benjamin Renard <brenard@easter-eggs.com>
88 * @param[in] $dn string Le DN de l'objet.
90 * @retval boolean true si la chargement a réussi, false sinon.
92 function loadData($dn) {
94 $data = LSldap :: getAttrs($dn);
96 foreach($this -> attrs as $attr_name => $attr) {
97 if( !$this -> attrs[$attr_name] -> loadData( (isset($data[$attr_name])?$data[$attr_name]:NULL) ) )
100 $this->cache=array();
107 * Recharge les données de l'objet
109 * @author Benjamin Renard <brenard@easter-eggs.com>
111 * @retval boolean true si la rechargement a réussi, false sinon.
113 function reloadData() {
114 $data = LSldap :: getAttrs($this -> dn);
115 foreach($this -> attrs as $attr_name => $attr) {
116 if(!$this -> attrs[$attr_name] -> reloadData( (isset($data[$attr_name])?$data[$attr_name]:NULL) ))
123 * Retourne le format d'affichage de l'objet
125 * @author Benjamin Renard <brenard@easter-eggs.com>
127 * @retval string Format d'affichage de l'objet.
129 function getDisplayNameFormat() {
130 return $this -> config['display_name_format'];
134 * Retourne la valeur descriptive d'affichage de l'objet
136 * Cette fonction retourne la valeur descriptive d'affichage de l'objet en fonction
137 * du format défini dans la configuration de l'objet ou spécifié en paramètre.
139 * @author Benjamin Renard <brenard@easter-eggs.com>
141 * @param[in] $spe [<i>optionnel</i>] string Format d'affichage de l'objet
142 * @param[in] $full [<i>optionnel</i>] boolean True pour afficher en plus le
145 * @retval string Valeur descriptive d'affichage de l'objet
147 function getDisplayName($spe='',$full=false) {
149 $spe = $this -> getDisplayNameFormat();
151 $val = $this -> getFData($spe,$this -> attrs,'getDisplayValue');
152 if (LSsession :: haveSubDn() && $full) {
153 $val.=' ('.$this -> subDnName.')';
161 * Cette fonction retourne la valeur d'une chaine formatée en prennant les valeurs
164 * @author Benjamin Renard <brenard@easter-eggs.com>
166 * @param[in] $format string Format de la chaine
168 * @retval string Valeur d'une chaine formatée
170 function getFData($format) {
171 $format=getFData($format,$this,'getValue');
178 * Cette fonction retourne la valeur d'une chaine formatee en prennant les valeurs
179 * d'affichage de l'objet.
181 * @author Benjamin Renard <brenard@easter-eggs.com>
183 * @param[in] $format string Format de la chaine
185 * @retval string Valeur d'une chaine formatee
187 function getDisplayFData($format) {
188 return getFData($format,$this,'getDisplayValue');
192 * Construit un formulaire de l'objet
194 * Cette méthode construit un formulaire LSform à partir de la configuration de l'objet
195 * et de chaque attribut.
197 * @param[in] $idForm [<b>required</b>] Identifiant du formulaire a créer
198 * @param[in] $load DN d'un objet similaire dont la valeur des attribut doit être chargé dans le formulaire.
200 * @author Benjamin Renard <brenard@easter-eggs.com>
202 * @retval LSform Le formulaire crée
204 function getForm($idForm,$load=NULL) {
205 LSsession :: loadLSclass('LSform');
206 $LSform = new LSform($this,$idForm);
207 $this -> forms[$idForm] = array($LSform,$load);
210 $type = $this -> getType();
211 $loadObject = new $type();
212 if (!$loadObject -> loadData($load)) {
218 foreach($this -> attrs as $attr_name => $attr) {
219 if(!$this -> attrs[$attr_name] -> addToForm($LSform,$idForm,$this,$loadObject -> attrs[$attr_name] -> getFormVal())) {
220 $LSform -> can_validate = false;
225 foreach($this -> attrs as $attr_name => $attr) {
226 if(!$this -> attrs[$attr_name] -> addToForm($LSform,$idForm,$this)) {
227 $LSform -> can_validate = false;
235 * Construit un formulaire de l'objet
237 * Cette méthode construit un formulaire LSform à partir de la configuration de l'objet
238 * et de chaque attribut.
240 * @param[in] $idForm [<b>required</b>] Identifiant du formulaire a créer
241 * @param[in] $config Configuration spécifique pour le formulaire
243 * @author Benjamin Renard <brenard@easter-eggs.com>
245 * @retval LSform Le formulaire crée
248 LSsession :: loadLSclass('LSform');
249 $this -> view = new LSform($this,'view');
250 foreach($this -> attrs as $attr_name => $attr) {
251 $this -> attrs[$attr_name] -> addToView($this -> view);
253 $this -> view -> can_validate = false;
254 return $this -> view;
258 * Rafraichis le formulaire de l'objet
260 * Cette méthode recharge les données d'un formulaire LSform.
262 * @param[in] $idForm [<b>required</b>] Identifiant du formulaire a créer
264 * @author Benjamin Renard <brenard@easter-eggs.com>
266 * @retval boolean true sile formulaire a été rafraichis, false sinon
268 function refreshForm($idForm) {
269 $LSform = $this -> forms[$idForm][0];
270 foreach($this -> attrs as $attr_name => $attr) {
271 if(!$this -> attrs[$attr_name] -> refreshForm($LSform,$idForm)) {
279 * Met à jour les données de l'objet à partir d'un retour d'un formulaire.
281 * @param[in] $idForm Identifiant du formulaire d'origine
283 * @author Benjamin Renard <brenard@easter-eggs.com>
285 * @retval boolean true si la mise à jour a réussi, false sinon
287 public function updateData($idForm=NULL) {
289 if(isset($this -> forms[$idForm]))
290 $LSform = $this -> forms[$idForm][0];
292 LSerror :: addErrorCode('LSldapObject_02',$this -> getType());
297 if(count($this -> forms) > 0) {
298 reset($this -> forms);
299 $idForm = key($this -> forms);
300 $LSform = current($this -> forms);
301 $config = $LSform[1];
302 $LSform = $LSform[0];
305 LSerror :: addErrorCode('LSldapObject_03',$this -> getType());
309 $new_data = $LSform -> exportValues();
310 return $this -> _updateData($new_data,$idForm);
314 * Met à jour les données de l'objet et de l'entré de l'annuaire
316 * @param[in] $new_data Tableau des données de modification de l'objet
318 * @author Benjamin Renard <brenard@easter-eggs.com>
320 * @retval boolean true si la mise à jour a réussi, false sinon
322 * @see validateAttrsData()
323 * @see submitChange()
325 private function _updateData($new_data,$idForm=null) {
326 if(!is_array($new_data)) {
329 foreach($new_data as $attr_name => $attr_val) {
330 if(isset($this -> attrs[$attr_name])) {
331 $this -> attrs[$attr_name] -> setUpdateData($attr_val);
334 if($this -> validateAttrsData($idForm)) {
335 LSdebug("les données sont validées");
337 if (!$this -> fireEvent('before_modify')) {
341 // $this -> attrs[ {inNewData} ] -> fireEvent('before_modify')
342 foreach($new_data as $attr_name => $attr_val) {
343 if ($this -> attrs[$attr_name] -> isUpdate() && !$this -> attrs[$attr_name] -> fireEvent('before_modify')) {
348 if ($this -> submitChange($idForm)) {
349 LSdebug('Les modifications sont submitées');
350 // Event After Modify
351 $this -> fireEvent('after_modify');
353 // $this -> attrs[*] => After Modify
354 foreach($new_data as $attr_name => $attr_val) {
355 if ($this -> attrs[$attr_name] -> isUpdate()) {
356 $this -> attrs[$attr_name] -> fireEvent('after_modify');
359 $this -> reloadData();
360 $this -> refreshForm($idForm);
374 * Valide les données retournées par un formulaire
376 * @param[in] $idForm Identifiant du formulaire d'origine
378 * @author Benjamin Renard <brenard@easter-eggs.com>
380 * @retval boolean true si les données sont valides, false sinon
382 function validateAttrsData($idForm=null) {
385 $LSform=$this -> forms[$idForm][0];
390 foreach($this -> attrs as $attr) {
391 $attr_values = $attr -> getValue();
392 if (!$attr -> isValidate()) {
393 if($attr -> isUpdate()) {
394 if (!$this -> validateAttrData($LSform, $attr)) {
398 else if( (empty($attr_values)) && ($attr -> isRequired()) ) {
399 if ( $attr -> canBeGenerated()) {
400 if ($attr -> generateValue()) {
401 if (!$this -> validateAttrData($LSform, $attr)) {
402 LSerror :: addErrorCode('LSattribute_08',$attr -> getLabel());
407 LSerror :: addErrorCode('LSattribute_07',$attr -> getLabel());
412 LSerror :: addErrorCode('LSattribute_06',$attr -> getLabel());
422 * Valide les données d'un attribut
424 * @param[in] $LSForm Formulaire d'origine
425 * @param[in] &$attr Attribut à valider
427 * @author Benjamin Renard <brenard@easter-eggs.com>
429 * @retval boolean true si les données sont valides, false sinon
431 function validateAttrData(&$LSform,&$attr) {
434 $vconfig=$attr -> getValidateConfig();
436 $data=$attr -> getUpdateData();
437 if(!is_array($data)) {
441 // Validation des valeurs de l'attribut
442 if(is_array($vconfig)) {
443 foreach($vconfig as $test) {
444 // Définition du basedn par défaut
445 if (!isset($test['basedn'])) {
446 $test['basedn']=LSsession :: getTopDn();
449 // Définition du message d'erreur
450 if (!empty($test['msg'])) {
451 $msg_error=getFData(__($test['msg']),$this,'getValue');
454 $msg_error=getFData(_("The attribute %{attr} is not valid."),$attr -> getLabel());
456 foreach($data as $val) {
457 // validation par check LDAP
458 if((isset($test['filter'])||isset($test['basedn']))&&(isset($test['result']))) {
459 $sparams=(isset($test['scope']))?array('scope' => $test['scope']):array();
460 $this -> other_values['val']=$val;
461 $sfilter_user=(isset($test['filter']))?getFData($test['filter'],$this,'getValue'):NULL;
462 if(isset($test['object_type'])) {
463 $test_obj = new $test['object_type']();
464 $sfilter=$test_obj->getObjectFilter();
466 $sfilter='(&'.$sfilter;
467 if($sfilter_user[0]=='(') {
468 $sfilter=$sfilter.$sfilter_user.')';
471 $sfilter=$sfilter.'('.$sfilter_user.'))';
476 $sfilter=$sfilter_user;
478 $sbasedn=(isset($test['basedn']))?getFData($test['basedn'],$this,'getValue'):NULL;
479 $ret=LSldap :: getNumberResult ($sfilter,$sbasedn,$sparams);
480 if($test['result']==0) {
482 if ($LSform) $LSform -> setElementError($attr,$msg_error);
488 if ($LSform) $LSform -> setElementError($attr,$msg_error);
493 // Validation par fonction externe
494 else if(isset($test['function'])) {
495 if (function_exists($test['function'])) {
496 if(!$test['function']($this)) {
497 if ($LSform) $LSform -> setElementError($attr,$msg_error);
502 LSerror :: addErrorCode('LSldapObject_04',array('attr' => $attr->name,'obj' => $this->getType(),'func' => $test['function']));
507 LSerror :: addErrorCode('LSldapObject_05',array('attr' => $attr->name,'obj' => $this->getType()));
513 // Génération des valeurs des attributs dépendants
514 $dependsAttrs=$attr->getDependsAttrs();
515 if (!empty($dependsAttrs)) {
516 foreach($dependsAttrs as $dependAttr) {
517 if(!isset($this -> attrs[$dependAttr])){
518 LSerror :: addErrorCode('LSldapObject_14',array('attr_depend' => $dependAttr, 'attr' => $attr -> getLabel()));
521 if($this -> attrs[$dependAttr] -> canBeGenerated()) {
522 if (!$this -> attrs[$dependAttr] -> generateValue()) {
523 LSerror :: addErrorCode('LSattribute_07',$this -> attrs[$dependAttr] -> getLabel());
526 elseif (!$this -> validateAttrData($LSform,$this -> attrs[$dependAttr])) {
527 LSerror :: addErrorCode('LSattribute_08',$this -> attrs[$dependAttr] -> getLabel());
532 LSerror :: addErrorCode('LSattribute_06',$this -> attrs[$dependAttr] -> getLabel());
539 unset($this -> other_values['val']);
544 * Met à jour les données modifiés dans l'annuaire
546 * @param[in] $idForm Identifiant du formulaire d'origine
548 * @author Benjamin Renard <brenard@easter-eggs.com>
550 * @retval boolean true si la mise à jour a réussi, false sinon
552 function submitChange($idForm) {
554 $new = $this -> isNew();
555 foreach($this -> attrs as $attr) {
556 if(($attr -> isUpdate())&&($attr -> isValidate())) {
557 if(($attr -> name == $this -> config['rdn'])&&(!$new)) {
560 if (!$this -> fireEvent('before_rename')) {
561 LSerror :: addErrorCode('LSldapObject_16');
564 $oldDn = $this -> getDn();
566 $newDn = $this -> getDn();
568 if (!LSldap :: move($oldDn,$newDn)) {
571 $this -> dn = $newDn;
572 $this -> oldDn = $oldDn;
573 if (!$this -> fireEvent('after_rename')) {
574 LSerror :: addErrorCode('LSldapObject_17');
583 $submitData[$attr -> name] = $attr -> getUpdateData();
587 if(!empty($submitData)) {
588 $dn=$this -> getDn();
591 LSdebug($submitData);
593 if (!$this -> fireEvent('before_create')) {
594 LSerror :: addErrorCode('LSldapObject_20');
597 foreach ($submitData as $attr_name => $attr) {
598 if (!$this -> attrs[$attr_name] -> fireEvent('before_create')) {
599 LSerror :: addErrorCode('LSldapObject_20');
604 if (!LSldap :: update($this -> getType(),$dn, $submitData)) {
608 if (!$this -> fireEvent('after_create')) {
609 LSerror :: addErrorCode('LSldapObject_21');
612 foreach ($submitData as $attr_name => $attr) {
613 if (!$this -> attrs[$attr_name] -> fireEvent('after_create')) {
614 LSerror :: addErrorCode('LSldapObject_21');
622 LSerror :: addErrorCode('LSldapObject_13');
632 * Retourne les informations issus d'un DN
634 * @param[in] $dn Un DN.
636 * @author Benjamin Renard <brenard@easter-eggs.com>
638 * @retval array Tableau :
639 * - [0] : le premier paramètre
640 * - [1] : les paramètres suivants
642 function getDnInfos($dn) {
643 $infos=ldap_explode_dn($dn,0);
647 for($i=1;$i<$infos['count'];$i++)
653 $basedn.=','.$infos[$i];
654 return array($infos[0],$basedn);
658 * Retourne le filtre correpondants aux objetcClass de l'objet
660 * @author Benjamin Renard <brenard@easter-eggs.com>
662 * @retval string le filtre ldap correspondant au type de l'objet
664 function getObjectFilter($type=null) {
665 if (is_null($type)) {
666 $type = $this -> type_name;
668 $oc=LSconfig::get("LSobjects.$type.objectclass");
669 if(!is_array($oc)) return;
671 foreach ($oc as $class) {
672 $filters[]=Net_LDAP2_Filter::create('objectClass','equals',$class);
675 $filter=LSconfig::get("LSobjects.$type.filter");
680 $filter = LSldap::combineFilters('and',$filters,true);
683 LSerror :: addErrorCode('LSldapObject_30',$type);
688 * Retourne le filtre correpondants au pattern passé
690 * @author Benjamin Renard <brenard@easter-eggs.com>
692 * @param[in] $pattern string Le mot clé recherché
693 * @param[in] $approx booléen Booléen activant ou non la recherche approximative
695 * @retval string le filtre ldap correspondant
697 function getPatternFilter($pattern=null,$approx=null) {
698 if ($pattern!=NULL) {
700 if (is_array($this -> config['LSsearch']['attrs'])) {
701 foreach ($this -> config['LSsearch']['attrs'] as $key => $val) {
703 $attrs[$val]=array();
711 $attrs=array($this -> config['rdn'] => array());
715 foreach ($attrs as $attr_name => $attr_opts) {
716 if (isset($attr_opts['approxLSformat'])) {
717 $pfilter.=getFData($attr_opts['approxLSformat'],array('name' => $attr_name, 'pattern' => $pattern));
720 $pfilter.='('.$attr_name.'~='.$pattern.')';
725 foreach ($attrs as $attr_name => $attr_opts) {
726 if (isset($attr_opts['searchLSformat'])) {
727 $pfilter.=getFData($attr_opts['searchLSformat'],array('name' => $attr_name, 'pattern' => $pattern));
730 $pfilter.='('.$attr_name.'=*'.$pattern.'*)';
743 * Retourne une liste d'objet du même type.
745 * Effectue une recherche en fonction des paramètres passé et retourne un
746 * tableau d'objet correspond au resultat de la recherche.
748 * @author Benjamin Renard <brenard@easter-eggs.com>
750 * @param[in] $filter array (ou string) Filtre de recherche Ldap / Tableau de filtres de recherche
751 * @param[in] $basedn string DN de base pour la recherche
752 * @param[in] $params array Paramètres de recherche au format Net_LDAP2::search()
754 * @retval array Tableau d'objets correspondant au resultat de la recherche
756 function listObjects($filter=NULL,$basedn=NULL,$params=array()) {
757 if (!LSsession :: loadLSclass('LSsearch')) {
758 LSerror::addErrorCode('LSsession_05','LSsearch');
767 if (is_array($params)) {
768 $sparams=array_merge($sparams,$params);
770 $LSsearch = new LSsearch($this -> type_name,'LSldapObjet::listObjects',$sparams,true);
774 return $LSsearch -> listObjects();
778 * Retourne une liste d'objet du même type et retourne leur noms
780 * Effectue une recherche en fonction des paramètres passé et retourne un
781 * tableau (dn => nom) correspondant au resultat de la recherche.
783 * @author Benjamin Renard <brenard@easter-eggs.com>
785 * @param[in] $filter string Filtre de recherche Ldap
786 * @param[in] $basedn string DN de base pour la recherche
787 * @param[in] $params array Paramètres de recherche au format Net_LDAP2::search()
788 * @param[in] $displayFormat string Format d'affichage du nom des objets
790 * @retval array Tableau dn => name correspondant au resultat de la recherche
792 function listObjectsName($filter=NULL,$sbasedn=NULL,$sparams=array(),$displayFormat=false,$cache=true) {
793 if (!LSsession :: loadLSclass('LSsearch')) {
794 LSerror::addErrorCode('LSsession_05','LSsearch');
798 if (!$displayFormat) {
799 $displayFormat = $this -> getDisplayNameFormat();
803 'displayFormat' => $displayFormat,
804 'basedn' => $sbasedn,
808 if (is_array($sparams)) {
809 $params=array_merge($sparams,$params);
812 $LSsearch = new LSsearch($this -> type_name,'LSldapObject::listObjectsName',$params,true);
814 $LSsearch -> run($cache);
816 return $LSsearch -> listObjectsName();
821 * Recherche un objet à partir de la valeur exact de son RDN ou d'un filtre de
822 * recherche LDAP sous la forme d'un LSformat qui sera construit avec la valeur
825 * @author Benjamin Renard <brenard@easter-eggs.com>
827 * @param[in] $name string Valeur de son RDN ou de la valeur pour composer le filtre
828 * @param[in] $basedn string Le DN de base de la recherche
829 * @param[in] $filter string Le filtre de recherche de l'objet
830 * @param[in] $params array Tableau de paramètres
832 * @retval array Tableau d'objets correspondant au resultat de la recherche
834 function searchObject($name,$basedn=NULL,$filter=NULL,$params=NULL) {
836 $filter = '('.$this -> config['rdn'].'='.$name.')';
839 $filter = getFData($filter,$name);
841 return $this -> listObjects($filter,$basedn,$params);
845 * Retourne une valeur de l'objet
847 * Retourne une valeur en fonction du paramètre. Si la valeur est inconnue, la valeur retourné est ' '.
848 * tableau d'objet correspond au resultat de la recherche.
850 * Valeurs possibles :
851 * - 'dn' ou '%{dn} : DN de l'objet
852 * - [nom d'un attribut] : valeur de l'attribut
853 * - [clef de $this -> other_values] : valeur de $this -> other_values
855 * @author Benjamin Renard <brenard@easter-eggs.com>
857 * @param[in] $val string Le nom de la valeur demandée
859 * @retval mixed la valeur demandé ou ' ' si celle-ci est inconnue.
861 function getValue($val) {
862 if(($val=='dn')||($val=='%{dn}')) {
865 else if(($val=='rdn')||($val=='%{rdn}')) {
866 return $this -> attrs[ $this -> config['rdn'] ] -> getValue();
868 else if(($val=='subDn')||($val=='%{subDn}')) {
869 return $this -> subDnValue;
871 else if(($val=='subDnName')||($val=='%{subDnName}')) {
872 return $this -> subDnName;
874 else if(isset($this -> attrs[$val])){
875 if (method_exists($this -> attrs[$val],'getValue'))
876 return $this -> attrs[$val] -> getValue();
880 else if(isset($this -> other_values[$val])){
881 return $this -> other_values[$val];
889 * Retourne une valeur d'affichage de l'objet
891 * @author Benjamin Renard <brenard@easter-eggs.com>
893 * @param[in] $val string Le nom de la valeur demandee
895 * @retval mixed la valeur demandee ou ' ' si celle-ci est inconnue.
897 function getDisplayValue($val) {
898 if(isset($this -> attrs[$val])){
899 if (method_exists($this -> attrs[$val],'getDisplayValue'))
900 return $this -> attrs[$val] -> getDisplayValue();
905 return $this -> getValue($val);
910 * Ajoute une valeur dans le tableau $this -> other_values
912 * @param[in] $name string Le nom de la valeur
913 * @param[in] $value mixed La valeur
917 function registerOtherValue($name,$value) {
918 $this -> other_values[$name]=$value;
922 * Retourn un tableau pour un select d'un objet du même type
924 * @author Benjamin Renard <brenard@easter-eggs.com>
926 * @retval array('dn' => 'display')
928 function getSelectArray($pattern=NULL,$topDn=NULL,$displayFormat=NULL,$approx=false,$cache=true,$filter=NULL) {
929 return $this -> listObjectsName($filter,$topDn,array('pattern' => $pattern),$displayFormat,$cache);
933 * Retourne le DN de l'objet
935 * Cette methode retourne le DN de l'objet. Si celui-ci n'existe pas, il le construit à partir de la
936 * configuration de l'objet et la valeur de son attribut rdn.
938 * @author Benjamin Renard <brenard@easter-eggs.com>
940 * @retval string Le DN de l'objet
947 $rdn_attr=$this -> config['rdn'];
948 $topDn = LSsession :: getTopDn();
949 if( (isset($this -> config['rdn'])) && (isset($this -> attrs[$rdn_attr])) && (isset($this -> config['container_dn'])) && ($topDn) ) {
950 $rdn_val=$this -> attrs[$rdn_attr] -> getUpdateData();
951 if (!empty($rdn_val)) {
952 return $rdn_attr.'='.$rdn_val[0].','.$this -> config['container_dn'].','.$topDn;
955 LSerror :: addErrorCode('LSldapObject_12',$this -> config['rdn']);
960 LSerror :: addErrorCode('LSldapObject_11',$this -> getType());
967 * Retourne le type de l'objet
969 * @author Benjamin Renard <brenard@easter-eggs.com>
971 * @retval string Le type de l'objet ($this -> type_name)
974 return $this -> type_name;
978 * Retourne qui est l'utilisateur par rapport à cet object
980 * @author Benjamin Renard <brenard@easter-eggs.com>
982 * @retval string 'admin'/'self'/'user' pour Admin , l'utilisateur lui même ou un simple utilisateur
985 if (!$this -> _whoami)
986 $this -> _whoami = LSsession :: whoami($this -> dn);
987 return $this -> _whoami;
991 * Retourne le label de l'objet
993 * @author Benjamin Renard <brenard@easter-eggs.com>
995 * @retval string Le label de l'objet ($this -> config['label'])
997 function getLabel($type=null) {
998 if (is_null($type)) {
999 $type = $this -> type_name;
1001 return __(LSconfig::get("LSobjects.$type.label"));
1006 * Supprime l'objet dans l'annuaire
1008 * @author Benjamin Renard <brenard@easter-eggs.com>
1010 * @retval boolean True si l'objet à été supprimé, false sinon
1013 if ($this -> fireEvent('before_delete')) {
1014 if (LSldap :: remove($this -> getDn())) {
1015 if ($this -> fireEvent('after_delete')) {
1018 LSerror :: addErrorCode('LSldapObject_19');
1022 LSerror :: addErrorCode('LSldapObject_18');
1028 * L'objet est-il nouveau
1030 * @author Benjamin Renard <brenard@easter-eggs.com>
1032 * @retval boolean True si l'objet est nouveau, false sinon
1035 return (!$this -> dn);
1039 * Retourne la valeur (DN) du subDn de l'objet
1041 * @parram[in] $dn string Un DN
1043 * @return string La valeur du subDn de l'object
1045 public static function getSubDnValue($dn) {
1047 $subDnLdapServer = LSsession :: getSortSubDnLdapServer();
1048 foreach ($subDnLdapServer as $subDn => $subDn_name) {
1049 if (isCompatibleDNs($subDn,$dn)&&($subDn!=$dn)) {
1050 $subDn_value=$subDn;
1054 return $subDn_value;
1058 * Retourne la nom du subDn de l'objet
1060 * @parram[in] $dn string Un DN
1062 * @return string Le nom du subDn de l'object
1064 public static function getSubDnName($dn) {
1065 $subDnLdapServer = LSsession :: getSortSubDnLdapServer();
1066 return $subDnLdapServer[self :: getSubDnValue($dn)];
1070 * Methode créant la liste des objets en relations avec l'objet courant et qui
1071 * la met en cache ($this -> _LSrelationsCache)
1073 * @retval True en cas de cas ce succès, False sinon.
1075 function updateLSrelationsCache() {
1076 $this -> _LSrelationsCache=array();
1077 if (is_array($this->config['LSrelation'])) {
1078 $type = $this -> getType();
1080 $me -> loadData($this -> getDn());
1081 foreach($this->config['LSrelation'] as $relation_name => $relation_conf) {
1082 if ( isset($relation_conf['list_function']) ) {
1083 if (LSsession :: loadLSobject($relation_conf['LSobject'])) {
1084 $obj = new $relation_conf['LSobject']();
1085 if ((method_exists($obj,$relation_conf['list_function']))&&(method_exists($obj,$relation_conf['getkeyvalue_function']))) {
1086 $list = $obj -> $relation_conf['list_function']($me);
1087 if (is_array($list)) {
1089 $key = $obj -> $relation_conf['getkeyvalue_function']($me);
1091 $this -> _LSrelationsCache[$relation_name] = array(
1097 LSdebug('Problème durant la mise en cache de la relation '.$relation_name);
1102 LSdebug('Les méthodes de mise en cache de la relation '.$relation_name. ' ne sont pas toutes disponibles.');
1116 * Methode executant les actions nécéssaires avant le changement du DN de
1119 * Cette méthode n'est qu'un exemple et elle doit être certainement réécrite
1120 * pour les objets plus complexe.
1122 * @retval True en cas de cas ce succès, False sinon.
1124 function beforeRename() {
1126 return $this -> updateLSrelationsCache();
1130 * Methode executant les actions nécéssaires après le changement du DN de
1133 * Cette méthode n'est qu'un exemple et elle doit être certainement réécrite
1134 * pour les objets plus complexe.
1136 * @retval True en cas de cas ce succès, False sinon.
1138 function afterRename() {
1141 // Change LSsession -> userObject Dn
1142 if(LSsession :: getLSuserObjectDn() == $this -> oldDn) {
1143 LSsession :: changeAuthUser($this);
1147 foreach($this -> _LSrelationsCache as $relation_name => $objInfos) {
1148 if ((isset($this->config['LSrelation'][$relation_name]['rename_function']))&&(is_array($objInfos['list']))) {
1149 foreach($objInfos['list'] as $obj) {
1150 $meth = $this->config['LSrelation'][$relation_name]['rename_function'];
1151 if (method_exists($obj,$meth)) {
1152 if (!($obj -> $meth($this,$objInfos['keyvalue']))) {
1166 * Methode executant les actions nécéssaires avant la suppression de
1169 * Cette méthode n'est qu'un exemple et elle doit être certainement réécrite
1170 * pour les objets plus complexe.
1172 * @retval True en cas de cas ce succès, False sinon.
1174 function beforeDelete() {
1175 $return = $this -> updateLSrelationsCache();
1177 foreach(array_keys($this -> attrs) as $attr_name) {
1178 if (!$this -> attrs[$attr_name] -> fireEvent('before_delete')) {
1187 * Methode executant les actions nécéssaires après la suppression de
1190 * Cette méthode n'est qu'un exemple et elle doit être certainement réécrite
1191 * pour les objets plus complexe.
1193 * @retval True en cas de cas ce succès, False sinon.
1195 function afterDelete() {
1199 foreach($this -> _LSrelationsCache as $relation_name => $objInfos) {
1200 if ((isset($this->config['LSrelation'][$relation_name]['remove_function']))&&(is_array($objInfos['list']))) {
1201 foreach($objInfos['list'] as $obj) {
1202 $meth = $this->config['LSrelation'][$relation_name]['remove_function'];
1203 if (method_exists($obj,$meth)) {
1204 if (!($obj -> $meth($this))) {
1215 // Binding LSattributes
1216 foreach(array_keys($this -> attrs) as $attr_name) {
1217 if (!$this -> attrs[$attr_name] -> fireEvent('after_delete')) {
1222 // LSsearch : Purge LSobject cache
1223 if (LSsession :: loadLSclass('LSsearch')) {
1224 LSsearch :: purgeCache($this -> type_name);
1231 * Methode executant les actions nécéssaires après la création de
1234 * Cette méthode n'est qu'un exemple et elle doit être certainement réécrite
1235 * pour les objets plus complexe.
1237 * @retval True en cas de cas ce succès, False sinon.
1239 function afterCreate() {
1243 // container_auto_create
1244 if (LSsession :: isSubDnLSobject($this -> getType())) {
1245 if (is_array(LSsession :: $ldapServer['subDn']['LSobject'][$this -> getType()]['LSobjects'])) {
1246 foreach(LSsession :: $ldapServer['subDn']['LSobject'][$this -> getType()]['LSobjects'] as $type) {
1247 if (LSsession :: loadLSobject($type)) {
1248 $conf_type=LSconfig :: get("LSobjects.$type");
1249 if (isset($conf_type['container_auto_create'])&&isset($conf_type['container_dn'])) {
1250 $dn = $conf_type['container_dn'].','.$this -> getDn();
1251 if(!LSldap :: getNewEntry($dn,$conf_type['container_auto_create']['objectclass'],$conf_type['container_auto_create']['attrs'],true)) {
1252 LSdebug("Impossible de créer l'entrée fille : ".print_r(
1255 'objectClass' => $conf_type['container_auto_create']['objectclass'],
1256 'attrs' => $conf_type['container_auto_create']['attrs']
1270 // LSsearch : Purge LSobject cache
1271 if (LSsession :: loadLSclass('LSsearch')) {
1272 LSsearch :: purgeCache($this -> type_name);
1279 * Methode executant les actions nécéssaires après la modification de
1282 * Cette méthode n'est qu'un exemple et elle doit être certainement réécrite
1283 * pour les objets plus complexe.
1285 * @retval True en cas de cas ce succès, False sinon.
1287 function afterModify() {
1290 // LSsearch : Purge LSobject cache
1291 if (LSsession :: loadLSclass('LSsearch')) {
1292 LSsearch :: purgeCache($this -> type_name);
1299 * Retourne la valeur clef d'un objet en relation
1301 * @param[in] $object Un object de type $objectType
1302 * @param[in] $objectType Le type d'objet en relation
1303 * @param[in] $value La valeur que doit avoir l'attribut :
1304 * - soit le dn (par defaut)
1305 * - soit la valeur [0] d'un attribut
1307 * @retval Mixed La valeur clef d'un objet en relation
1309 function getObjectKeyValueInRelation($object,$objectType,$attrValue='dn') {
1311 LSerror :: addErrorCode('LSrelations_05','getObjectKeyValueInRelation');
1314 if ($attrValue=='dn') {
1315 $val = $object -> getDn();
1318 $val = $object -> getValue($attrValue);
1325 * Retourne la liste des relations pour l'objet en fonction de sa présence
1326 * dans un des attributs
1328 * Retourne un tableau de d'objet (type : $objectType) correspondant à la
1329 * relation entre l'objet $object et les objets de type $objectType. Cette relation
1330 * est établis par la présence de la valeur de référence à l'objet dans
1331 * l'attribut des objets de type $objectType.
1333 * @param[in] $object Un object de type $objectType
1334 * @param[in] $attr L'attribut dans lequel l'objet doit apparaitre
1335 * @param[in] $objectType Le type d'objet en relation
1336 * @param[in] $value La valeur que doit avoir l'attribut :
1337 * - soit le dn (par defaut)
1338 * - soit la valeur [0] d'un attribut
1340 * @retval Array of $objectType Les objets en relations
1342 function listObjectsInRelation($object,$attr,$objectType,$attrValue='dn') {
1343 if ((!$attr)||(!$objectType)) {
1344 LSerror :: addErrorCode('LSrelations_05','listObjectsInRelation');
1347 if ($attrValue=='dn') {
1348 $val = $object -> getDn();
1351 $val = $object -> getValue($attrValue);
1355 $filter = Net_LDAP2_Filter::create($attr,'equals',$val);
1356 return $this -> listObjects($filter,LSsession :: getRootDn(),array('scope' => 'sub','recursive' => true,'withoutCache'=>true));
1362 * Ajoute un objet en relation dans l'attribut $attr de $this
1364 * @param[in] $object Un objet de type $objectType à ajouter
1365 * @param[in] $attr L'attribut dans lequel l'objet doit être ajouté
1366 * @param[in] $objectType Le type d'objet en relation
1367 * @param[in] $attrValue La valeur que doit avoir l'attribut :
1368 * - soit le dn (par defaut)
1369 * - soit la valeur [0] d'un attribut
1370 * @param[in] $canEditFunction Le nom de la fonction pour vérifier que la
1371 * relation avec l'objet est éditable par le user
1373 * @retval boolean true si l'objet à été ajouté, False sinon
1375 function addOneObjectInRelation($object,$attr,$objectType,$attrValue='dn',$canEditFunction=NULL) {
1376 if ((!$attr)||(!$objectType)) {
1377 LSerror :: addErrorCode('LSrelations_05','addOneObjectInRelation');
1380 if ($object instanceof $objectType) {
1381 if ($canEditFunction) {
1382 if (!$this -> $canEditFunction()) {
1383 LSerror :: addErrorCode('LSsession_11');
1387 if ($this -> attrs[$attr] instanceof LSattribute) {
1388 if ($attrValue=='dn') {
1389 $val = $object -> getDn();
1392 $val = $object -> getValue($attrValue);
1395 $values = $this -> attrs[$attr] -> getValue();
1396 if ($this -> attrs[$attr] -> config['multiple']) {
1397 if (!is_array($values)) {
1398 $updateData = array($val);
1400 else if (!in_array($val,$values)) {
1402 $updateData = $values;
1406 if (($values[0]!=$val)&&($values!=$val)) {
1407 $updateData = array($val);
1410 if (isset($updateData)) {
1411 return $this -> _updateData(array($attr => $updateData));
1420 * Supprime un objet en relation dans l'attribut $attr de $this
1422 * @param[in] $object Un objet de type $objectType à supprimer
1423 * @param[in] $attr L'attribut dans lequel l'objet doit être supprimé
1424 * @param[in] $objectType Le type d'objet en relation
1425 * @param[in] $attrValue La valeur que doit avoir l'attribut :
1426 * - soit le dn (par defaut)
1427 * - soit la valeur [0] d'un attribut
1428 * @param[in] $canEditFunction Le nom de la fonction pour vérifier que la
1429 * relation avec l'objet est éditable par le user
1431 * @retval boolean true si l'objet à été supprimé, False sinon
1433 function deleteOneObjectInRelation($object,$attr,$objectType,$attrValue='dn',$canEditFunction=NULL) {
1434 if ((!$attr)||(!$objectType)) {
1435 LSerror :: addErrorCode('LSrelations_05','deleteOneObjectInRelation');
1438 if ($object instanceof $objectType) {
1439 if ($canEditFunction) {
1440 if (!$this -> $canEditFunction()) {
1441 LSerror :: addErrorCode('LSsession_11');
1445 if ($this -> attrs[$attr] instanceof LSattribute) {
1446 if ($attrValue=='dn') {
1447 $val = $object -> getDn();
1450 $val = $object -> getValue($attrValue);
1453 $values = $this -> attrs[$attr] -> getValue();
1454 if ((!is_array($values)) && (!empty($values))) {
1455 $values = array($values);
1457 if (is_array($values)) {
1458 $updateData=array();
1459 foreach($values as $value) {
1461 $updateData[]=$value;
1464 return $this -> _updateData(array($attr => $updateData));
1472 * Renome un objet en relation dans l'attribut $attr de $this
1474 * @param[in] $object Un objet de type $objectType à renomer
1475 * @param[in] $oldValue string L'ancienne valeur faisant référence à l'objet
1476 * @param[in] $attr L'attribut dans lequel l'objet doit être supprimé
1477 * @param[in] $objectType Le type d'objet en relation
1478 * @param[in] $attrValue La valeur que doit avoir l'attribut :
1479 * - soit le dn (par defaut)
1480 * - soit la valeur [0] d'un attribut
1482 * @retval boolean True en cas de succès, False sinon
1484 function renameOneObjectInRelation($object,$oldValue,$attr,$objectType,$attrValue='dn') {
1485 if ((!$attr)||(!$objectType)) {
1486 LSerror :: addErrorCode('LSrelations_05','renameOneObjectInRelation');
1489 if ($object instanceof $objectType) {
1490 if ($this -> attrs[$attr] instanceof LSattribute) {
1491 $values = $this -> attrs[$attr] -> getValue();
1492 if ((!is_array($values)) && (!empty($values))) {
1493 $values = array($values);
1495 if (is_array($values)) {
1496 $updateData=array();
1497 foreach($values as $value) {
1498 if ($value!=$oldValue) {
1499 $updateData[] = $value;
1502 if ($attrValue=='dn') {
1503 $val = $object -> getDn();
1506 $val = $object -> getValue($attrValue);
1509 $updateData[] = $val;
1512 return $this -> _updateData(array($attr => $updateData));
1520 * Met à jour les objets du meme type que $this en relation avec l'objet $object
1521 * de type $objectType en modifiant la valeur de leur attribut $attr des objets
1524 * @param[in] $object Mixed Un object (type : $this -> userObjectType) : l'utilisateur
1525 * @param[in] $listDns Array(string) Un tableau des DNs des objets en relation
1526 * @param[in] $attr L'attribut dans lequel l'utilisateur doit apparaitre
1527 * @param[in] $objectType Le type d'objet en relation
1528 * @param[in] $attrValue La valeur que doit avoir l'attribut :
1529 * - soit le dn (par defaut)
1530 * - soit la valeur [0] d'un attribut
1531 * @param[in] $canEditFunction Le nom de la fonction pour vérifier que la
1532 * relation avec l'objet est éditable par le user
1534 * @retval boolean true si tout c'est bien passé, False sinon
1536 function updateObjectsInRelation($object,$listDns,$attr,$objectType,$attrValue='dn',$canEditFunction=NULL) {
1537 if ((!$attr)||(!$objectType)) {
1538 LSerror :: addErrorCode('LSrelations_05','updateObjectsInRelation');
1541 $currentObjects = $this -> listObjectsInRelation($object,$attr,$objectType,$attrValue);
1542 $type=$this -> getType();
1543 if(is_array($currentObjects)) {
1544 if (is_array($listDns)) {
1546 if ($attrValue!='dn') {
1547 $obj=new $objectType();
1548 foreach ($listDns as $dn) {
1549 $obj -> loadData($dn);
1550 $val = $obj -> getValue($attrValue);
1551 $values[$dn] = $val[0];
1555 foreach($listDns as $dn) {
1559 $dontDelete=array();
1561 for ($i=0;$i<count($currentObjects);$i++) {
1562 if ($attrValue=='dn') {
1563 $val = $currentObjects[$i] -> getDn();
1566 $val = $currentObjects[$i] -> getValue($attrValue);
1569 if (in_array($val, $listDns)) {
1570 $dontDelete[$i]=true;
1575 for($i=0;$i<count($currentObjects);$i++) {
1576 if ($dontDelete[$i]) {
1580 if (!$currentObjects[$i] -> deleteOneObjectInRelation($object,$attr,$objectType,$attrValue,$canEditFunction)) {
1586 foreach($values as $dn => $val) {
1587 if (in_array($val,$dontAdd)) {
1592 if ($obj -> loadData($dn)) {
1593 if (!$obj -> addOneObjectInRelation($object,$attr,$objectType,$attrValue,$canEditFunction)) {
1606 if(!is_array($listDns)) {
1609 foreach($listDns as $dn) {
1611 if ($obj -> loadData($dn)) {
1612 if (!$obj -> addOneObjectInRelation($object,$attr,$objectType,$attrValue,$canEditFunction)) {
1624 * Ajouter une action lors d'un événement
1626 * @param[in] $event string Le nom de l'événement
1627 * @param[in] $fct string Le nom de la fonction à exectuer
1628 * @param[in] $param mixed Paramètre pour le lancement de la fonction
1629 * @param[in] $class Nom de la classe possèdant la méthode $fct à executer
1633 function addEvent($event,$fct,$param=NULL,$class=NULL) {
1634 $this -> _events[$event][] = array(
1642 * Ajouter une action sur un objet lors d'un événement
1644 * @param[in] $event string Le nom de l'événement
1645 * @param[in] $obj object L'objet dont la méthode doit être executé
1646 * @param[in] $meth string Le nom de la méthode
1647 * @param[in] $param mixed Paramètre d'execution de la méthode
1651 function addObjectEvent($event,&$obj,$meth,$param=NULL) {
1652 $this -> _objectEvents[$event][] = array(
1660 * Lance les actions à executer lors d'un événement
1662 * @param[in] $event string Le nom de l'événement
1664 * @retval boolean True si tout c'est bien passé, false sinon
1666 function fireEvent($event) {
1669 $return = $this -> fireObjectEvent($event);
1672 if(isset($this -> config[$event])) {
1673 if (!is_array($this -> config[$event])) {
1674 $funcs = array($this -> config[$event]);
1677 $funcs = $this -> config[$event];
1679 foreach($funcs as $func) {
1680 if(function_exists($func)) {
1683 LSerror :: addErrorCode('LSldapObject_07',array('func' => $func,'event' => $event));
1688 LSerror :: addErrorCode('LSldapObject_06',array('func' => $func,'event' => $event));
1693 // Binding via addEvent
1694 if (isset($this -> _events[$event]) && is_array($this -> _events[$event])) {
1695 foreach ($this -> _events[$event] as $e) {
1697 if (class_exists($e['class'])) {
1698 $obj = new $e['class']();
1699 if (method_exists($obj,$e['fct'])) {
1701 $obj -> $e['fct']($e['param']);
1703 catch(Exception $er) {
1704 LSerror :: addErrorCode('LSldapObject_10',array('class' => $e['class'],'meth' => $e['fct'],'event' => $event));
1709 LSerror :: addErrorCode('LSldapObject_09',array('class' => $e['class'],'meth' => $e['fct'],'event' => $event));
1714 LSerror :: addErrorCode('LSldapObject_08',array('class' => $e['class'],'meth' => $e['fct'],'event' => $event));
1719 if (function_exists($e['fct'])) {
1721 $e['fct']($e['param']);
1723 catch(Exception $er) {
1724 LSerror :: addErrorCode('LSldapObject_27',array('func' => $e['fct'],'event' => $event));
1729 LSerror :: addErrorCode('LSldapObject_26',array('func' => $e['fct'],'event' => $event));
1736 // Binding via addObjectEvent
1737 if (isset($this -> _objectEvents[$event]) && is_array($this -> _objectEvents[$event])) {
1738 foreach ($this -> _objectEvents[$event] as $e) {
1739 if (method_exists($e['obj'],$e['meth'])) {
1741 $e['obj'] -> $e['meth']($e['param']);
1743 catch(Exception $er) {
1744 LSerror :: addErrorCode('LSldapObject_29',array('meth' => $e['meth'],'event' => $event));
1749 LSerror :: addErrorCode('LSldapObject_28',array('meth' => $e['meth'],'event' => $event));
1759 * Lance les actions à executer lors d'un événement sur l'objet lui-même
1761 * @param[in] $event string Le nom de l'événement
1763 * @retval boolean True si tout c'est bien passé, false sinon
1765 function fireObjectEvent($event) {
1767 case 'after_create':
1768 return $this -> afterCreate();
1769 case 'after_delete':
1770 return $this -> afterDelete();
1771 case 'after_rename':
1772 return $this -> afterRename();
1773 case 'after_modify':
1774 return $this -> afterModify();
1776 case 'before_create':
1777 return $this -> beforeCreate();
1779 case 'before_delete':
1780 return $this -> beforeDelete();
1781 case 'before_rename':
1782 return $this -> beforeRename();
1784 case 'before_modify':
1785 return $this -> beforeModify();
1792 * Access to infos of the object
1794 * @param[in] $key string The name of the value
1796 * @retval mixed The value
1798 function __get($key) {
1799 if ($key=='subDnValue') {
1800 if (isset($this -> cache['subDnValue'])) {
1801 return $this -> cache['subDnValue'];
1803 $this -> cache['subDnValue'] = self :: getSubDnValue($this -> dn);
1804 return $this -> cache['subDnValue'];
1806 if ($key=='subDnName') {
1807 if ($this -> cache['subDnName']) {
1808 return $this -> cache['subDnName'];
1810 $this -> cache['subDnName'] = self :: getSubDnName($this -> dn);
1811 return $this -> cache['subDnName'];
1820 LSerror :: defineError('LSldapObject_01',
1821 _("LSldapObject : Object type unknown.")
1823 LSerror :: defineError('LSldapObject_02',
1824 _("LSldapObject : Update form is not defined for the object %{obj}.")
1826 LSerror :: defineError('LSldapObject_03',
1827 _("LSldapObject : No form exists for the object %{obj}.")
1829 LSerror :: defineError('LSldapObject_04',
1830 _("LSldapObject : The function %{func} to validate the attribute %{attr} the object %{obj} is unknow.")
1832 LSerror :: defineError('LSldapObject_05',
1833 _("LSldapObject : Configuration data are missing to validate the attribute %{attr} of the object %{obj}.")
1836 LSerror :: defineError('LSldapObject_06',
1837 _("LSldapObject : The function %{func} to be executed on the object event %{event} doesn't exist.")
1839 LSerror :: defineError('LSldapObject_07',
1840 _("LSldapObject : The %{func} execution on the object event %{event} failed.")
1843 LSerror :: defineError('LSldapObject_08',
1844 _("LSldapObject : Class %{class}, which method %{meth} to be executed on the object event %{event}, doesn't exist.")
1846 LSerror :: defineError('LSldapObject_09',
1847 _("LSldapObject : Method %{meth} within %{class} class to be executed on object event %{event}, doesn't exist.")
1849 LSerror :: defineError('LSldapObject_10',
1850 _("LSldapObject : Error during execute %{meth} method within %{class} class, to be executed on object event %{event}.")
1853 LSerror :: defineError('LSldapObject_11',
1854 _("LSldapObject : Some configuration data of the object type %{obj} are missing to generate the DN of the new object.")
1856 LSerror :: defineError('LSldapObject_12',
1857 _("LSldapObject : The attibute %{attr} of the object is not yet defined. Can't generate DN.")
1859 LSerror :: defineError('LSldapObject_13',
1860 _("LSldapObject : Without DN, the object could not be changed.")
1862 LSerror :: defineError('LSldapObject_14',
1863 _("LSldapObject : The attribute %{attr_depend} depending on the attribute %{attr} doesn't exist.")
1865 LSerror :: defineError('LSldapObject_15',
1866 _("LSldapObject : Error during deleting the object %{objectname}.")
1869 LSerror :: defineError('LSldapObject_16',
1870 _("LSldapObject : Error during actions to be executed before renaming the objet.")
1872 LSerror :: defineError('LSldapObject_17',
1873 _("LSldapObject : Error during actions to be executed after renaming the objet.")
1876 LSerror :: defineError('LSldapObject_18',
1877 _("LSldapObject : Error during actions to be executed before deleting the objet.")
1879 LSerror :: defineError('LSldapObject_19',
1880 _("LSldapObject : Error during actions to be executed after deleting the objet.")
1883 LSerror :: defineError('LSldapObject_20',
1884 _("LSldapObject : Error during the actions to be executed before creating the object.")
1886 LSerror :: defineError('LSldapObject_21',
1887 _("LSldapObject : Error during the actions to be executed after creating the object. It was created anyway.")
1890 LSerror :: defineError('LSldapObject_22',
1891 _("LSldapObject : The function %{func} to be executed before creating the object doesn't exist.")
1893 LSerror :: defineError('LSldapObject_23',
1894 _("LSldapObject : Error executing the function %{func} to be execute after deleting the object.")
1896 LSerror :: defineError('LSldapObject_24',
1897 _("LSldapObject : The function %{func} to be executed after deleting the object doesn't exist.")
1899 LSerror :: defineError('LSldapObject_25',
1900 _("LSldapObject : Error executing the function %{func} to be execute after creating the object.")
1903 LSerror :: defineError('LSldapObject_26',
1904 _("LSldapObject : %{func} function, to be executed on object event %{event}, doesn't exist.")
1906 LSerror :: defineError('LSldapObject_27',
1907 _("LSldapObject : Error during the execution of %{func} function on object event %{event}.")
1910 LSerror :: defineError('LSldapObject_28',
1911 _("LSldapObject : %{meth} method, to be executed on object event %{event}, doesn't exist.")
1913 LSerror :: defineError('LSldapObject_29',
1914 _("LSldapObject : Error during execution of %{meth} method on object event %{event}.")
1916 LSerror :: defineError('LSldapObject_30',
1917 _("LSldapObject : Error during generate LDAP filter for %{LSobject}.")
1920 LSerror :: defineError('LSldapObject_31',
1921 _("LSldapObject : Error during execution of the custom action %{customAction} on %{objectname}.")
1925 LSerror :: defineError('LSrelations_05',
1926 _("LSrelation : Some parameters are missing in the call of methods to handle standard relations (Method : %{meth}).")