From ed5b3d97a0fc5326deade9f86c9ab3e4c562988e Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Fri, 2 Jan 2009 16:00:25 +0000 Subject: [PATCH] =?UTF-8?q?-=20LdapSaisie=20:=20J'ai=20commenc=C3=A9=20?= =?UTF-8?q?=C3=A0=20=C3=A9crire=20la=20docummentation=20de=20LdapSaisie=20?= =?UTF-8?q?que=20j'esp=C3=A8re=20pour=20voir=20bient=C3=B4t=20ajout=C3=A9?= =?UTF-8?q?=20au=20SVN.=20Cela=20me=20fait=20mettre=20le=20doit=20sur=20qu?= =?UTF-8?q?elques=20probl=C3=A8mes=20de=20nommages,=20d'organisation=20que?= =?UTF-8?q?=20j'ai=20corrig=C3=A9=20sur=20le=20fait=20:=20=09-=20Concepte?= =?UTF-8?q?=20de=20level=20=C3=A9tait=20enfaite=20celui=20de=20subDn=20:?= =?UTF-8?q?=20seule=20le=20nom=20subDn=20doit=20=09=09rester.=20=09-=20Le?= =?UTF-8?q?=20concept=20de=20LSrights=20dans=20LSsession=20et=20config.inc?= =?UTF-8?q?.php=20=C3=A9tait=20mal=20nomm=C3=A9.=20=09=09Il=20correspond?= =?UTF-8?q?=20plus=20=C3=A0=20la=20d=C3=A9finition=20de=20LSprofile=20en?= =?UTF-8?q?=20r=C3=A9alit=C3=A9.=20Je=20l'ai=20renomm=C3=A9=20=09=09ainsi.?= =?UTF-8?q?=20=09-=20Les=20param=C3=A8tres=20authobject=20et=20authobject?= =?UTF-8?q?=5Fpwdattr=20n'=C3=A9taient=20pas=20tr=C3=A8s=20repr=C3=A9senta?= =?UTF-8?q?tif.=20=09=09Je=20les=20ai=20renomm=C3=A9=20en=20authObjectType?= =?UTF-8?q?=20et=20authObjectTypeAttrPwd.=20-=20Templates=20:=20=09->=20Co?= =?UTF-8?q?rrection=20du=20template=20default=20dans=20le=20but=20de=20cha?= =?UTF-8?q?nger=20la=20couleur=20bleu=20dominante=20juger=20trop=20=09=09?= =?UTF-8?q?=20flashy=20:).=20Au=20passage=20j'ai=20d=C3=A9gag=C3=A9=20l'im?= =?UTF-8?q?age=20de=20fond=20de=20#main=20utilis=C3=A9=20pour=20colorer=20?= =?UTF-8?q?le=20menu=20:=20=09=09=20cette=20m=C3=A9thode=20est=20moche=20e?= =?UTF-8?q?t=20quitte=20a=20=C3=A0=20faire=20du=20moche=20je=20pr=C3=A9f?= =?UTF-8?q?=C3=A8re=20utiliser=20un=20vulgaire=20tableau=20=09=09=20que=20?= =?UTF-8?q?des=20bidouille=20de=20ce=20genre.=20=09->=20Cr=C3=A9ation=20d'?= =?UTF-8?q?un=20logo=20pour=20LdapSaisie=20qui=20vient=20remplacer=20le=20?= =?UTF-8?q?logo=20Easter-Eggs=20utilis=C3=A9=20jusqu'alors.=20=09->=20Ajou?= =?UTF-8?q?t=20d'un=20favicon.=20-=20LSerror=20:=20=09->=20J'ai=20d=C3=A9p?= =?UTF-8?q?lac=C3=A9=20les=20definitions=20de=20code=20d'erreur=20dans=20l?= =?UTF-8?q?e=20contexte=20concern=C3=A9=20(c=C3=A0d=20dans=20=09=09=20les?= =?UTF-8?q?=20fichiers=20de=20d=C3=A9finition=20des=20classes)=20(Feature?= =?UTF-8?q?=20Request=20#1757)=20=09->=20J'en=20ai=20profit=C3=A9=20pour?= =?UTF-8?q?=20renommer=20les=20codes=20d'erreur=20avec=20un=20prefixe=20po?= =?UTF-8?q?ur=20eviter=20les=20doublons=20=09=09->=20J'ai=20donc=20modifi?= =?UTF-8?q?=C3=A9=20une=20grande=20partie=20des=20fichiers=20pour=20change?= =?UTF-8?q?r=20les=20codes=20erreurs=20utilis=C3=A9s=20=09->=20Ajout=20d'u?= =?UTF-8?q?ne=20m=C3=A9thode=20getError()=20utilis=C3=A9=20par=20getErrors?= =?UTF-8?q?()=20=09->=20Modification=20de=20la=20m=C3=A9thode=20stop()=20-?= =?UTF-8?q?=20LSformElement=5Fpassword=20:=20=20-=20Correction=20d'un=20bu?= =?UTF-8?q?g=20dans=20la=20g=C3=A9n=C3=A9ration=20des=20mots=20de=20passe?= =?UTF-8?q?=20dans=20un=09formulaire=20de=20cr=C3=A9ation=20d'objet.=20=20?= =?UTF-8?q?-=20Ajout=20d'une=20possiblit=C3=A9=20de=20choisir=20le=20type?= =?UTF-8?q?=20de=20hashage=20du=20mot=20de=20passe=20stock=C3=A9=20dans=20?= =?UTF-8?q?l'annuaire=20=09=09(Feature=20Request=20#1756)=20=20-=20Traduct?= =?UTF-8?q?ion=20des=20commentaires=20-=20LSattribute=20:=20Ajout=20des=20?= =?UTF-8?q?v=C3=A9rifications=20dans=20les=20m=C3=A9thodes=20de=20la=20cla?= =?UTF-8?q?sse=20lors=20de=20l'utilisation=20des=20objets=20=09html=20et?= =?UTF-8?q?=20ldap.=20-=20LSsession=20:=20=09->=20Renforcement=20des=20m?= =?UTF-8?q?=C3=A9thodes=20faisant=20des=20inclusions=20d'autres=20fichiers?= =?UTF-8?q?=20php.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LSobjects/config.LSobjects.LSeepeople.php | 3 + trunk/conf/config.error_code.php | 276 ----------------- trunk/conf/config.inc.php | 31 +- trunk/create.php | 6 +- trunk/css/default/LSformElement_image.css | 3 +- trunk/css/default/base.css | 39 +-- trunk/images/default/favicon.png | Bin 0 -> 503 bytes trunk/images/default/logo.png | Bin 13941 -> 5293 bytes trunk/includes/class/class.LSattr_html.php | 15 +- .../class/class.LSattr_html_image.php | 4 +- .../class/class.LSattr_html_password.php | 4 +- .../class/class.LSattr_html_select_list.php | 15 +- .../class/class.LSattr_html_select_object.php | 15 +- .../class/class.LSattr_ldap_password.php | 105 ++++++- trunk/includes/class/class.LSattribute.php | 81 ++++- trunk/includes/class/class.LSerror.php | 67 ++-- trunk/includes/class/class.LSform.php | 39 ++- .../class.LSformElement_select_object.php | 3 - trunk/includes/class/class.LSformRule.php | 6 + .../class/class.LSformRule_compare.php | 2 +- .../class/class.LSformRule_maxlength.php | 2 +- .../class/class.LSformRule_minlength.php | 2 +- .../class/class.LSformRule_rangelength.php | 2 +- .../includes/class/class.LSformRule_regex.php | 9 +- trunk/includes/class/class.LSldap.php | 40 ++- trunk/includes/class/class.LSldapObject.php | 160 +++++++--- trunk/includes/class/class.LSsession.php | 285 +++++++++++------- trunk/includes/functions.php | 11 +- trunk/includes/js/LSsession_login.js | 2 +- trunk/index_ajax.php | 104 +++---- trunk/modify.php | 9 +- trunk/remove.php | 10 +- trunk/select.php | 5 +- trunk/templates/default/bottom.tpl | 6 +- trunk/templates/default/login.tpl | 1 + trunk/templates/default/top.tpl | 55 ++-- trunk/view.php | 13 +- 37 files changed, 765 insertions(+), 665 deletions(-) delete mode 100644 trunk/conf/config.error_code.php create mode 100644 trunk/images/default/favicon.png diff --git a/trunk/conf/LSobjects/config.LSobjects.LSeepeople.php b/trunk/conf/LSobjects/config.LSobjects.LSeepeople.php index 71abc30e..d4ae7c3b 100644 --- a/trunk/conf/LSobjects/config.LSobjects.LSeepeople.php +++ b/trunk/conf/LSobjects/config.LSobjects.LSeepeople.php @@ -431,6 +431,9 @@ $GLOBALS['LSobjects']['LSeepeople'] = array ( 'userPassword' => array ( 'label' => _('Mot de passe'), 'ldap_type' => 'password', + 'ldap_options' => array ( + 'encode' => 'md5' + ), 'html_type' => 'password', 'html_options' => array( 'generationTool' => true, diff --git a/trunk/conf/config.error_code.php b/trunk/conf/config.error_code.php deleted file mode 100644 index 79f87c68..00000000 --- a/trunk/conf/config.error_code.php +++ /dev/null @@ -1,276 +0,0 @@ - array ( - 'msg' => _("Erreur inconnue!") - ), - 0 => array( - 'msg' => "%{msg}" - ), - // LSldap - 1 => array ( - 'msg' => _("LSldap : Erreur durant la connexion au serveur LDAP (%{msg}).") - ), - 2 => array ( - 'msg' => _("LSldap : Erreur durant la recherche LDAP (%{msg}).") - ), - 3 => array ( - 'msg' => _("LSldap : Type d'objet inconnu.") - ), - 4 => array ( - 'msg' => _("LSldap : Erreur durant la récupération de l'entrée Ldap.") - ), - 5 => array ( - 'msg' => _("LSldap : Erreur durant la mise à jour de l'entrée Ldap (DN : %{dn}).") - ), - 6 => array ( - 'msg' => _("LSldap : Erreur durant la suppression des attributs vides.") - ), - 7 => array ( - 'msg' => _("LSldap : Erreur durant le changement du DN de l'objet.") - ), - - // LSldapObject - 21 => array ( - 'msg' => _("LSldapObject : Type d'objet inconnu.") - ), - 22 => array ( - 'msg' => _("LSldapObject : Formulaire de mise jour inconnu par l'objet %{msg}.") - ), - 23 => array ( - 'msg' => _("LSldapObject : Aucun formulaire n'existe dans l'objet %{msg}.") - ), - 24 => array ( - 'msg' => _("LSldapObject : La fonction %{func} pour valider l'attribut %{attr} de l'objet %{obj} est inconnue.") - ), - 25 => array ( - 'msg' => _("LSldapObject : Des données de configuration sont manquant pour la validation de l'attribut %{attr} de l'objet %{obj}.") - ), - 26 => array ( - 'msg' => _("LSldapObject : Erreur de configuration : L'objet %{obj} ne possède pas d'attribut %{attr}.") - ), - 27 => array ( - 'msg' => _("LSldapObject : La fonction %{func} devant être executée avant la modification n'existe pas.") - ), - 28 => array ( - 'msg' => _("LSldapObject : L'execution de la fonction %{func} devant être executée avant la modification a échouée.") - ), - 29 => array ( - 'msg' => _("LSldapObject : La fonction %{func} devant être executée après la modification n'existe pas.") - ), - 30 => array ( - 'msg' => _("LSldapObject : L'execution de la fonction %{func} devant être executée après la modification a échouée.") - ), - 31 => array ( - 'msg' => _("LSldapObject : Il manque des informations de configuration du type d'objet %{obj} pour la création du nouveau DN.") - ), - 32 => array ( - 'msg' => _("LSldapObject : L'attribut %{attr} de l'objet n'est pas encore définis. Il est impossible de generer un nouveau DN.") - ), - 33 => array ( - 'msg' => _("LSldapObject : Sans DN, l'objet n'a put être modifié.") - ), - 34 => array ( - 'msg' => _("LSldapObject : L'attribut %{attr_depend} dépendant de l'attribut %{attr} n'existe pas.") - ), - 35 => array ( - 'msg' => _("LSldapObject : Erreur durant la suppression de %{objectname}.") - ), - 36 => array ( - 'msg' => _("LSldapObject : Erreur durant les actions avant renomage.") - ), - 37 => array ( - 'msg' => _("LSldapObject : Erreur durant les actions aprês renomage.") - ), - 38 => array ( - 'msg' => _("LSldapObject : Erreur durant les actions avant suppression.") - ), - 39 => array ( - 'msg' => _("LSldapObject : Erreur durant les actions aprês suppresion.") - ), - 301 => array ( - 'msg' => _("LSldapObject : Erreur durant les actions aprês la création. L'objet est pour autant créé.") - ), - 302 => array ( - 'msg' => _("LSldapObject : La fonction %{fonction} devant être éxecutée aprês la création de l'objet n'existe pas.") - ), - 303 => array ( - 'msg' => _("LSldapObject : Erreur durant l'exection de la fonction %{fonction} devant être éxecutée aprês la création de l'objet.") - ), - 304 => array ( - 'msg' => _("LSldapObject : La fonction %{fonction} devant être éxecutée aprês la suppression de l'objet n'existe pas.") - ), - 305 => array ( - 'msg' => _("LSldapObject : Erreur durant l'exection de la fonction %{fonction} devant être éxecutée aprês la suppression de l'objet.") - ), - 306 => array ( - 'msg' => _("LSldapObject : La fonction %{func} devant être executée après la modification de l'attribut %{attr} n'existe pas.") - ), - 307 => array ( - 'msg' => _("LSldapObject : L'execution de la fonction %{func} devant être executée après la modification de l'attribut %{attr} a échouée.") - ), - 308 => array ( - 'msg' => _("LSldapObject : La fonction %{func} devant être executée avant la modification de l'attribut %{attr} n'existe pas.") - ), - 309 => array ( - 'msg' => _("LSldapObject : L'execution de la fonction %{func} devant être executée avant la modification de l'attribut %{attr} a échouée.") - ), - - // LSattribute - 41 => array ( - 'msg' => _("LSattribute : Attribut %{attr} : Type d'attribut (ldap // html) inconnu (ldap = %{ldap} | html = %{html}).") - ), - 42 => array ( - 'msg' => _("LSattribute : La fonction %{func} pour afficher l'attribut %{attr} est inconnue.") - ), - 43 => array ( - 'msg' => _("LSattribute : La règle %{rule} pour valider l'attribut %{attr} est inconnue.") - ), - 44 => array ( - 'msg' => _("LSattribute : Les données de configuration pour vérifié l'attribut %{attr} sont incorrects.") - ), - 45 => array ( - 'msg' => _("LSattribute : La fonction %{func} pour sauver l'attribut %{attr} est inconnue.") - ), - 46 => array ( - 'msg' => _("LSattribute : La valeur de l'attribut %{attr} ne peut pas être générée.") - ), - 47 => array ( - 'msg' => _("LSattribute : La valeur de l'attribut %{attr} n'a pas put être générée.") - ), - 48 => array ( - 'msg' => _("LSattribute : La génération de l'attribut %{attr} n'a pas retourné une valeur correcte.") - ), - - // LSattr_html - 101 => array ( - 'msg' => _("LSattr_html : La fonction addToForm() du type html de l'attribut %{attr} n'est pas définie.") - ), - 102 => array ( - 'msg' => _("LSattr_html_select_list : Des données de configuration sont manquante pour la génération de la liste deroulante de l'attribut %{attr}.") - ), - 103 => array ( - 'msg' => _("LSattr_html_%{type} : Les données multiples ne sont pas gérés pour ce type d'attribut.") - ), - - // LSform - 201 => array( - 'msg' => _("LSform : Erreur durant la recupération des valeurs du formulaire.") - ), - 202 => array( - 'msg' => _("LSform : Erreur durant la récupération de la valeur du formulaire du champ '%{element}'.") - ), - 203 => array( - 'msg' => _("LSform : Les données du champ %{element} ne sont pas valides.") - ), - 204 => array( - 'msg' => _("LSform : Le champ %{element} n'existe pas.") - ), - 205 => array( - 'msg' => _("LSfom : Type de champ inconnu (%{type}).") - ), - 206 => array( - 'msg' => _("LSform : Erreur durant la création de l'élement '%{element}'.") - ), - 207 => array( - 'msg' => _("LSform : Aucune valeur de rentrée pour le champs '%{element}'.") - ), - - 801 => array( - 'msg' => _("LSformRule : Aucune regex n'a été fournis pour la validation des données.") - ), - - // functions - 901 => array ( - 'msg' => _("Functions 'getFData' : La methode %{meth} de l'objet %{obj} n'existe pas.") - ), - - // LSsession - 1001 => array ( - 'msg' => _("LSsession : La constante %{const} n'est pas définie.") - ), - 1002 => array ( - 'msg' => _("LSsession : Le support %{addon} n'est pas assuré. Vérifier la compatibilité du système et la configuration de l'addon") - ), - 1003 => array ( - 'msg' => _("LSsession : Données de configuration du serveur LDAP invalide. Impossible d'établir une connexion.") - ), - 1004 => array ( - 'msg' => _("LSsession : Impossible de charger l'objets de type %{type} : type inconnu.") - ), - 1005 => array ( - 'msg' => _("LSsession : Impossible d'effecture l'authentification : Type d'objet d'authentification inconnu (%{type}).") - ), - 1006 => array ( - 'msg' => _("LSsession : Identifiant ou mot de passe incorrect.") - ), - 1007 => array ( - 'msg' => _("LSsession : Impossible de vous identifier : Duplication d'authentité.") - ), - 1008 => array ( - 'msg' => _("LSsession : Impossible d'inclure le moteur de rendu Smarty.") - ), - 1009 => array ( - 'msg' => _("LSsession : Impossible de se connecter au Serveur LDAP.") - ), - 1010 => array ( - 'msg' => _("LSsession : Impossible de charger la classe des objets d'authentification.") - ), - 1011 => array ( - 'msg' => _("LSsession : Vous n'êtes pas authorisé à effectuer cette action.") - ), - 1012 => array ( - 'msg' => _("LSsession : Des informations sont manquantes pour l'affichage de cette page.") - ), - 1013 => array ( - 'msg' => _("LSrelations : La fonction de listage pour la relation %{relation} est inconnu.") - ), - 1014 => array ( - 'msg' => _("LSrelations : La fonction de mise à jour pour la relation %{relation} est inconnu.") - ), - 1015 => array ( - 'msg' => _("LSrelations : Une erreur s'est produite durant la mise a jour de la relation %{relation}.") - ), - 1016 => array ( - 'msg' => _("LSrelations : L'objet %{LSobject} de la relation %{relation} est inconnu.") - ), - 1017 => array ( - 'msg' => _("LSsession : Impossible de créer correctement la liste des niveaux. Vérifier la configuration.") - ), - 1018 => array ( - 'msg' => _("LSsession : La récupération de mot de passe est désactivée pour ce serveur LDAP.") - ), - 1019 => array ( - 'msg' => _("LSsession : Des informations sont manquantes pour la récupération de votre mot de passe. Contactez l'administrateur du systême.") - ), - 1020 => array ( - 'msg' => _("LSsession : Erreur durant la récupération de votre mot de passe. Contactez l'administrateur du systême.") - ), - 1021 => array ( - 'msg' => _("LSrelation : Des paramètres sont manquants dans l'invocation des méthodes de manipulations de relations standarts (Méthode : %{meth}).") - ), - 1022 => array( - 'msg' => _("LSsession : problème durant l'initialisation.") - ) -); -?> diff --git a/trunk/conf/config.inc.php b/trunk/conf/config.inc.php index 0e48c0c3..a93dceb2 100644 --- a/trunk/conf/config.inc.php +++ b/trunk/conf/config.inc.php @@ -25,7 +25,7 @@ $GLOBALS['LSconfig'] = array( 'NetLDAP2' => '/usr/share/php/Net/LDAP2.php', 'Smarty' => '/var/www/tmp/Smarty-2.6.18/libs/Smarty.class.php', 'lang' => 'fr_FR.UTF8', - 'cacheLSrights' => true, + 'cacheLSprofiles' => true, 'cacheSubDn' => true, 'cacheSearch' => true, 'ldap_servers' => array ( @@ -43,7 +43,7 @@ $GLOBALS['LSconfig'] = array( 'filter' => '(objectClass=*)', 'scope' => 'sub' ), - 'LSrights' => array ( + 'LSprofiles' => array ( 'admin' => array ( 'o=ls' => array ( 'uid=eeggs,ou=people,o=ls' => NULL @@ -68,9 +68,9 @@ $GLOBALS['LSconfig'] = array( ) ) ), - 'cacheLSrights' => true, + 'cacheLSprofiles' => true, 'cacheSearch' => true, - 'authobject' => 'LSeepeople', + 'authObjectType' => 'LSeepeople', 'authobject_pwdattr' => 'userPassword', 'LSaccess' => array( 'LSeepeople', @@ -89,11 +89,7 @@ $GLOBALS['LSconfig'] = array( 'msg' => "Votre nouveau mot de passe : %{mdp}" ) ), - 'emailSender' => 'noreply@ls.com', - 'LSobjects' => array ( - 'LSeepeople', - 'LSeegroup' - ) + 'emailSender' => 'noreply@ls.com' ), array ( 'name' => 'LSexample - multi-sociétés', @@ -109,7 +105,7 @@ $GLOBALS['LSconfig'] = array( 'filter' => '(objectClass=*)', 'scope' => 'sub' ), - 'LSrights' => array( + 'LSprofiles' => array( 'admin' => array ( 'o=ls' => array ( 'uid=eeggs,ou=people,o=ls' => NULL, @@ -120,8 +116,8 @@ $GLOBALS['LSconfig'] = array( ) ) ), - 'authobject' => 'LSeepeople', - 'levelLabel' => _('Société'), + 'authObjectType' => 'LSeepeople', + 'subDnLabel' => _('Société'), 'subDn' => array( '== Toutes ==' => array( 'dn' => 'o=ls', @@ -140,9 +136,9 @@ $GLOBALS['LSconfig'] = array( ) ) ), - 'cacheLSrights' => true, + 'cacheLSprofiles' => true, 'cacheSearch' => true, - 'authobject_pwdattr' => 'userPassword', + 'authObjectTypeAttrPwd' => 'userPassword', 'recoverPassword' => array( 'mailAttr' => 'mail', 'passwordAttr' => 'userPassword', @@ -157,12 +153,7 @@ $GLOBALS['LSconfig'] = array( 'msg' => "Votre nouveau mot de passe : %{mdp}" ) ), - 'emailSender' => 'noreply@lsexample.net', - 'LSobjects' => array ( - 'LSeepeople', - 'LSeegroup', - 'LSeecompany' - ) + 'emailSender' => 'noreply@lsexample.net' ) ) ); diff --git a/trunk/create.php b/trunk/create.php index 43af74a8..2afd42fd 100644 --- a/trunk/create.php +++ b/trunk/create.php @@ -89,15 +89,15 @@ if($LSsession -> startLSsession()) { $form -> display(); } else { - $GLOBALS['LSerror'] -> addErrorCode(1011); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_11'); } } else { - $GLOBALS['LSerror'] -> addErrorCode(21); + $GLOBALS['LSerror'] -> addErrorCode('LSldapObject_01'); } } else { - $GLOBALS['LSerror'] -> addErrorCode(1012); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_12'); } } diff --git a/trunk/css/default/LSformElement_image.css b/trunk/css/default/LSformElement_image.css index a37d71f7..1d103fbb 100644 --- a/trunk/css/default/LSformElement_image.css +++ b/trunk/css/default/LSformElement_image.css @@ -5,7 +5,7 @@ div.LSformElement_image { float: right; clear: both; margin: 2em; - background-color: #52bce5; + background-color: #0072B8; width: 160px; padding: 5px; text-align: center; @@ -16,6 +16,7 @@ img.LSformElement_image { width: 150px; border: 1px solid #fff; margin: 5px; + background-color: #fff; } div.LSformElement_image_errors { diff --git a/trunk/css/default/base.css b/trunk/css/default/base.css index 8e8bd72f..e92309b3 100644 --- a/trunk/css/default/base.css +++ b/trunk/css/default/base.css @@ -31,12 +31,6 @@ a img { border: none; } -hr { - visibility: hidden; - clear: both; - height: 0px; -} - .btn { cursor: pointer; margin: 2px; @@ -47,27 +41,32 @@ hr { */ #main { width: 1000px; + height: 600px; margin: auto; - border: 1px solid #52bce5; - background: #fff url(../../images/default/fd_menu.png) repeat-y scroll left top; - min-height: 500px; + border: 1px solid #0072b8; + border-collapse: collapse; } #left { - float: left; + vertical-align: top; + background-color: #0072b8; width: 160px; } #right { - margin: 0; - float: left; - width: 840px; + vertical-align: top; } #logo { margin: auto; width: 142px; margin-left: 9px; + margin-top: 9px; + background-color: #fff; + border: 1px solid #0072b8; + -moz-border-radius: 15px; + padding-top: 30px; + padding-bottom: 30px; } #status { @@ -76,8 +75,10 @@ hr { font-size: 0.7em; color: #fff; text-align: right; - background-color: #52bce5; + background-color: #0072b8; padding: 0.3em; + height: 1em; + vertical-align: top; } #user_name { @@ -125,7 +126,7 @@ a.menu { table.LSobject-list { margin-left: 1em; margin-top: 0.5em; - border: 1px solid #52bce5; + border: 1px solid #0072b8; width: 805px; border-collapse: collapse; clear: both; @@ -135,7 +136,7 @@ table.LSobject-list { * th */ th.LSobject-list { - background-color: #52bce5; + background-color: #0072b8; color: #fff; } @@ -169,7 +170,7 @@ tr.LSobject-list-bis { * td */ td.LSobject-list { - border: 1px solid #52bce5; + border: 1px solid #0072b8; padding: 0.1em; } @@ -211,7 +212,7 @@ p.LSobject-list-page { } a.LSobject-list-page { - color: #52bce5; + color: #0072b8; text-decoration: none; } @@ -298,6 +299,6 @@ input[type='text'].LSview_search { input[type='submit'].LSview_search { border: 1px solid #0072b8; width: 8em; - background-color: #52bce5; + background-color: #0072b8; color: #fff; } diff --git a/trunk/images/default/favicon.png b/trunk/images/default/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..f1e27a553aa121fe713d00efcf829b14cf0bb404 GIT binary patch literal 503 zcmV8!wZmn76vgCC+itZK&Y2R?=^#3T&@bCNy*2Z4=kUMwtOP0>=>hP_9G&z$5| tZe#$I0de36XaY8E=WYw^w$gw9jaM31bV|(9;qCwc002ovPDHLkV1lS7#r*&P literal 0 HcmV?d00001 diff --git a/trunk/images/default/logo.png b/trunk/images/default/logo.png index 9ac0079b610a0c7d302a3c6b023d9c26dcc7c608..5902799c6f09398537dde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3ZQ=rLyI8idYe z&tV3<_JvMpWYLB>n%e{Yhid2Zs z-SUz{C(%savU2I6Pv3m0n486F*g=!TQ*?hyvqAl|E9}5_zQtNV>cJsQRhy&57}QUi zVyWF>GQGzv3RPvUpzgZ1oU3=+nomAqz!7g@_mbWhd46}Wxrv7zFpKQy z+7I8{&#a(wEj+SI!wziA$Gt}eiaVe+kQhDO6g*sY=AHT2fHHTBiAAmSY>#%YduKyO z+d6KZ)ekEjAe&8jeEI%&nYxdDde(BqX*M0P6skNv={eTj7&?Na&;udyb z6~sJaN4EuXwPQGowsqywpHG^%=(h--riS`Gm1QM6wy*!J@a0E;Rn*+r5Fny?dZJa| zCM223aSuB<(}8lz%<*;%`^xwI>F2j@WUF;)PXEDasRJK~=2{|>A}sNdAao$? z;7g#K{t^clG0eczWGy LSformElement_type) { - $GLOBALS['LSerror'] -> addErrorCode(101,$this -> name); + $GLOBALS['LSerror'] -> addErrorCode('LSattr_html_01',$this -> name); return; } $element=$form -> addElement($this -> LSformElement_type, $this -> name, $this -> config['label'],$this -> config, $this); if(!$element) { - $GLOBALS['LSerror'] -> addErrorCode(206,$this -> name); + $GLOBALS['LSerror'] -> addErrorCode('LSform_06',$this -> name); return; } if ($data) { @@ -106,4 +106,15 @@ class LSattr_html { } } +/* + * Error Codes + */ +$GLOBALS['LSerror_code']['LSattr_html_01'] = array ( + 'msg' => _("LSattr_html : The method addToForm() of the HTML type of the attribute %{attr} is not defined.") +); +// 02 : not yet used +$GLOBALS['LSerror_code']['LSattr_html_03'] = array ( + 'msg' => _("LSattr_html_%{type} : The multiple data are not supported for this field type.") +); + ?> diff --git a/trunk/includes/class/class.LSattr_html_image.php b/trunk/includes/class/class.LSattr_html_image.php index 862f1e3b..8e298f64 100644 --- a/trunk/includes/class/class.LSattr_html_image.php +++ b/trunk/includes/class/class.LSattr_html_image.php @@ -39,12 +39,12 @@ class LSattr_html_image extends LSattr_html { function addToForm (&$form,$idForm,$data=NULL) { $element=$form -> addElement('image', $this -> name, $this -> config['label'],$this -> config, $this); if(!$element) { - $GLOBALS['LSerror'] -> addErrorCode(206,$this -> name); + $GLOBALS['LSerror'] -> addErrorCode('LSform_06',$this -> name); return; } if (count($data)>1) { - $GLOBALS['LSerror'] -> addErrorCode(103,'password'); + $GLOBALS['LSerror'] -> addErrorCode('LSattr_html_03','password'); } if ($data) { diff --git a/trunk/includes/class/class.LSattr_html_password.php b/trunk/includes/class/class.LSattr_html_password.php index 34020cf1..b727dcf9 100644 --- a/trunk/includes/class/class.LSattr_html_password.php +++ b/trunk/includes/class/class.LSattr_html_password.php @@ -39,12 +39,12 @@ class LSattr_html_password extends LSattr_html { function addToForm (&$form,$idForm,$data=NULL) { $element=$form -> addElement('password', $this -> name, $this -> config['label'], $this -> config, $this); if(!$element) { - $GLOBALS['LSerror'] -> addErrorCode(206,$this -> name); + $GLOBALS['LSerror'] -> addErrorCode('LSform_06',$this -> name); return; } if (count($data)>1) { - $GLOBALS['LSerror'] -> addErrorCode(103,'password'); + $GLOBALS['LSerror'] -> addErrorCode('LSattr_html_03','password'); } if ($data) { diff --git a/trunk/includes/class/class.LSattr_html_select_list.php b/trunk/includes/class/class.LSattr_html_select_list.php index c1e00fbc..70ef4c74 100644 --- a/trunk/includes/class/class.LSattr_html_select_list.php +++ b/trunk/includes/class/class.LSattr_html_select_list.php @@ -37,15 +37,11 @@ class LSattr_html_select_list extends LSattr_html{ * @retval LSformElement L'element du formulaire ajouté */ function addToForm (&$form,$idForm,$data=NULL) { - /*if (count($data)>1) { - $GLOBALS['LSerror'] -> addErrorCode(103,'select_list'); - return; - }*/ $possible_values=$this -> getPossibleValues(); $this -> config['text_possible_values'] = $possible_values; $element=$form -> addElement('select', $this -> name, $this -> config['label'],$this -> config, $this); if(!$element) { - $GLOBALS['LSerror'] -> addErrorCode(206,$this -> name); + $GLOBALS['LSerror'] -> addErrorCode('LSform_06',$this -> name); return; } if ($data) { @@ -80,11 +76,10 @@ class LSattr_html_select_list extends LSattr_html{ foreach($this -> config['possible_values'] as $val_name => $val) { if($val_name=='OTHER_OBJECT') { if ((!isset($val['object_type'])) || (!isset($val['value_attribute']))) { - $GLOBALS['LSerror'] -> addErrorCode(102,$this -> name); + $GLOBALS['LSerror'] -> addErrorCode('LSattr_html_select_list_01',$this -> name); break; } if (!$GLOBALS['LSsession'] -> loadLSobject($val['object_type'])) { - $GLOBALS['LSerror'] -> addErrorCode(1004,$val['object_type']); return; } $obj = new $val['object_type'](); @@ -129,4 +124,10 @@ class LSattr_html_select_list extends LSattr_html{ } +/* + * Error Codes + */ +$GLOBALS['LSerror_code']['LSattr_html_select_list_01'] = array ( + 'msg' => _("LSattr_html_select_list : Configuration data are missing to generate the select list of the attribute %{attr}.") +); ?> diff --git a/trunk/includes/class/class.LSattr_html_select_object.php b/trunk/includes/class/class.LSattr_html_select_object.php index 404dcbda..e54b0d48 100644 --- a/trunk/includes/class/class.LSattr_html_select_object.php +++ b/trunk/includes/class/class.LSattr_html_select_object.php @@ -40,7 +40,7 @@ class LSattr_html_select_object extends LSattr_html{ $this -> config['attrObject'] = $this; $element=$form -> addElement('select_object', $this -> name, $this -> config['label'],$this -> config,$this); if(!$element) { - $GLOBALS['LSerror'] -> addErrorCode(206,$this -> name); + $GLOBALS['LSerror'] -> addErrorCode('LSform_06',$this -> name); return; } if ($data) { @@ -81,12 +81,11 @@ class LSattr_html_select_object extends LSattr_html{ if (isset($this -> config['selectable_object'])) { $conf=$this -> config['selectable_object']; if (!isset($conf['object_type'])) { - $GLOBALS['LSerror'] -> addErrorCode(102,$this -> name); + $GLOBALS['LSerror'] -> addErrorCode('LSattr_html_select_object_01',$this -> name); return; } if (!$GLOBALS['LSsession'] -> loadLSobject($conf['object_type'])) { - $GLOBALS['LSerror'] -> addErrorCode(1004,$conf['object_type']); return; } @@ -130,12 +129,11 @@ class LSattr_html_select_object extends LSattr_html{ if (isset($this -> config['selectable_object'])) { $conf=$this -> config['selectable_object']; if (!isset($conf['object_type'])) { - $GLOBALS['LSerror'] -> addErrorCode(102,$this -> name); + $GLOBALS['LSerror'] -> addErrorCode('LSattr_html_select_object_01',$this -> name); return; } if (!$GLOBALS['LSsession'] -> loadLSobject($conf['object_type'])) { - $GLOBALS['LSerror'] -> addErrorCode(1004,$conf['object_type']); return; } @@ -194,4 +192,11 @@ class LSattr_html_select_object extends LSattr_html{ } +/* + * Error Codes + */ +$GLOBALS['LSerror_code']['LSattr_html_select_object_01'] = array ( + 'msg' => _("LSattr_html_select_object : LSobject type is undefined (attribute : %{attr}).") +); + ?> diff --git a/trunk/includes/class/class.LSattr_ldap_password.php b/trunk/includes/class/class.LSattr_ldap_password.php index deec22da..43b568b5 100644 --- a/trunk/includes/class/class.LSattr_ldap_password.php +++ b/trunk/includes/class/class.LSattr_ldap_password.php @@ -21,7 +21,7 @@ ******************************************************************************/ /** - * Type d'attribut Ldap password + * Ldap attribute type password * */ class LSattr_ldap_password extends LSattr_ldap { @@ -29,34 +29,107 @@ class LSattr_ldap_password extends LSattr_ldap { var $clearPassword = NULL; /** - * Retourne la valeur d'affichage de l'attribut après traitement lié à son type ldap + * Return the display value of this attribute * - * @param[in] $data mixed La valeur de l'attribut + * @param[in] $data mixed The value of this attribute * - * @retval mixed La valeur d'affichage de l'attribut + * @retval mixed The display value of this attribute */ function getDisplayValue($data) { return '********'; } /** - * Retourne la valeur de l'attribut après traitement lié à son type ldap + * Return the value of this attribute to be stocked * - * @param[in] $data mixed La valeur de l'attribut + * Note : Password encoding was strongly inspired of the project phpLdapAdmin. + * URL : http://phpldapadmin.sourceforge.net/ + * + * @param[in] $data mixed The attribute value * - * @retval mixed La valeur traitée de l'attribut + * @retval mixed The value of this attribute to be stocked */ function getUpdateData($data) { $this -> clearPassword = $data[0]; - return '{CRYPT}'.crypt($data[0],'$1$'.$this -> getSalt().'$'); + if (!$this -> config['ldap_options']['encode']) { + $this -> config['ldap_options']['encode'] = 'md5crypt'; + } + switch($this -> config['ldap_options']['encode']) { + case 'crypt': + if ($this -> config['ldap_options']['no_random_crypt_salt']) { + return '{CRYPT}' . crypt($this -> clearPassword,substr($this -> clearPassword,0,2)); + } + else { + return '{CRYPT}' . crypt($this -> clearPassword,$this -> getSalt(2)); + } + break; + case 'ext_des': + if ( ! defined( 'CRYPT_EXT_DES' ) || CRYPT_EXT_DES == 0 ) { + $GLOBALS['LSerror'] -> addErrorCode(1023,'ext_des'); + } + else { + return '{CRYPT}' . crypt( $this -> clearPassword, '_' . $this -> getSalt(8) ); + } + break; + case 'blowfish': + if( ! defined( 'CRYPT_BLOWFISH' ) || CRYPT_BLOWFISH == 0 ) { + $GLOBALS['LSerror'] -> addErrorCode(1023,'blowfish'); + } + else { + return '{CRYPT}' . crypt( $this -> clearPassword, '$2a$12$' . $this -> getSalt(13) ); + } + break; + case 'sha': + if( function_exists('sha1') ) { + return '{SHA}' . base64_encode( pack( 'H*' , sha1( $this -> clearPassword ) ) ); + } + elseif( function_exists( 'mhash' ) ) { + return '{SHA}' . base64_encode( mhash( MHASH_SHA1, $this -> clearPassword ) ); + } else { + $GLOBALS['LSerror'] -> addErrorCode(1023,'sha'); + } + break; + case 'ssha': + if( function_exists( 'mhash' ) && function_exists( 'mhash_keygen_s2k' ) ) { + mt_srand( (double) microtime() * 1000000 ); + $salt = mhash_keygen_s2k( MHASH_SHA1, $this -> clearPassword, substr( pack( "h*", md5( mt_rand() ) ), 0, 8 ), 4 ); + return "{SSHA}".base64_encode( mhash( MHASH_SHA1, $this -> clearPassword.$salt ).$salt ); + } + else { + $GLOBALS['LSerror'] -> addErrorCode(1023,'ssha'); + } + break; + case 'smd5': + if( function_exists( 'mhash' ) && function_exists( 'mhash_keygen_s2k' ) ) { + mt_srand( (double) microtime() * 1000000 ); + $salt = mhash_keygen_s2k( MHASH_MD5, $password_clear, substr( pack( "h*", md5( mt_rand() ) ), 0, 8 ), 4 ); + return "{SMD5}".base64_encode( mhash( MHASH_MD5, $password_clear.$salt ).$salt ); + } + else { + $GLOBALS['LSerror'] -> addErrorCode(1023,'smd5'); + } + break; + case 'md5': + return '{MD5}' . base64_encode( pack( 'H*' , md5( $this -> clearPassword ) ) ); + break; + case 'md5crypt': + if( ! defined( 'CRYPT_MD5' ) || CRYPT_MD5 == 0 ) { + $GLOBALS['LSerror'] -> addErrorCode(1023,'md5crypt'); + } + else { + return '{CRYPT}'.crypt($this -> clearPassword,'$1$'.$this -> getSalt().'$'); + } + break; + } + return $this -> clearPassword; } /** - * Retourne une salt (chaine de caractère aléatoire) de la longueur passée en paramètre + * Return salt (random string) * - * @param[in] integer La longueur de la salt (par defaut : 8) + * @param[in] integer Number of caracters in this salt * - * @retval string La salt + * @retval string A salt */ function getSalt($length=8) { $pattern = "1234567890abcdefghijklmnopqrstuvwxyz"; @@ -69,13 +142,19 @@ class LSattr_ldap_password extends LSattr_ldap { } /** - * Retourne le mot de passe en texte clair + * Return the password in clear text * - * @retval string Le mot de passe en texte clair + * @retval string The password in clear text */ function getClearPassword() { return $this -> clearPassword; } } +/** + * Error Codes + **/ +$GLOBALS['LSerror_code'][1023] = array( + 'msg' => _("LSattr_ldap_password : Encoding type %{type} is not supported. This password will be stocked in clear text.") +); ?> diff --git a/trunk/includes/class/class.LSattribute.php b/trunk/includes/class/class.LSattribute.php index 6d4d7411..81b1af21 100644 --- a/trunk/includes/class/class.LSattribute.php +++ b/trunk/includes/class/class.LSattribute.php @@ -73,7 +73,7 @@ class LSattribute { $this -> ldap = new $ldap_type($name,$config,$this); } else { - $GLOBALS['LSerror'] -> addErrorCode(41,array('attr' => $name,'html'=>$config['html_type'],'ldap'=>$config['ldap_type'])); + $GLOBALS['LSerror'] -> addErrorCode('LSattribute_01',array('attr' => $name,'html'=>$config['html_type'],'ldap'=>$config['ldap_type'])); return; } return true; @@ -91,6 +91,10 @@ class LSattribute { */ function getLabel() { + if (!$this -> html) { + $GLOBALS['LSerror'] -> addErrorCode('LSattribute_09',array('type' => 'html','name' => $this -> name)); + return; + } return $this -> html -> getLabel(); } @@ -153,6 +157,10 @@ class LSattribute { * @retval string La valeur d'affichage de l'attribut */ function getDisplayValue() { + if (!$this -> ldap) { + $GLOBALS['LSerror'] -> addErrorCode('LSattribute_09',array('type' => 'ldap','name' => $this -> name)); + return; + } $data = $this -> ldap -> getDisplayValue($this -> data); if ($this -> config['onDisplay']) { if (is_array($this -> config['onDisplay'])) { @@ -162,7 +170,7 @@ class LSattribute { $result=$func($result); } else { - $GLOBALS['LSerror'] -> addErrorCode(42,array('attr' => $this->name,'func' => $func)); + $GLOBALS['LSerror'] -> addErrorCode('LSattribute_02',array('attr' => $this->name,'func' => $func)); return; } } @@ -173,7 +181,7 @@ class LSattribute { return $this -> config['onDisplay']($data); } else { - $GLOBALS['LSerror'] -> addErrorCode(42,array('attr' => $this->name,'func' => $this -> config['onDisplay'])); + $GLOBALS['LSerror'] -> addErrorCode('LSattribute_02',array('attr' => $this->name,'func' => $this -> config['onDisplay'])); return; } } @@ -182,7 +190,7 @@ class LSattribute { } /** - * Ajoute l'attribut au formualaire + * Ajoute l'attribut au formulaire * * Cette méthode ajoute l'attribut au formulaire $form si l'identifiant de celui-ci * ($idForm) est connu dans la configuration de l'objet. @@ -198,6 +206,10 @@ class LSattribute { */ function addToForm(&$form,$idForm,&$obj=NULL,$value=NULL) { if(isset($this -> config['form'][$idForm])) { + if (!$this -> html) { + $GLOBALS['LSerror'] -> addErrorCode('LSattribute_09',array('type' => 'html','name' => $this -> name)); + return; + } if($this -> myRights() == 'n') { return true; } @@ -213,7 +225,7 @@ class LSattribute { $element = $this -> html -> addToForm($form,$idForm,$data); if(!$element) { - $GLOBALS['LSerror'] -> addErrorCode(206,$this -> name); + $GLOBALS['LSerror'] -> addErrorCode('LSform_06',$this -> name); } if($this -> config['required']==1) { @@ -228,7 +240,7 @@ class LSattribute { if(is_array($this -> config['check_data'])) { foreach ($this -> config['check_data'] as $rule => $rule_infos) { if((!$form -> isRuleRegistered($rule))&&($rule!='')) { - $GLOBALS['LSerror'] -> addErrorCode(43,array('attr' => $this->name,'rule' => $rule)); + $GLOBALS['LSerror'] -> addErrorCode('LSattribute_03',array('attr' => $this->name,'rule' => $rule)); return; } if(!isset($rule_infos['msg'])) @@ -239,7 +251,7 @@ class LSattribute { } } else { - $GLOBALS['LSerror'] -> addErrorCode(44,$this->name); + $GLOBALS['LSerror'] -> addErrorCode('LSattribute_04',$this->name); } } } @@ -300,7 +312,11 @@ class LSattribute { * @retval boolean true si l'ajout a fonctionner ou qu'il n'est pas nécessaire, false sinon */ function addToView(&$form) { - if((isset($this -> config['view'])) && ($this -> myRights() != 'n')) { + if((isset($this -> config['view'])) && ($this -> myRights() != 'n') ) { + if (!$this -> html) { + $GLOBALS['LSerror'] -> addErrorCode('LSattribute_09',array('type' => 'html','name' => $this -> name)); + return; + } if($this -> data !='') { $data=$this -> getFormVal(); } @@ -309,7 +325,7 @@ class LSattribute { } $element = $this -> html -> addToForm($form,'view',$data); if(!$element instanceof LSformElement) { - $GLOBALS['LSerror'] -> addErrorCode(206,$this -> name); + $GLOBALS['LSerror'] -> addErrorCode('LSform_06',$this -> name); return; } $element -> freeze(); @@ -330,6 +346,10 @@ class LSattribute { */ function refreshForm(&$form,$idForm) { if(isset($this -> config['form'][$idForm])&&($this -> myRights()!='n')) { + if (!$this -> html) { + $GLOBALS['LSerror'] -> addErrorCode('LSattribute_09',array('type' => 'html','name' => $this -> name)); + return; + } $form_element = $form -> getElement($this -> name); if ($form_element) { $values = $this -> html -> refreshForm($this -> getFormVal()); @@ -484,7 +504,7 @@ class LSattribute { $result=$func($result); } else { - $GLOBALS['LSerror'] -> addErrorCode(45,array('attr' => $this->name,'func' => $func)); + $GLOBALS['LSerror'] -> addErrorCode('LSattribute_05',array('attr' => $this->name,'func' => $func)); return; } } @@ -494,13 +514,19 @@ class LSattribute { $result = $this -> config['onSave']($data); } else { - $GLOBALS['LSerror'] -> addErrorCode(45,array('attr' => $this->name,'func' => $this -> config['onSave'])); + $GLOBALS['LSerror'] -> addErrorCode('LSattribute_05',array('attr' => $this->name,'func' => $this -> config['onSave'])); return; } } } else { - $result = $this -> ldap -> getUpdateData($data); + if (!$this -> ldap) { + $GLOBALS['LSerror'] -> addErrorCode('LSattribute_09',array('type' => 'ldap','name' => $this -> name)); + return; + } + else { + $result = $this -> ldap -> getUpdateData($data); + } } $this -> _finalUpdateData = $result; return $result; @@ -657,4 +683,35 @@ class LSattribute { } +/** + * Error Codes + **/ +$GLOBALS['LSerror_code']['LSattribute_01'] = array ( + 'msg' => _("LSattribute : Attribute %{attr} : LDAP or HTML types unknow (LDAP = %{ldap} & HTML = %{html}).") +); +$GLOBALS['LSerror_code']['LSattribute_02'] = array ( + 'msg' => _("LSattribute : The function %{func} to display the attribute %{attr} is unknow.") +); +$GLOBALS['LSerror_code']['LSattribute_03'] = array ( + 'msg' => _("LSattribute : The rule %{rule} to validate the attribute %{attr} is unknow.") +); +$GLOBALS['LSerror_code']['LSattribute_04'] = array ( + 'msg' => _("LSattribute : Configuration data to verify the attribute %{attr} are incorrect.") +); +$GLOBALS['LSerror_code']['LSattribute_05'] = array ( + 'msg' => _("LSattribute : The function %{func} to save the attribute %{attr} is unknow.") +); +$GLOBALS['LSerror_code']['LSattribute_06'] = array ( + 'msg' => _("LSattribute : The value of the attribute %{attr} can't be generated.") +); +$GLOBALS['LSerror_code']['LSattribute_07'] = array ( + 'msg' => _("LSattribute : Generation of the attribute %{attr} failed.") +); +$GLOBALS['LSerror_code']['LSattribute_08'] = array ( + 'msg' => _("LSattribute : Generation of the attribute %{attr} did not return a correct value.") +); +$GLOBALS['LSerror_code']['LSattribute_09'] = array ( + 'msg' => _("LSattribute : The attr_%{type} of the attribute %{name} is not yet defined.") +); + ?> diff --git a/trunk/includes/class/class.LSerror.php b/trunk/includes/class/class.LSerror.php index 0f9b3a4e..87036a09 100644 --- a/trunk/includes/class/class.LSerror.php +++ b/trunk/includes/class/class.LSerror.php @@ -58,36 +58,42 @@ class LSerror { $this -> errors[]=array($code,$msg); } - /** - * Affiche les erreurs et arrête l'execution du code - * - * @author Benjamin Renard - * - * @retval void - */ - function stop(){ - $this -> display(); - exit(1); - } - /** * Affiche les erreurs * * @author Benjamin Renard * + * @param[in] $return boolean True pour que le texte d'erreurs soit retourné + * * @retval void */ - function display() { + function display($return=False) { $errors = $this -> getErrors(); if ($errors) { + if ($return) { + return $errors; + } $GLOBALS['Smarty'] -> assign('LSerrors',$errors); } - /*if(!empty($this -> errors)) { - print "

"._('Erreurs')."

\n"; - foreach ($this -> errors as $error) { - echo "(Code ".$error[0].") ".getFData($GLOBALS['LSerror_code'][$error[0]]['msg'],$error[1])."
\n"; - } - }*/ + } + + /** + * Print errors and stop LdapSaisie + * + * @author Benjamin Renard + * + * @param[in] $code Error code (Goto : addErrorCode()) + * @param[in] $msg Error msg (Goto : addErrorCode()) + * + * @retval void + */ + function stop($code=-1,$msg='') { + if(!empty($this -> errors)) { + print "

"._('Errors')."

\n"; + print $this -> display(true); + } + print "

"._('Stop')."

\n"; + exit ($this -> getError(array($code,$msg))); } /** @@ -100,13 +106,24 @@ class LSerror { function getErrors() { if(!empty($this -> errors)) { foreach ($this -> errors as $error) { - $txt.="(Code ".$error[0].") ".getFData($GLOBALS['LSerror_code'][$error[0]]['msg'],$error[1])."
\n"; + $txt.=$this -> getError($error); } return $txt; } return; } + /** + * Retourne le texte d'une erreur + * + * @author Benjamin Renard + * + * @retvat string Le texte des erreurs + */ + function getError($error) { + return "(Code ".$error[0].") ".getFData($GLOBALS['LSerror_code'][$error[0]]['msg'],$error[1])."
\n"; + } + /** * Définir si il y a des erreurs * @@ -119,4 +136,14 @@ class LSerror { } } +/* + * Error Codes + */ +$GLOBALS['LSerror_code']['-1'] = array ( + 'msg' => _("Unknow error!") +); +$GLOBALS['LSerror_code'][0] = array ( + 'msg' => "%{msg}" +); + ?> diff --git a/trunk/includes/class/class.LSform.php b/trunk/includes/class/class.LSform.php index 92881d3d..2ad384f9 100644 --- a/trunk/includes/class/class.LSform.php +++ b/trunk/includes/class/class.LSform.php @@ -219,7 +219,7 @@ class LSform { return; if ($this -> isSubmit()) { if (!$this -> getPostData()) { - $GLOBALS['LSerror'] -> addErrorCode(201); + $GLOBALS['LSerror'] -> addErrorCode('LSform_01'); return; } $this -> setValuesFromPostData(); @@ -343,7 +343,7 @@ class LSform { function getPostData() { foreach($this -> elements as $element_name => $element) { if( !($element -> getPostData($this -> _postData)) ) { - $GLOBALS['LSerror'] -> addErrorCode(202,$element_name); + $GLOBALS['LSerror'] -> addErrorCode('LSform_02',$element_name); return; } } @@ -366,7 +366,7 @@ class LSform { $elementType='LSformElement_'.$type; $GLOBALS['LSsession'] -> loadLSclass($elementType); if (!class_exists($elementType)) { - $GLOBALS['LSerror'] -> addErrorCode(205,array('type' => $type)); + $GLOBALS['LSerror'] -> addErrorCode('LSform_05',array('type' => $type)); return; } $element=$this -> elements[$name] = new $elementType($this,$name,$label,$params,$attr_html); @@ -375,7 +375,7 @@ class LSform { } else { unset ($this -> elements[$name]); - $GLOBALS['LSerror'] -> addErrorCode(206,array('element' => $name)); + $GLOBALS['LSerror'] -> addErrorCode('LSform_06',array('element' => $name)); return; } } @@ -401,12 +401,12 @@ class LSform { return true; } else { - $GLOBALS['LSerror'] -> addErrorCode(43,array('attr' => $element,'rule'=>$rule)); + $GLOBALS['LSerror'] -> addErrorCode('LSattribute_03',array('attr' => $element,'rule'=>$rule)); return; } } else { - $GLOBALS['LSerror'] -> addErrorCode(204,array('element' => $element)); + $GLOBALS['LSerror'] -> addErrorCode('LSform_04',array('element' => $element)); return; } } @@ -519,4 +519,31 @@ class LSform { } +/** + * Error Codes + */ +$GLOBALS['LSerror_code']['LSform_01'] = array( + 'msg' => _("LSform : Error during the recovery of the values of the form.") +); +$GLOBALS['LSerror_code']['LSform_02'] = array( + 'msg' => _("LSform : Error durring the recovery of the value of the field '%{element}'.") +); +// No longer used +/*$GLOBALS['LSerror_code'][203] = array( + 'msg' => _("LSform : Data of the field %{element} are not validate.") +);*/ +$GLOBALS['LSerror_code']['LSform_04'] = array( + 'msg' => _("LSform : The field %{element} doesn't exist.") +); +$GLOBALS['LSerror_code']['LSform_05'] = array( + 'msg' => _("LSfom : Field type unknow (%{type}).") +); +$GLOBALS['LSerror_code']['LSform_06'] = array( + 'msg' => _("LSform : Error during the creation of the element '%{element}'.") +); +// No longer used +/*$GLOBALS['LSerror_code'][207] = array( + 'msg' => _("LSform : No value has been entered into the field '%{element}'.") +);*/ + ?> diff --git a/trunk/includes/class/class.LSformElement_select_object.php b/trunk/includes/class/class.LSformElement_select_object.php index 7113b50b..c227cc16 100644 --- a/trunk/includes/class/class.LSformElement_select_object.php +++ b/trunk/includes/class/class.LSformElement_select_object.php @@ -149,9 +149,6 @@ class LSformElement_select_object extends LSformElement { return $ret; } } - else { - $GLOBALS['LSerror'] -> addErrorCode(1004,$this -> params['selectable_object']['object_type']); - } } return array(); } diff --git a/trunk/includes/class/class.LSformRule.php b/trunk/includes/class/class.LSformRule.php index d2117f37..40544e98 100644 --- a/trunk/includes/class/class.LSformRule.php +++ b/trunk/includes/class/class.LSformRule.php @@ -50,4 +50,10 @@ class LSformRule { } } +/** + * Error Codes + **/ +$GLOBALS['LSerror_code']['LSformRule_01'] = array ( + 'msg' => _("LSformRule_%{type} : Parameter %{param} is not found.") +); ?> diff --git a/trunk/includes/class/class.LSformRule_compare.php b/trunk/includes/class/class.LSformRule_compare.php index 3392de7e..ddfb76a8 100644 --- a/trunk/includes/class/class.LSformRule_compare.php +++ b/trunk/includes/class/class.LSformRule_compare.php @@ -69,7 +69,7 @@ class LSformRule_compare extends LSformRule { */ function validate ($values,$options=array(),$formElement) { if (!isset($options['params']['operator'])) { - $GLOBALS['LSerror'] -> addErrorCode(303); + $GLOBALS['LSerror'] -> addErrorCode('LSformRule_01',array('type' => 'compare', 'param' => 'operator'); return; } $operator = LSformRule_compare :: _findOperator($options['params']['operator']); diff --git a/trunk/includes/class/class.LSformRule_maxlength.php b/trunk/includes/class/class.LSformRule_maxlength.php index 6f7e927c..585481cd 100644 --- a/trunk/includes/class/class.LSformRule_maxlength.php +++ b/trunk/includes/class/class.LSformRule_maxlength.php @@ -39,7 +39,7 @@ class LSformRule_maxlength extends LSformRule { */ function validate ($value,$options,$formElement) { if(!isset($options['params']['limit'])) { - $GLOBALS['LSerror'] -> addErrorCode(302); + $GLOBALS['LSerror'] -> addErrorCode('LSformRule_01',array('type' => 'maxlength', 'param' => 'limit'); return; } return (strlen($value)<=$options['params']['limit']); diff --git a/trunk/includes/class/class.LSformRule_minlength.php b/trunk/includes/class/class.LSformRule_minlength.php index 170685c5..4ba7252f 100644 --- a/trunk/includes/class/class.LSformRule_minlength.php +++ b/trunk/includes/class/class.LSformRule_minlength.php @@ -39,7 +39,7 @@ class LSformRule_minlength extends LSformRule { */ function validate ($value,$options,$formElement) { if(!isset($options['params']['limit'])) { - $GLOBALS['LSerror'] -> addErrorCode(302); + $GLOBALS['LSerror'] -> addErrorCode('LSformRule_01',array('type' => 'minlength', 'param' => 'limit'); return; } return (strlen($value)>=$options['params']['limit']); diff --git a/trunk/includes/class/class.LSformRule_rangelength.php b/trunk/includes/class/class.LSformRule_rangelength.php index f81c011f..5b832884 100644 --- a/trunk/includes/class/class.LSformRule_rangelength.php +++ b/trunk/includes/class/class.LSformRule_rangelength.php @@ -40,7 +40,7 @@ class LSformRule_rangelength extends LSformRule { */ function validate ($value,$options=array(),$formElement) { if(!isset($options['params']['limits'])) { - $GLOBALS['LSerror'] -> addErrorCode(302); + $GLOBALS['LSerror'] -> addErrorCode('LSformRule_01',array('type' => 'rangelength', 'param' => 'limit'); return; } $len=strlen($value); diff --git a/trunk/includes/class/class.LSformRule_regex.php b/trunk/includes/class/class.LSformRule_regex.php index 5d8833e4..00ec39d1 100644 --- a/trunk/includes/class/class.LSformRule_regex.php +++ b/trunk/includes/class/class.LSformRule_regex.php @@ -43,7 +43,7 @@ class LSformRule_regex extends LSformRule { $regex=$option['params']['regex']; } else { - $GLOBALS['LSerror'] -> addErrorCode(801); + $GLOBALS['LSerror'] -> addErrorCode('LSformRule_regex_01'); return; } } @@ -58,4 +58,11 @@ class LSformRule_regex extends LSformRule { } +/* + * Error Codes + */ +$GLOBALS['LSerror_code']['LSformRule_regex_01'] = array( + 'msg' => _("LSformRule_regex : Regex has not been configured to validate data.") +); + ?> diff --git a/trunk/includes/class/class.LSldap.php b/trunk/includes/class/class.LSldap.php index 8fe8fe0b..c4cad375 100644 --- a/trunk/includes/class/class.LSldap.php +++ b/trunk/includes/class/class.LSldap.php @@ -63,7 +63,7 @@ class LSldap { function connect() { $this -> cnx = Net_LDAP2::connect($this -> config); if (Net_LDAP2::isError($this -> cnx)) { - $GLOBALS['LSerror'] -> addErrorCode(1,$this -> cnx -> getMessage()); + $GLOBALS['LSerror'] -> addErrorCode('LSldap_01',$this -> cnx -> getMessage()); $this -> cnx = NULL; return; } @@ -105,7 +105,7 @@ class LSldap { function search ($filter,$basedn=NULL,$params = array()) { $ret = $this -> cnx -> search($basedn,$filter,$params); if (Net_LDAP2::isError($ret)) { - $GLOBALS['LSerror'] -> addErrorCode(2,$ret -> getMessage()); + $GLOBALS['LSerror'] -> addErrorCode('LSldap_02',$ret -> getMessage()); return; } $retInfos=array(); @@ -136,7 +136,7 @@ class LSldap { $filter=NULL; $ret = $this -> cnx -> search($basedn,$filter,$params); if (Net_LDAP2::isError($ret)) { - $GLOBALS['LSerror'] -> addErrorCode(2,$ret -> getMessage()); + $GLOBALS['LSerror'] -> addErrorCode('LSldap_02',$ret -> getMessage()); return; } return $ret -> count(); @@ -212,7 +212,7 @@ class LSldap { } } else { - $GLOBALS['LSerror'] -> addErrorCode(3); + $GLOBALS['LSerror'] -> addErrorCode('LSldap_03'); return; } } @@ -299,7 +299,7 @@ class LSldap { } if (Net_LDAP2::isError($ret)) { - $GLOBALS['LSerror'] -> addErrorCode(5,$dn); + $GLOBALS['LSerror'] -> addErrorCode('LSldap_05',$dn); $GLOBALS['LSerror'] -> addErrorCode(0,'NetLdap-Error : '.$ret->getMessage()); } else { @@ -316,7 +316,7 @@ class LSldap { } $ret = $entry -> update(); if (Net_LDAP2::isError($ret)) { - $GLOBALS['LSerror'] -> addErrorCode(6); + $GLOBALS['LSerror'] -> addErrorCode('LSldap_06'); $GLOBALS['LSerror'] -> addErrorCode(0,'NetLdap-Error : '.$ret->getMessage()); } } @@ -324,7 +324,7 @@ class LSldap { } } else { - $GLOBALS['LSerror'] -> addErrorCode(4); + $GLOBALS['LSerror'] -> addErrorCode('LSldap_04'); return; } } @@ -386,7 +386,7 @@ class LSldap { function move($old,$new) { $ret = $this -> cnx -> move($old,$new); if (Net_LDAP2::isError($ret)) { - $GLOBALS['LSerror'] -> addErrorCode(7); + $GLOBALS['LSerror'] -> addErrorCode('LSldap_07'); $GLOBALS['LSerror'] -> addErrorCode(0,'NetLdap-Error : '.$ret->getMessage()); return; } @@ -394,4 +394,28 @@ class LSldap { } } +/* + * Error Codes + */ +$GLOBALS['LSerror_code']['LSldap_01'] = array ( + 'msg' => _("LSldap : Error during the LDAP server connection (%{msg}).") +); +$GLOBALS['LSerror_code']['LSldap_02'] = array ( + 'msg' => _("LSldap : Error during the LDAP search (%{msg}).") +); +$GLOBALS['LSerror_code']['LSldap_03'] = array ( + 'msg' => _("LSldap : Object type unkown.") +); +$GLOBALS['LSerror_code']['LSldap_04'] = array ( + 'msg' => _("LSldap : Error during fecthing the LDAP entry.") +); +$GLOBALS['LSerror_code']['LSldap_05'] = array ( + 'msg' => _("LSldap : Error during changing the LDAP entry (DN : %{dn}).") +); +$GLOBALS['LSerror_code']['LSldap_06'] = array ( + 'msg' => _("LSldap : Error during deleting the empty attributes.") +); +$GLOBALS['LSerror_code']['LSldap_07'] = array ( + 'msg' => _("LSldap : Error during changing the DN of the object.") +); ?> diff --git a/trunk/includes/class/class.LSldapObject.php b/trunk/includes/class/class.LSldapObject.php index 604834b0..32d431e3 100644 --- a/trunk/includes/class/class.LSldapObject.php +++ b/trunk/includes/class/class.LSldapObject.php @@ -64,7 +64,7 @@ class LSldapObject { $this -> config = $GLOBALS['LSobjects'][$type_name]; } else { - $GLOBALS['LSerror'] -> addErrorCode(21); + $GLOBALS['LSerror'] -> addErrorCode('LSldapObject_01'); return; } } @@ -276,7 +276,7 @@ class LSldapObject { if(isset($this -> forms[$idForm])) $LSform = $this -> forms[$idForm][0]; else { - $GLOBALS['LSerror'] -> addErrorCode(22,$this -> getType()); + $GLOBALS['LSerror'] -> addErrorCode('LSldapObject_02',$this -> getType()); return; } } @@ -289,7 +289,7 @@ class LSldapObject { $LSform = $LSform[0]; } else { - $GLOBALS['LSerror'] -> addErrorCode(23,$this -> getType()); + $GLOBALS['LSerror'] -> addErrorCode('LSldapObject_03',$this -> getType()); return; } } @@ -307,12 +307,12 @@ class LSldapObject { if(isset($this -> config['before_modify'])) { if(function_exists($this -> config['before_modify'])) { if(!$this -> config['before_modify']($this)) { - $GLOBALS['LSerror'] -> addErrorCode(28,$this -> config['before_modify']); + $GLOBALS['LSerror'] -> addErrorCode('LSldapObject_08',$this -> config['before_modify']); return; } } else { - $GLOBALS['LSerror'] -> addErrorCode(27,$this -> config['before_modify']); + $GLOBALS['LSerror'] -> addErrorCode('LSldapObject_07',$this -> config['before_modify']); return; } } @@ -333,12 +333,12 @@ class LSldapObject { if((isset($this -> config['after_modify']))&&(!$this -> submitError)) { if(function_exists($this -> config['after_modify'])) { if(!$this -> config['after_modify']($this)) { - $GLOBALS['LSerror'] -> addErrorCode(30,$this -> config['after_modify']); + $GLOBALS['LSerror'] -> addErrorCode('LSldapObject_10',$this -> config['after_modify']); return; } } else { - $GLOBALS['LSerror'] -> addErrorCode(29,$this -> config['after_modify']); + $GLOBALS['LSerror'] -> addErrorCode('LSldapObject_09',$this -> config['after_modify']); return; } } @@ -378,17 +378,17 @@ class LSldapObject { if ( $attr -> canBeGenerated()) { if ($attr -> generateValue()) { if (!$this -> validateAttrData($LSform, $attr)) { - $GLOBALS['LSerror'] -> addErrorCode(48,$attr -> getLabel()); + $GLOBALS['LSerror'] -> addErrorCode('LSattribute_08',$attr -> getLabel()); $retval = false; } } else { - $GLOBALS['LSerror'] -> addErrorCode(47,$attr -> getLabel()); + $GLOBALS['LSerror'] -> addErrorCode('LSattribute_07',$attr -> getLabel()); $retval = false; } } else { - $GLOBALS['LSerror'] -> addErrorCode(46,$attr -> getLabel()); + $GLOBALS['LSerror'] -> addErrorCode('LSattribute_06',$attr -> getLabel()); $retval = false; } } @@ -476,12 +476,12 @@ class LSldapObject { } } else { - $GLOBALS['LSerror'] -> addErrorCode(24,array('attr' => $attr->name,'obj' => $this->getType(),'func' => $test['function'])); + $GLOBALS['LSerror'] -> addErrorCode('LSldapObject_04',array('attr' => $attr->name,'obj' => $this->getType(),'func' => $test['function'])); $retval = false; } } else { - $GLOBALS['LSerror'] -> addErrorCode(25,array('attr' => $attr->name,'obj' => $this->getType())); + $GLOBALS['LSerror'] -> addErrorCode('LSldapObject_05',array('attr' => $attr->name,'obj' => $this->getType())); $retval = false; } } @@ -492,17 +492,17 @@ class LSldapObject { if (!empty($dependsAttrs)) { foreach($dependsAttrs as $dependAttr) { if(!isset($this -> attrs[$dependAttr])){ - $GLOBALS['LSerror'] -> addErrorCode(34,array('attr_depend' => $dependAttr, 'attr' => $attr -> getLabel())); + $GLOBALS['LSerror'] -> addErrorCode('LSldapObject_14',array('attr_depend' => $dependAttr, 'attr' => $attr -> getLabel())); continue; } if($this -> attrs[$dependAttr] -> canBeGenerated()) { if (!$this -> attrs[$dependAttr] -> generateValue()) { - $GLOBALS['LSerror'] -> addErrorCode(47,$this -> attrs[$dependAttr] -> getLabel()); + $GLOBALS['LSerror'] -> addErrorCode('LSattribute_07',$this -> attrs[$dependAttr] -> getLabel()); $retval = false; } } else { - $GLOBALS['LSerror'] -> addErrorCode(46,$this -> attrs[$dependAttr] -> getLabel()); + $GLOBALS['LSerror'] -> addErrorCode('LSattribute_06',$this -> attrs[$dependAttr] -> getLabel()); $retval = false; } } @@ -531,7 +531,7 @@ class LSldapObject { $new = true; LSdebug('Rename'); if (!$this -> beforeRename()) { - $GLOBALS['LSerror'] -> addErrorCode(36); + $GLOBALS['LSerror'] -> addErrorCode('LSldapObject_16'); return; } $oldDn = $this -> getDn(); @@ -543,7 +543,7 @@ class LSldapObject { } $this -> dn = $newDn; if (!$this -> afterRename($oldDn,$newDn)) { - $GLOBALS['LSerror'] -> addErrorCode(37); + $GLOBALS['LSerror'] -> addErrorCode('LSldapObject_17'); return; } } @@ -566,14 +566,14 @@ class LSldapObject { } if ($new) { if (!$this -> afterCreate()) { - $GLOBALS['LSerror'] -> addErrorCode(301); + $GLOBALS['LSerror'] -> addErrorCode('LSldapObject_21'); return; } } return true; } else { - $GLOBALS['LSerror'] -> addErrorCode(33); + $GLOBALS['LSerror'] -> addErrorCode('LSldapObject_13'); return; } } @@ -1003,12 +1003,12 @@ class LSldapObject { return $rdn_attr.'='.$rdn_val[0].','.$this -> config['container_dn'].','.$GLOBALS['LSsession']->topDn; } else { - $GLOBALS['LSerror'] -> addErrorCode(32,$this -> config['rdn']); + $GLOBALS['LSerror'] -> addErrorCode('LSldapObject_12',$this -> config['rdn']); return; } } else { - $GLOBALS['LSerror'] -> addErrorCode(31,$this -> getType()); + $GLOBALS['LSerror'] -> addErrorCode('LSldapObject_11',$this -> getType()); return; } } @@ -1063,11 +1063,11 @@ class LSldapObject { if ($this -> afterDelete()) { return true; } - $GLOBALS['LSerror'] -> addErrorCode(39); + $GLOBALS['LSerror'] -> addErrorCode('LSldapObject_19'); } } else { - $GLOBALS['LSerror'] -> addErrorCode(38); + $GLOBALS['LSerror'] -> addErrorCode('LSldapObject_18'); } return; } @@ -1159,7 +1159,6 @@ class LSldapObject { } } else { - $GLOBALS['LSerror'] -> addErrorCode(1004,$relation_conf['LSobject']); return; } } @@ -1267,12 +1266,12 @@ class LSldapObject { foreach($config as $action) { if(function_exists($action)) { if(!$action($this)) { - $GLOBALS['LSerror'] -> addErrorCode(305,$action); + $GLOBALS['LSerror'] -> addErrorCode('LSldapObject_25',$action); $error=true; } } else { - $GLOBALS['LSerror'] -> addErrorCode(304,$action); + $GLOBALS['LSerror'] -> addErrorCode('LSldapObject_24',$action); $error=true; } } @@ -1312,7 +1311,6 @@ class LSldapObject { } } else { - $GLOBALS['LSerror'] -> addErrorCode(1004,$type); $error=1; } } @@ -1329,12 +1327,12 @@ class LSldapObject { foreach($config as $action) { if(function_exists($action)) { if(!$action($this)) { - $GLOBALS['LSerror'] -> addErrorCode(303,$action); + $GLOBALS['LSerror'] -> addErrorCode('LSldapObject_23',$action); $error=true; } } else { - $GLOBALS['LSerror'] -> addErrorCode(302,$action); + $GLOBALS['LSerror'] -> addErrorCode('LSldapObject_22',$action); $error=true; } } @@ -1357,7 +1355,7 @@ class LSldapObject { **/ function getObjectKeyValueInRelation($object,$attr,$objectType,$attrValue='dn') { if ((!$attr)||(!$objectType)) { - $GLOBALS['LSerror'] -> addErrorCode(1021,'getObjectKeyValueInRelation'); + $GLOBALS['LSerror'] -> addErrorCode('LSrelations_05','getObjectKeyValueInRelation'); return; } if ($attrValue=='dn') { @@ -1390,7 +1388,7 @@ class LSldapObject { **/ function listObjectsInRelation($object,$attr,$objectType,$attrValue='dn') { if ((!$attr)||(!$objectType)) { - $GLOBALS['LSerror'] -> addErrorCode(1021,'listObjectsInRelation'); + $GLOBALS['LSerror'] -> addErrorCode('LSrelations_05','listObjectsInRelation'); return; } if ($attrValue=='dn') { @@ -1422,7 +1420,7 @@ class LSldapObject { **/ function addOneObjectInRelation($object,$attr,$objectType,$attrValue='dn') { if ((!$attr)||(!$objectType)) { - $GLOBALS['LSerror'] -> addErrorCode(1021,'addOneObjectInRelation'); + $GLOBALS['LSerror'] -> addErrorCode('LSrelations_05','addOneObjectInRelation'); return; } if ($object instanceof $objectType) { @@ -1472,7 +1470,7 @@ class LSldapObject { **/ function deleteOneObjectInRelation($object,$attr,$objectType,$attrValue='dn') { if ((!$attr)||(!$objectType)) { - $GLOBALS['LSerror'] -> addErrorCode(1021,'deleteOneObjectInRelation'); + $GLOBALS['LSerror'] -> addErrorCode('LSrelations_05','deleteOneObjectInRelation'); return; } if ($object instanceof $objectType) { @@ -1517,7 +1515,7 @@ class LSldapObject { */ function renameOneObjectInRelation($object,$oldValue,$attr,$objectType,$attrValue='dn') { if ((!$attr)||(!$objectType)) { - $GLOBALS['LSerror'] -> addErrorCode(1021,'renameOneObjectInRelation'); + $GLOBALS['LSerror'] -> addErrorCode('LSrelations_05','renameOneObjectInRelation'); return; } if ($object instanceof $objectType) { @@ -1567,7 +1565,7 @@ class LSldapObject { **/ function updateObjectsInRelation($object,$listDns,$attr,$objectType,$attrValue='dn') { if ((!$attr)||(!$objectType)) { - $GLOBALS['LSerror'] -> addErrorCode(1021,'updateObjectsInRelation'); + $GLOBALS['LSerror'] -> addErrorCode('LSrelations_05','updateObjectsInRelation'); return; } $currentObjects = $this -> listObjectsInRelation($object,$attr,$objectType,$attrValue); @@ -1654,4 +1652,96 @@ class LSldapObject { } +/** + * Error Codes + **/ +$GLOBALS['LSerror_code']['LSldapObject_01'] = array ( + 'msg' => _("LSldapObject : Object type unknow.") +); +$GLOBALS['LSerror_code']['LSldapObject_02'] = array ( + 'msg' => _("LSldapObject : Update form is not defined for the object %{obj}.") +); +$GLOBALS['LSerror_code']['LSldapObject_03'] = array ( + 'msg' => _("LSldapObject : No form exist for the object %{obj}.") +); +$GLOBALS['LSerror_code']['LSldapObject_04'] = array ( + 'msg' => _("LSldapObject : The function %{func} to validate the attribute %{attr} the object %{obj} is unknow.") +); +$GLOBALS['LSerror_code']['LSldapObject_05'] = array ( + 'msg' => _("LSldapObject : Configuration data are missing to validate the attribute %{attr} of the object %{obj}.") +); +/* No longer used +$GLOBALS['LSerror_code'][26] = array ( + 'msg' => _("LSldapObject : Configuration error : The object %{obj} doesn't had attribute %{attr}.") +); +*/ +$GLOBALS['LSerror_code']['LSldapObject_07'] = array ( + 'msg' => _("LSldapObject : The function %{func} to be executed before changing the object doesn't exist.") +); +$GLOBALS['LSerror_code']['LSldapObject_08'] = array ( + 'msg' => _("LSldapObject : The execution of the function %{func} to be executed before changing the object failed.") +); +$GLOBALS['LSerror_code']['LSldapObject_09'] = array ( + 'msg' => _("LSldapObject : The function %{func} to be executed after changing the object doesn't exist.") +); +$GLOBALS['LSerror_code']['LSldapObject_10'] = array ( + 'msg' => _("LSldapObject : The execution of the function %{func} to be executed after changing the object failed.") +); +$GLOBALS['LSerror_code']['LSldapObject_11'] = array ( + 'msg' => _("LSldapObject : Some configuration data of the object type %{obj} are missing to generate the DN of the new object.") +); +$GLOBALS['LSerror_code']['LSldapObject_12'] = array ( + 'msg' => _("LSldapObject : The attibute %{attr} of the object is not yet defined. Impossible to generate DN.") +); +$GLOBALS['LSerror_code']['LSldapObject_13'] = array ( + 'msg' => _("LSldapObject : Without DN, the object could not be changed.") +); +$GLOBALS['LSerror_code']['LSldapObject_14'] = array ( + 'msg' => _("LSldapObject : The attribute %{attr_depend} depending on the attribute %{attr} doesn't exist.") +); +$GLOBALS['LSerror_code']['LSldapObject_15'] = array ( + 'msg' => _("LSldapObject : Error during deleting the object %{objectname}.") +); +$GLOBALS['LSerror_code']['LSldapObject_16'] = array ( + 'msg' => _("LSldapObject : Error during actions to be executed before renaming the objet.") +); +$GLOBALS['LSerror_code']['LSldapObject_17'] = array ( + 'msg' => _("LSldapObject : Error during actions to be executed after renaming the objet.") +); +$GLOBALS['LSerror_code']['LSldapObject_18'] = array ( + 'msg' => _("LSldapObject : Error during actions to be executed before deleting the objet.") +); +$GLOBALS['LSerror_code']['LSldapObject_19'] = array ( + 'msg' => _("LSldapObject : Error during actions to be executed after deleting the objet.") +); +// 20 : not used +$GLOBALS['LSerror_code']['LSldapObject_21'] = array ( + 'msg' => _("LSldapObject : Error during the actions to be executed after creating the object. It was created anyway.") +); +$GLOBALS['LSerror_code']['LSldapObject_22'] = array ( + 'msg' => _("LSldapObject : The function %{func} to be generated before creating the object doesn't exist.") +); +$GLOBALS['LSerror_code']['LSldapObject_23'] = array ( + 'msg' => _("LSldapObject : Error during the execution of the function %{func} to be generated after deleting the object.") +); +$GLOBALS['LSerror_code']['LSldapObject_24'] = array ( + 'msg' => _("LSldapObject : The function %{func} to be generated after deleting the object doesn't exist.") +); +$GLOBALS['LSerror_code']['LSldapObject_25'] = array ( + 'msg' => _("LSldapObject : Error during the execution of the function %{func} to be generated after creating the object.") +); +/* Not yet used +$GLOBALS['LSerror_code'][306] = array ( + 'msg' => _("LSldapObject : The function %{func} to be executed after changing the attribute %{attr} is unknow.") +); +$GLOBALS['LSerror_code'][307] = array ( + 'msg' => _("LSldapObject : The execution of the function %{func} to be executed after changing the attribute %{attr} failed.") +); +$GLOBALS['LSerror_code'][308] = array ( + 'msg' => _("LSldapObject : The function %{func} to be executed before changing the attribute %{attr} is unknow.") +); +$GLOBALS['LSerror_code'][309] = array ( + 'msg' => _("LSldapObject : The execution of the function %{func} to be executed before changing the attribute %{attr} failed.") +); +*/ ?> diff --git a/trunk/includes/class/class.LSsession.php b/trunk/includes/class/class.LSsession.php index 4b6a5f53..a5031f47 100644 --- a/trunk/includes/class/class.LSsession.php +++ b/trunk/includes/class/class.LSsession.php @@ -42,7 +42,7 @@ class LSsession { var $_JSconfigParams = array(); var $CssFiles = array(); var $template = NULL; - var $LSrights = array(); + var $LSprofiles = array(); var $LSaccess = array(); var $tmp_file = array(); var $_subDnLdapServer = array(); @@ -88,7 +88,7 @@ class LSsession { return true; } else { - die($GLOBALS['LSerror_code'][1008]['msg']); + die($GLOBALS['LSerror_code']['LSsession_08']['msg']); return; } return true; @@ -96,6 +96,7 @@ class LSsession { else { return; } + } /** @@ -108,8 +109,9 @@ class LSsession { * @retval boolean true si l'initialisation a réussi, false sinon. */ function startLSerror() { - if(!$this -> loadLSclass('LSerror')) + if(!$this -> loadLSclass('LSerror')) { return; + } $GLOBALS['LSerror'] = new LSerror(); return true; } @@ -129,7 +131,7 @@ class LSsession { return true; if($type!='') $type=$type.'.'; - return include_once LS_CLASS_DIR .'class.'.$type.$class.'.php'; + return @include_once LS_CLASS_DIR .'class.'.$type.$class.'.php'; } /** @@ -140,11 +142,16 @@ class LSsession { * @retval boolean true si le chargement a réussi, false sinon. */ function loadLSobject($object) { + $error = 0; $this -> loadLSclass('LSldapObject'); if (!$this -> loadLSclass($object,'LSobjects')) { - return; + $error = 1; } if (!require_once( LS_OBJECTS_DIR . 'config.LSobjects.'.$object.'.php' )) { + $error = 1; + } + if ($error) { + $GLOBALS['LSerror'] -> addErrorCode('LSsession_04',$object); return; } return true; @@ -162,7 +169,7 @@ class LSsession { function loadLSaddon($addon) { if(require_once LS_ADDONS_DIR .'LSaddons.'.$addon.'.php') { if (!call_user_func('LSaddon_'. $addon .'_support')) { - $GLOBALS['LSerror'] -> addErrorCode(1002,$addon); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_02',$addon); return; } return true; @@ -180,7 +187,7 @@ class LSsession { */ function loadLSaddons() { if(!is_array($GLOBALS['LSaddons']['loads'])) { - $GLOBALS['LSerror'] -> addErrorCode(1001,"LSaddons['loads']"); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_01',"LSaddons['loads']"); return; } @@ -230,9 +237,9 @@ class LSsession { $this -> ldapServerId = $_SESSION['LSsession']['ldapServerId']; $this -> tmp_file = $_SESSION['LSsession']['tmp_file']; - if ( $this -> cacheLSrights() && !isset($_REQUEST['LSsession_refresh']) ) { + if ( $this -> cacheLSprofiles() && !isset($_REQUEST['LSsession_refresh']) ) { $this -> ldapServer = $_SESSION['LSsession']['ldapServer']; - $this -> LSrights = $_SESSION['LSsession']['LSrights']; + $this -> LSprofiles = $_SESSION['LSsession']['LSprofiles']; $this -> LSaccess = $_SESSION['LSsession']['LSaccess']; if (!$this -> LSldapConnect()) return; @@ -241,22 +248,21 @@ class LSsession { $this -> setLdapServer($this -> ldapServerId); if (!$this -> LSldapConnect()) return; - $this -> loadLSrights(); + $this -> loadLSprofiles(); } if ( $this -> cacheSudDn() && (!isset($_REQUEST['LSsession_refresh'])) ) { $this -> _subDnLdapServer = $_SESSION['LSsession_subDnLdapServer']; } - if (!$this -> loadLSobject($this -> ldapServer['authobject'])) { - $GLOBALS['LSerror'] -> addErrorCode(1004,$this -> ldapServer['authobject']); + if (!$this -> loadLSobject($this -> ldapServer['authObjectType'])) { return; } - $this -> LSuserObject = new $this -> ldapServer['authobject'](); + $this -> LSuserObject = new $this -> ldapServer['authObjectType'](); $this -> LSuserObject -> loadData($this -> dn); - if ( !$this -> cacheLSrights() || isset($_REQUEST['LSsession_refresh']) ) { + if ( !$this -> cacheLSprofiles() || isset($_REQUEST['LSsession_refresh']) ) { $this -> loadLSaccess(); } @@ -296,8 +302,8 @@ class LSsession { } $_SESSION['LSsession_topDn']=$this -> topDn; - if ( $this -> loadLSobject($this -> ldapServer['authobject']) ) { - $authobject = new $this -> ldapServer['authobject'](); + if ( $this -> loadLSobject($this -> ldapServer['authObjectType']) ) { + $authobject = new $this -> ldapServer['authObjectType'](); $find=true; if (isset($_GET['recoveryHash'])) { $filter=$this -> ldapServer['recoverPassword']['recoveryHashAttr']."=".$_GET['recoveryHash']; @@ -317,11 +323,11 @@ class LSsession { if ($nbresult==0) { // identifiant incorrect LSdebug('identifiant incorrect'); - $GLOBALS['LSerror'] -> addErrorCode(1006); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_06'); } else if ($nbresult>1) { // duplication d'authentité - $GLOBALS['LSerror'] -> addErrorCode(1007); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_07'); } else { if (isset($_GET['LSsession_recoverPassword'])) { @@ -382,24 +388,24 @@ class LSsession { else { // Problème durant l'envoie du mail LSdebug("Problème durant l'envoie du mail"); - $GLOBALS['LSerror'] -> addErrorCode(1020); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_20',7); } } else { // Erreur durant la mise à jour de l'objet LSdebug("Erreur durant la mise à jour de l'objet"); - $GLOBALS['LSerror'] -> addErrorCode(1020); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_20',6); } } else { // Erreur durant la validation du formulaire de modification de perte de password LSdebug("Erreur durant la validation du formulaire de modification de perte de password"); - $GLOBALS['LSerror'] -> addErrorCode(1020); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_20',5); } } // 2nd étape : génération du mot de passe + envoie par mail else { - $attr=$user -> attrs[$this -> ldapServer['authobject_pwdattr']]; + $attr=$user -> attrs[$this -> ldapServer['authObjectTypeAttrPwd']]; if ($attr instanceof LSattribute) { $mdp = generatePassword($attr -> config['html_options']['chars'],$attr -> config['html_options']['lenght']); LSdebug('Nvx mpd : '.$mdp); @@ -407,7 +413,7 @@ class LSsession { $lostPasswdForm -> setPostData( array( $this -> ldapServer['recoverPassword']['recoveryHashAttr'] => array(''), - $this -> ldapServer['authobject_pwdattr'] => array($mdp) + $this -> ldapServer['authObjectTypeAttrPwd'] => array($mdp) ) ,true ); @@ -427,35 +433,35 @@ class LSsession { else { // Problème durant l'envoie du mail LSdebug("Problème durant l'envoie du mail"); - $GLOBALS['LSerror'] -> addErrorCode(1020); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_20',4); } } else { // Erreur durant la mise à jour de l'objet LSdebug("Erreur durant la mise à jour de l'objet"); - $GLOBALS['LSerror'] -> addErrorCode(1020); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_20',3); } } else { // Erreur durant la validation du formulaire de modification de perte de password LSdebug("Erreur durant la validation du formulaire de modification de perte de password"); - $GLOBALS['LSerror'] -> addErrorCode(1020); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_20',2); } } else { // l'attribut password n'existe pas LSdebug("L'attribut password n'existe pas"); - $GLOBALS['LSerror'] -> addErrorCode(1020); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_20',1); } } } else { - $GLOBALS['LSerror'] -> addErrorCode(1019); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_19'); } } } else { - $GLOBALS['LSerror'] -> addErrorCode(1018); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_18'); } } else { @@ -464,25 +470,25 @@ class LSsession { $this -> LSuserObject = $result[0]; $this -> dn = $result[0]->getValue('dn'); $this -> rdn = $_POST['LSsession_user']; - $this -> loadLSrights(); + $this -> loadLSprofiles(); $this -> loadLSaccess(); $GLOBALS['Smarty'] -> assign('LSsession_username',$this -> LSuserObject -> getDisplayValue()); $_SESSION['LSsession']=get_object_vars($this); return true; } else { - $GLOBALS['LSerror'] -> addErrorCode(1006); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_06'); LSdebug('mdp incorrect'); } } } } else { - $GLOBALS['LSerror'] -> addErrorCode(1010); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_10'); } } else { - $GLOBALS['LSerror'] -> addErrorCode(1009); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_09'); } } if ($this -> ldapServerId) { @@ -504,12 +510,12 @@ class LSsession { * * @param[in] $object Mixed L'objet Ldap du nouvel utilisateur * le type doit correspondre à - * $this -> ldapServer['authobject'] + * $this -> ldapServer['authObjectType'] * * @retval boolean True en cas de succès, false sinon */ function changeAuthUser($object) { - if ($object instanceof $this -> ldapServer['authobject']) { + if ($object instanceof $this -> ldapServer['authObjectType']) { $this -> dn = $object -> getDn(); $rdn = $object -> getValue('rdn'); if(is_array($rdn)) { @@ -518,7 +524,7 @@ class LSsession { $this -> rdn = $rdn; $this -> LSuserObject = $object; - if($this -> loadLSrights()) { + if($this -> loadLSprofiles()) { $this -> loadLSaccess(); $_SESSION['LSsession']=get_object_vars($this); return true; @@ -568,7 +574,7 @@ class LSsession { } } else { - $GLOBALS['LSerror'] -> addErrorCode(1003); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_03'); return; } } @@ -582,56 +588,54 @@ class LSsession { if ($this -> cacheSudDn() && isset($this -> _subDnLdapServer[$this -> ldapServerId])) { return $this -> _subDnLdapServer[$this -> ldapServerId]; } - if ( is_array($this ->ldapServer['subDn']) ) { - $return=array(); - foreach($this ->ldapServer['subDn'] as $subDn_name => $subDn_config) { - if ($subDn_name == 'LSobject') { - if (is_array($subDn_config)) { - foreach($subDn_config as $LSobject_name => $LSoject_config) { - if ($LSoject_config['topDn']) { - $topDn = $LSoject_config['topDn']; - } - else { - $topDn = NULL; - } - if( $this -> loadLSobject($LSobject_name) ) { - if ($subdnobject = new $LSobject_name()) { - $tbl_return = $subdnobject -> getSelectArray(NULL,$topDn); - if (is_array($tbl_return)) { - $return=array_merge($return,$tbl_return); - } - else { - $GLOBALS['LSerror'] -> addErrorCode(1017); - } + if (!isset($this ->ldapServer['subDn'])) { + return; + } + if ( !is_array($this ->ldapServer['subDn']) ) { + return; + } + $return=array(); + foreach($this ->ldapServer['subDn'] as $subDn_name => $subDn_config) { + if ($subDn_name == 'LSobject') { + if (is_array($subDn_config)) { + foreach($subDn_config as $LSobject_name => $LSoject_config) { + if ($LSoject_config['topDn']) { + $topDn = $LSoject_config['topDn']; + } + else { + $topDn = NULL; + } + if( $this -> loadLSobject($LSobject_name) ) { + if ($subdnobject = new $LSobject_name()) { + $tbl_return = $subdnobject -> getSelectArray(NULL,$topDn); + if (is_array($tbl_return)) { + $return=array_merge($return,$tbl_return); } else { - $GLOBALS['LSerror'] -> addErrorCode(1017); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_17',3); } } else { - $GLOBALS['LSerror'] -> addErrorCode(1004,$LSobject_name); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_17',2); } } } - else { - $GLOBALS['LSerror'] -> addErrorCode(1017); - } } else { - if ((isCompatibleDNs($subDn_config['dn'],$this -> ldapServer['ldap_config']['basedn']))&&($subDn_config['dn']!="")) { - $return[$subDn_config['dn']] = $subDn_name; - } + $GLOBALS['LSerror'] -> addErrorCode('LSsession_17',1); } } - if ($this -> cacheSudDn()) { - $this -> _subDnLdapServer[$this -> ldapServerId]=$return; - $_SESSION['LSsession_subDnLdapServer'] = $this -> _subDnLdapServer; + else { + if ((isCompatibleDNs($subDn_config['dn'],$this -> ldapServer['ldap_config']['basedn']))&&($subDn_config['dn']!="")) { + $return[$subDn_config['dn']] = $subDn_name; + } } - return $return; } - else { - return; + if ($this -> cacheSudDn()) { + $this -> _subDnLdapServer[$this -> ldapServerId]=$return; + $_SESSION['LSsession_subDnLdapServer'] = $this -> _subDnLdapServer; } + return $return; } /** @@ -893,6 +897,7 @@ class LSsession { // Css $this -> addCssFile("LSdefault.css"); + $Css_txt=''; foreach ($this -> CssFiles as $file) { if (!$file['path']) { $file['path']=LS_CSS_DIR.'/'; @@ -901,13 +906,15 @@ class LSsession { } $GLOBALS['Smarty'] -> assign('LSsession_css',$Css_txt); - $GLOBALS['Smarty'] -> assign('LSaccess',$this -> LSaccess[$this -> topDn]); + if (isset($this -> LSaccess[$this -> topDn])) { + $GLOBALS['Smarty'] -> assign('LSaccess',$this -> LSaccess[$this -> topDn]); + } // Niveau $listTopDn = $this -> getSubDnLdapServer(); if (is_array($listTopDn)) { asort($listTopDn); - $GLOBALS['Smarty'] -> assign('label_level',$this -> getLevelLabel()); + $GLOBALS['Smarty'] -> assign('label_level',$this -> getSubDnLabel()); $GLOBALS['Smarty'] -> assign('_refresh',_('Rafraîchir')); $LSsession_topDn_index = array(); $LSsession_topDn_name = array(); @@ -999,11 +1006,15 @@ class LSsession { * * @retval boolean True si le chargement à réussi, false sinon. **/ - function loadLSrights() { - if (is_array($this -> ldapServer['LSrights'])) { - foreach ($this -> ldapServer['LSrights'] as $profile => $profileInfos) { + function loadLSprofiles() { + if (is_array($this -> ldapServer['LSprofiles'])) { + foreach ($this -> ldapServer['LSprofiles'] as $profile => $profileInfos) { if (is_array($profileInfos)) { foreach ($profileInfos as $topDn => $rightsInfos) { + /* + * If $topDn == 'LSobject', we search for each LSobject type to find + * all items on witch the user will have powers. + */ if ($topDn == 'LSobjects') { if (is_array($rightsInfos)) { foreach ($rightsInfos as $LSobject => $listInfos) { @@ -1017,16 +1028,13 @@ class LSsession { } $list = $object -> search($filter,$listInfos['basedn'],$listInfos['params']); foreach($list as $obj) { - $this -> LSrights[$profile][] = $obj['dn']; + $this -> LSprofiles[$profile][] = $obj['dn']; } } else { LSdebug('Impossible de créer l\'objet de type : '.$LSobject); } } - else { - $GLOBALS['LSerror'] -> addErrorCode(1004,$LSobject); - } } } else { @@ -1045,7 +1053,7 @@ class LSsession { $val = $this -> LSuserObject -> getFData($valKey); if (is_array($listDns)) { if (in_array($val,$listDns)) { - $this -> LSrights[$profile][] = $topDn; + $this -> LSprofiles[$profile][] = $topDn; } } } @@ -1057,27 +1065,24 @@ class LSsession { LSdebug('Impossible de créer l\'objet de type : '.$conf['LSobject']); } } - else { - $GLOBALS['LSerror'] -> addErrorCode(1004,$conf['LSobject']); - } } else { if ($this -> dn == $dn) { - $this -> LSrights[$profile][] = $topDn; + $this -> LSprofiles[$profile][] = $topDn; } } } } else { if ( $this -> dn == $rightsInfos ) { - $this -> LSrights[$profile][] = $topDn; + $this -> LSprofiles[$profile][] = $topDn; } } } // fin else ($topDn == 'LSobjects') } // fin foreach($profileInfos) } // fin is_array($profileInfos) - } // fin foreach LSrights - LSdebug($this -> LSrights); + } // fin foreach LSprofiles + LSdebug($this -> LSprofiles); return true; } else { @@ -1112,9 +1117,6 @@ class LSsession { $access[$type] = $GLOBALS['LSobjects'][$type]['label']; } } - else { - $GLOBALS['LSerror'] -> addErrorCode(1004,$type); - } } } foreach($tbl as $dn => $dn_name) { @@ -1123,9 +1125,6 @@ class LSsession { } } } - else { - $GLOBALS['LSerror'] -> addErrorCode(1004,$objectType); - } } } } @@ -1139,9 +1138,6 @@ class LSsession { $access[$objectType] = $GLOBALS['LSobjects'][$objectType]['label']; } } - else { - $GLOBALS['LSerror'] -> addErrorCode(1004,$LSobject_name); - } } } $LSaccess[$config['dn']]=$access; @@ -1158,9 +1154,6 @@ class LSsession { $access[$objectType] = $GLOBALS['LSobjects'][$objectType]['label']; } } - else { - $GLOBALS['LSerror'] -> addErrorCode(1004,$LSobject_name); - } } $LSaccess[$this -> topDn] = $access; } @@ -1187,8 +1180,8 @@ class LSsession { * @retval boolean True si l'utilisateur est du profil sur l'objet, false sinon. */ function isProfile($dn,$profile) { - if (is_array($this -> LSrights[$profile])) { - foreach($this -> LSrights[$profile] as $topDn) { + if (is_array($this -> LSprofiles[$profile])) { + foreach($this -> LSprofiles[$profile] as $topDn) { if($dn == $topDn) { return true; } @@ -1210,7 +1203,7 @@ class LSsession { function whoami($dn) { $retval = array('user'); - foreach($this -> LSrights as $profile => $infos) { + foreach($this -> LSprofiles as $profile => $infos) { if($this -> isProfile($dn,$profile)) { $retval[]=$profile; } @@ -1235,7 +1228,6 @@ class LSsession { */ function canAccess($LSobject,$dn=NULL,$right=NULL,$attr=NULL) { if (!$this -> loadLSobject($LSobject)) { - $GLOBALS['LSerror'] -> addErrorCode(1004,$LSobject); return; } if ($dn) { @@ -1498,8 +1490,8 @@ class LSsession { * * @retval boolean True si le cache des droits est activé, false sinon. */ - function cacheLSrights() { - return ( ($GLOBALS['LSconfig']['cacheLSrights']) || ($this -> ldapServer['cacheLSrights']) ); + function cacheLSprofiles() { + return ( ($GLOBALS['LSconfig']['cacheLSprofiles']) || ($this -> ldapServer['cacheLSprofiles']) ); } /** @@ -1531,8 +1523,8 @@ class LSsession { * * @retval string Le label des niveaux pour le serveur ldap dourant */ - function getLevelLabel() { - return ($this -> ldapServer['levelLabel']!='')?$this -> ldapServer['levelLabel']:_('Niveau'); + function getSubDnLabel() { + return ($this -> ldapServer['subDnLabel']!='')?$this -> ldapServer['subDnLabel']:_('Niveau'); } /** @@ -1651,4 +1643,79 @@ class LSsession { } } +/* + * Error Codes + */ +$GLOBALS['LSerror_code']['LSsession_01'] = array ( + 'msg' => _("LSsession : The constant %{const} is not defined.") +); +$GLOBALS['LSerror_code']['LSsession_02'] = array ( + 'msg' => _("LSsession : The %{addon} support is uncertain. Verify system compatibility and the add-on configuration.") +); +$GLOBALS['LSerror_code']['LSsession_03'] = array ( + 'msg' => _("LSsession : LDAP server's configuration data are invalid. Impossible d'établir une connexion.") +); +$GLOBALS['LSerror_code']['LSsession_04'] = array ( + 'msg' => _("LSsession : Failed to load LSobject type %{type} : unknon type.") +); +// no longer used +/*$GLOBALS['LSerror_code'][1005] = array ( + 'msg' => _("LSsession : Object type use for authentication is unknow (%{type}).") +);*/ +$GLOBALS['LSerror_code']['LSsession_06'] = array ( + 'msg' => _("LSsession : Login or password incorrect.") +); +$GLOBALS['LSerror_code']['LSsession_07'] = array ( + 'msg' => _("LSsession : Impossible to identify you : Duplication of identities.") +); +$GLOBALS['LSerror_code']['LSsession_08'] = array ( + 'msg' => _("LSsession : Can't load Smarty template engine.") +); +$GLOBALS['LSerror_code']['LSsession_09'] = array ( + 'msg' => _("LSsession : Can't connect to LDAP server.") +); +$GLOBALS['LSerror_code']['LSsession_10'] = array ( + 'msg' => _("LSsession : Impossible to load authentification objects's class.") +); +$GLOBALS['LSerror_code']['LSsession_11'] = array ( + 'msg' => _("LSsession : Your are not authorized to do this action.") +); +$GLOBALS['LSerror_code']['LSsession_12'] = array ( + 'msg' => _("LSsession : Some informations are missing to display this page.") +); +// 13 -> 16 : not yet used +$GLOBALS['LSerror_code']['LSsession_17'] = array ( + 'msg' => _("LSsession : Error during creation of list of levels. Contact administrators. (Code : %{code})") +); +$GLOBALS['LSerror_code']['LSsession_18'] = array ( + 'msg' => _("LSsession : The password recovery is disabled for this LDAP server.") +); +$GLOBALS['LSerror_code']['LSsession_19'] = array ( + 'msg' => _("LSsession : Some informations are missing to recover your password. Contact administrators.") +); +$GLOBALS['LSerror_code']['LSsession_20'] = array ( + 'msg' => _("LSsession : Error during password recovery. Contact administrators.(Step : %{step})") +); +// 21 : not yet used +$GLOBALS['LSerror_code']['LSsession_22'] = array( + 'msg' => _("LSsession : problem during initialisation.") +); + + +// LSrelations +$GLOBALS['LSerror_code']['LSrelations_01'] = array ( + 'msg' => _("LSrelations : The listing function for the relation %{relation} is unknow.") +); +$GLOBALS['LSerror_code']['LSrelations_02'] = array ( + 'msg' => _("LSrelations : The update function of the relation %{relation} is unknow.") +); +$GLOBALS['LSerror_code']['LSrelations_03'] = array ( + 'msg' => _("LSrelations : Error during relation update of the relation %{relation}.") +); +$GLOBALS['LSerror_code']['LSrelations_04'] = array ( + 'msg' => _("LSrelations : Object type %{LSobject} unknow (Relation : %{relation}).") +); +$GLOBALS['LSerror_code']['LSrelations_05'] = array ( + 'msg' => _("LSrelation : Some parameters are missing in the invocation of the methods of handling relations standard (Methode : %{meth}).") +); ?> diff --git a/trunk/includes/functions.php b/trunk/includes/functions.php index bcc76230..12e32b21 100644 --- a/trunk/includes/functions.php +++ b/trunk/includes/functions.php @@ -89,7 +89,7 @@ function getFData($format,$data,$meth=NULL) { $format[$i]=ereg_replace($ch[0],$value,$format[$i]); } else { - $GLOBALS['LSerror'] -> addErrorCode(901,array('meth' => $meth,'obj' => $ch[1])); + $GLOBALS['LSerror'] -> addErrorCode('fct_getFData_01',array('meth' => $meth,'obj' => $ch[1])); break; } } @@ -136,7 +136,7 @@ function getFData($format,$data,$meth=NULL) { $format[$i]=ereg_replace($ch[0],$value,$format[$i]); } else { - $GLOBALS['LSerror'] -> addErrorCode(901,array('meth' => $meth,'obj' => get_class($data))); + $GLOBALS['LSerror'] -> addErrorCode('fct_getFData_01',array('meth' => $meth,'obj' => get_class($data))); break; } } @@ -148,6 +148,12 @@ function getFData($format,$data,$meth=NULL) { } return $format; } +/* + * Error Codes + */ +$GLOBALS['LSerror_code']['fct_getFData_01'] = array ( + 'msg' => _("Function 'getFData' : The method %{meth} of the object %{obj} doesn't exist.") +); function getFieldInFormat($format) { $fields=array(); @@ -183,6 +189,7 @@ function return_data($data) { return $data; } +$GLOBALS['LSdebug']['fields']=array(); function LSdebug($data,$dump=false) { if ($dump) { ob_start(); diff --git a/trunk/includes/js/LSsession_login.js b/trunk/includes/js/LSsession_login.js index cc1b8114..38cb7f3a 100644 --- a/trunk/includes/js/LSsession_login.js +++ b/trunk/includes/js/LSsession_login.js @@ -42,7 +42,7 @@ var LSsession_login = new Class({ if (data.list_topDn) { $('LSsession_topDn').getParent().set('html',data.list_topDn); LSdebug($('LSsession_topDn').innerHTML); - $('LSsession_topDn_label').set('html',data.levelLabel); + $('LSsession_topDn_label').set('html',data.subDnLabel); $$('.loginform-level').each(function(el) { el.setStyle('display','block'); }); diff --git a/trunk/index_ajax.php b/trunk/index_ajax.php index 1894ddc3..e3dd7c99 100644 --- a/trunk/index_ajax.php +++ b/trunk/index_ajax.php @@ -7,7 +7,7 @@ $GLOBALS['LSsession'] = new LSsession(); if (($_REQUEST['template'] != 'login')&&($_REQUEST['template'] != 'recoverPassword')) { if ( !$GLOBALS['LSsession'] -> startLSsession() ) { - $GLOBALS['LSerror'] -> addErrorCode(1022); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_22'); $_ERRORS = true; } } @@ -22,10 +22,16 @@ if (!isset($_ERRORS)) { $data = array(); if ( $GLOBALS['LSsession'] -> LSldapConnect() ) { session_start(); - $list = $GLOBALS['LSsession'] -> getSubDnLdapServerOptions($_SESSION['LSsession_topDn']); + if (isset($_SESSION['LSsession_topDn'])) { + $sel = $_SESSION['LSsession_topDn']; + } + else { + $sel = NULL; + } + $list = $GLOBALS['LSsession'] -> getSubDnLdapServerOptions($sel); if (is_string($list)) { $data['list_topDn'] = ""; - $data['levelLabel'] = $GLOBALS['LSsession'] -> getLevelLabel(); + $data['subDnLabel'] = $GLOBALS['LSsession'] -> getSubDnLabel(); } } $data['recoverPassword'] = isset($GLOBALS['LSsession'] -> ldapServer['recoverPassword']); @@ -60,9 +66,6 @@ if (!isset($_ERRORS)) { ); } } - else { - $GLOBALS['LSerror'] -> addErrorCode(1004,$_REQUEST['objecttype']); - } } break; case 'LSformElement_select_object_refresh': @@ -78,9 +81,6 @@ if (!isset($_ERRORS)) { ); } } - else { - $GLOBALS['LSerror'] -> addErrorCode(1004,$_REQUEST['objecttype']); - } } break; case 'LSformElement_select_object_searchAdd': @@ -91,9 +91,6 @@ if (!isset($_ERRORS)) { $field=$form -> getElement($_REQUEST['attribute']); $data['objects'] = $field -> searchAdd($_REQUEST['pattern']); } - else { - $GLOBALS['LSerror'] -> addErrorCode(1004,$_REQUEST['objecttype']); - } } break; case 'generatePassword': @@ -101,25 +98,20 @@ if (!isset($_ERRORS)) { if ($GLOBALS['LSsession'] -> loadLSobject($_REQUEST['objecttype'])) { $object = new $_REQUEST['objecttype'](); if ($object) { - if ($object -> loadData($_REQUEST['objectdn'])) { - $form = $object -> getForm($_REQUEST['idform']); - if ($form) { - $field=$form -> getElement($_REQUEST['attribute']); - if ($field) { - $val = $field -> generatePassword(); - if ( $val ) { - $data = array( - 'generatePassword' => $val - ); - } + $form = $object -> getForm($_REQUEST['idform']); + if ($form) { + $field=$form -> getElement($_REQUEST['attribute']); + if ($field) { + $val = $field -> generatePassword(); + if ( $val ) { + $data = array( + 'generatePassword' => $val + ); } } } } } - else { - $GLOBALS['LSerror'] -> addErrorCode(1004,$_REQUEST['objecttype']); - } } break; case 'verifyPassword': @@ -134,9 +126,6 @@ if (!isset($_ERRORS)) { 'verifyPassword' => $val ); } - else { - $GLOBALS['LSerror'] -> addErrorCode(1004,$_REQUEST['objecttype']); - } } break; } @@ -168,27 +157,24 @@ if (!isset($_ERRORS)) { ); } else { - $GLOBALS['LSerror'] -> addErrorCode(1013,$relationName); + $GLOBALS['LSerror'] -> addErrorCode('LSrelations_01',$relationName); } } else { - $GLOBALS['LSerror'] -> addErrorCode(1011); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_11'); } } - else { - $GLOBALS['LSerror'] -> addErrorCode(1004,$relationConf['LSobject']); - } } else { - $GLOBALS['LSerror'] -> addErrorCode(1012); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_12'); } } else { - $GLOBALS['LSerror'] -> addErrorCode(1012); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_12'); } } else { - $GLOBALS['LSerror'] -> addErrorCode(1012); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_12'); } } break; @@ -224,36 +210,33 @@ if (!isset($_ERRORS)) { $data['id'] = $_REQUEST['id']; } else { - $GLOBALS['LSerror'] -> addErrorCode(1013,$relationName); + $GLOBALS['LSerror'] -> addErrorCode('LSrelations_01',$relationName); } } else { - $GLOBALS['LSerror'] -> addErrorCode(1015,$relationName); + $GLOBALS['LSerror'] -> addErrorCode('LSrelations_03',$relationName); } } else { - $GLOBALS['LSerror'] -> addErrorCode(1014,$relationName); + $GLOBALS['LSerror'] -> addErrorCode('LSrelations_02',$relationName); } } } else { - $GLOBALS['LSerror'] -> addErrorCode(1011); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_11'); } } - else { - $GLOBALS['LSerror'] -> addErrorCode(1004,$relationConf['LSobject']); - } } else { - $GLOBALS['LSerror'] -> addErrorCode(1012); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_12'); } } else { - $GLOBALS['LSerror'] -> addErrorCode(1012); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_12'); } } else { - $GLOBALS['LSerror'] -> addErrorCode(1012); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_12'); } } break; @@ -275,7 +258,7 @@ if (!isset($_ERRORS)) { foreach($list as $o) { if($o -> getDn() == $_REQUEST['dn']) { if (!$o -> $relationConf['remove_function']($object)) { - $GLOBALS['LSerror'] -> addErrorCode(1015,$conf['relationName']); + $GLOBALS['LSerror'] -> addErrorCode('LSrelations_03',$conf['relationName']); } else { $ok = true; @@ -284,7 +267,7 @@ if (!isset($_ERRORS)) { } if (!$ok) { LSdebug($_REQUEST['value']." introuvé parmi la liste"); - $GLOBALS['LSerror'] -> addErrorCode(1015,$conf['relationName']); + $GLOBALS['LSerror'] -> addErrorCode('LSrelations_03',$conf['relationName']); } else { $data=array( @@ -293,32 +276,28 @@ if (!isset($_ERRORS)) { } } else { - $GLOBALS['LSerror'] -> addErrorCode(1015,$conf['relationName']); - $GLOBALS['LSerror'] -> addErrorCode(1); + $GLOBALS['LSerror'] -> addErrorCode('LSrelations_03',$conf['relationName']); } } else { - $GLOBALS['LSerror'] -> addErrorCode(1013,$conf['relationName']); + $GLOBALS['LSerror'] -> addErrorCode('LSrelations_01',$conf['relationName']); } } else { - $GLOBALS['LSerror'] -> addErrorCode(1011); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_11'); } } - else { - $GLOBALS['LSerror'] -> addErrorCode(1004,$relationConf['LSobject']); - } } else { - $GLOBALS['LSerror'] -> addErrorCode(1012); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_12'); } } else { - $GLOBALS['LSerror'] -> addErrorCode(1012); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_12'); } } else { - $GLOBALS['LSerror'] -> addErrorCode(1012); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_12'); } } break; @@ -368,7 +347,7 @@ if (!isset($_ERRORS)) { ); } else { - $GLOBALS['LSerror'] -> addErrorCode(1012); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_12'); } break; } @@ -383,9 +362,6 @@ if (!isset($_ERRORS)) { $msg = $obj -> getFData($_REQUEST['msg']); $subject = $obj -> getFData($_REQUEST['subject']); } - else { - $GLOBALS['LSerror'] -> addErrorCode(1004,$_REQUEST['object']['type']); - } } else { $msg = $_REQUEST['msg']; @@ -419,7 +395,7 @@ if (!isset($_ERRORS)) { } } else { - $GLOBALS['LSerror'] -> addErrorCode(1012); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_12'); } } break; diff --git a/trunk/modify.php b/trunk/modify.php index af8c488d..354299ee 100644 --- a/trunk/modify.php +++ b/trunk/modify.php @@ -114,19 +114,16 @@ if($LSsession -> startLSsession()) { } } else { - $GLOBALS['LSerror'] -> addErrorCode(1011); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_11'); } } else { - $GLOBALS['LSerror'] -> addErrorCode(1011); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_11'); } } - else { - $GLOBALS['LSerror'] -> addErrorCode(1004,$LSobject); - } } else { - $GLOBALS['LSerror'] -> addErrorCode(1012); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_12'); } } diff --git a/trunk/remove.php b/trunk/remove.php index 0e2f3b8b..128565f0 100644 --- a/trunk/remove.php +++ b/trunk/remove.php @@ -41,7 +41,7 @@ if($LSsession -> startLSsession()) { $GLOBALS['LSsession'] -> redirect('view.php?LSobject='.$_GET['LSobject'].'&refresh'); } else { - $GLOBALS['LSerror'] -> addErrorCode(35,$objectname); + $GLOBALS['LSerror'] -> addErrorCode('LSldapObject_15',$objectname); } } else { @@ -54,19 +54,19 @@ if($LSsession -> startLSsession()) { $GLOBALS['LSsession'] -> setTemplate('question.tpl'); } else { - $GLOBALS['LSerror'] -> addErrorCode(1012); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_12'); } } else { - $GLOBALS['LSerror'] -> addErrorCode(1011); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_11'); } } else { - $GLOBALS['LSerror'] -> addErrorCode(21); + $GLOBALS['LSerror'] -> addErrorCode('LSldapObject_01'); } } else { - $GLOBALS['LSerror'] -> addErrorCode(1012); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_12'); } } diff --git a/trunk/select.php b/trunk/select.php index 285d0cb2..9a6afeb9 100644 --- a/trunk/select.php +++ b/trunk/select.php @@ -323,12 +323,9 @@ if($LSsession -> startLSsession()) { } $GLOBALS['LSsession'] -> ajaxDisplay = true; } - else { - $GLOBALS['LSerror'] -> addErrorCode(1004,$LSobject); - } } else { - $GLOBALS['LSerror'] -> addErrorCode(1012); + $GLOBALS['LSerror'] -> addErrorCode('LSsession_12'); } } else { diff --git a/trunk/templates/default/bottom.tpl b/trunk/templates/default/bottom.tpl index f23e12ff..75e0a2bd 100644 --- a/trunk/templates/default/bottom.tpl +++ b/trunk/templates/default/bottom.tpl @@ -1,5 +1,5 @@ - -
- + + + diff --git a/trunk/templates/default/login.tpl b/trunk/templates/default/login.tpl index 6d793b8f..790c0b8d 100644 --- a/trunk/templates/default/login.tpl +++ b/trunk/templates/default/login.tpl @@ -4,6 +4,7 @@ LdapSaisie{if $pagetitle != ''} - {$pagetitle}{/if} + {$LSsession_css} {$LSsession_js} diff --git a/trunk/templates/default/top.tpl b/trunk/templates/default/top.tpl index c3d907b8..1c34679b 100644 --- a/trunk/templates/default/top.tpl +++ b/trunk/templates/default/top.tpl @@ -1,9 +1,11 @@ + LdapSaisie{if $pagetitle != ''} - {$pagetitle}{/if} + {$LSsession_css} @@ -22,30 +24,35 @@
{if $LSdebug != ''}{$LSdebug}{/if}
-
-
- - - {if $LSsession_subDn!=""} -
- -
- {/if} - -
-