- LSsession :

-> Correction du chargement de Net_LDAP2
	-> Ajout de la possibilité d'avoir autre chose que le dn en valeur clef 
		 dans la méthode loadLSrights() (type groupe)
This commit is contained in:
Benjamin Renard 2008-12-05 14:38:42 +00:00
parent 15f678b67b
commit e9d3b321d8

View file

@ -555,15 +555,17 @@ class LSsession {
*/ */
function LSldapConnect() { function LSldapConnect() {
if ($this -> ldapServer) { if ($this -> ldapServer) {
include_once($GLOBALS['LSconfig']['NetLDAP2']); @include_once($GLOBALS['LSconfig']['NetLDAP2']);
if (!$this -> loadLSclass('LSldap')) if (!$this -> loadLSclass('LSldap')) {
return; return;
$GLOBALS['LSldap'] = new LSldap($this -> ldapServer['ldap_config']); }
if ($GLOBALS['LSldap'] -> isConnected()) $GLOBALS['LSldap'] = @new LSldap($this -> ldapServer['ldap_config']);
return true; if ($GLOBALS['LSldap'] -> isConnected()) {
else return true;
return; }
return $GLOBALS['LSldap'] = new LSldap($this -> ldapServer['ldap_config']); else {
return;
}
} }
else { else {
$GLOBALS['LSerror'] -> addErrorCode(1003); $GLOBALS['LSerror'] -> addErrorCode(1003);
@ -1039,8 +1041,10 @@ class LSsession {
if ($object = new $conf['LSobject']()) { if ($object = new $conf['LSobject']()) {
if ($object -> loadData($dn)) { if ($object -> loadData($dn)) {
$listDns=$object -> getValue($conf['attr']); $listDns=$object -> getValue($conf['attr']);
$valKey = (isset($conf['attr_value']))?$conf['attr_value']:'dn';
$val = $this -> LSuserObject -> getFData($valKey);
if (is_array($listDns)) { if (is_array($listDns)) {
if (in_array($this -> dn,$listDns)) { if (in_array($val,$listDns)) {
$this -> LSrights[$profile][] = $topDn; $this -> LSrights[$profile][] = $topDn;
} }
} }