From e9d3b321d8c634803a05d69a396cfc0bdc8a8e92 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Fri, 5 Dec 2008 14:38:42 +0000 Subject: [PATCH] =?UTF-8?q?-=20LSsession=20:=20=09->=20Correction=20du=20c?= =?UTF-8?q?hargement=20de=20Net=5FLDAP2=20=09->=20Ajout=20de=20la=20possib?= =?UTF-8?q?ilit=C3=A9=20d'avoir=20autre=20chose=20que=20le=20dn=20en=20val?= =?UTF-8?q?eur=20clef=20=09=09=20dans=20la=20m=C3=A9thode=20loadLSrights()?= =?UTF-8?q?=20(type=20groupe)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trunk/includes/class/class.LSsession.php | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/trunk/includes/class/class.LSsession.php b/trunk/includes/class/class.LSsession.php index 3dd4ae03..575e30fe 100644 --- a/trunk/includes/class/class.LSsession.php +++ b/trunk/includes/class/class.LSsession.php @@ -555,15 +555,17 @@ class LSsession { */ function LSldapConnect() { if ($this -> ldapServer) { - include_once($GLOBALS['LSconfig']['NetLDAP2']); - if (!$this -> loadLSclass('LSldap')) + @include_once($GLOBALS['LSconfig']['NetLDAP2']); + if (!$this -> loadLSclass('LSldap')) { return; - $GLOBALS['LSldap'] = new LSldap($this -> ldapServer['ldap_config']); - if ($GLOBALS['LSldap'] -> isConnected()) - return true; - else - return; - return $GLOBALS['LSldap'] = new LSldap($this -> ldapServer['ldap_config']); + } + $GLOBALS['LSldap'] = @new LSldap($this -> ldapServer['ldap_config']); + if ($GLOBALS['LSldap'] -> isConnected()) { + return true; + } + else { + return; + } } else { $GLOBALS['LSerror'] -> addErrorCode(1003); @@ -1039,8 +1041,10 @@ class LSsession { if ($object = new $conf['LSobject']()) { if ($object -> loadData($dn)) { $listDns=$object -> getValue($conf['attr']); + $valKey = (isset($conf['attr_value']))?$conf['attr_value']:'dn'; + $val = $this -> LSuserObject -> getFData($valKey); if (is_array($listDns)) { - if (in_array($this -> dn,$listDns)) { + if (in_array($val,$listDns)) { $this -> LSrights[$profile][] = $topDn; } }