cvs: pear /Auth/Container LDAP.php

From: Date: Fri, 28 Oct 2005 22:43:58 +0000
Subject: cvs: pear /Auth/Container LDAP.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-35942@lists.php.net to get a copy of this message
moosh Fri Oct 28 18:43:58 2005 EDT Modified files: /pear/Auth/Container LDAP.php Log: - constant can be defined when script fongi usage of auth. So constange became string - refine the code to hove only one time each attribute http://cvs.php.net/diff.php/pear/Auth/Container/LDAP.php?r1=1.18&r2=1.19&ty=u Index: pear/Auth/Container/LDAP.php diff -u pear/Auth/Container/LDAP.php:1.18 pear/Auth/Container/LDAP.php:1.19 --- pear/Auth/Container/LDAP.php:1.18 Fri Oct 28 12:36:54 2005 +++ pear/Auth/Container/LDAP.php Fri Oct 28 18:43:51 2005 @@ -16,7 +16,7 @@ // | Authors: Jan Wagner <wagner@netsols.de> | // +----------------------------------------------------------------------+ // -// $Id: LDAP.php,v 1.18 2005/10/28 16:36:54 moosh Exp $ +// $Id: LDAP.php,v 1.19 2005/10/28 22:43:51 moosh Exp $ // require_once "Auth/Container.php"; @@ -157,11 +157,9 @@ * * @author Jan Wagner <wagner@netsols.de> * @package Auth - * @version $Revision: 1.18 $ + * @version $Revision: 1.19 $ */ -define('AUTH_LDAP_ATTR_LDAP_STYLE', __LINE__); -define('AUTH_LDAP_ATTR_AUTH_STYLE', __LINE__); class Auth_Container_LDAP extends Auth_Container { /** @@ -326,8 +324,8 @@ $this->options['userattr'] = "uid"; $this->options['userfilter'] = '(objectClass=posixAccount)'; $this->options['attributes'] = array(''); // no attributes - $this->options['attributesformat'] = AUTH_LDAP_ATTR_LDAP_STYLE; // return attribute array as LDAP Return it - //$this->options['attributesformat'] = AUTH_LDAP_ATTR_AUTH_STYLE; // return atribute array like othe auth drivers + $this->options['attributesformat'] = 'AUTH_LDAP_ATTR_LDAP_STYLE'; // return attribute array as LDAP Return it + //$this->options['attributesformat'] = 'AUTH_LDAP_ATTR_AUTH_STYLE'; // return atribute array like othe auth drivers $this->options['group'] = ''; $this->options['groupdn'] = ''; $this->options['groupscope'] = 'sub'; @@ -442,17 +440,17 @@ // $this->options['attributesformat'] = AUTH_LDAP_ATTR_AUTH_STYLE // change the return format. each attribute are directly added to authData List - if ($this->options['attributesformat'] == AUTH_LDAP_ATTR_AUTH_STYLE) { + if ($this->options['attributesformat'] == 'AUTH_LDAP_ATTR_AUTH_STYLE') { $this->_debug('Saving attributes to Auth data in AUTH style', __LINE__); unset ($attributes['count']); foreach ($attributes as $attributeName => $attributeValue ) { + if (is_int($attributeName)) continue; if (is_array($attributeValue) && isset($attributeValue['count'])) { unset ($attributeValue['count']); } + if (count($attributeValue)<=1) $attributeValue = $attributeValue[0]; $this->_auth_obj->setAuthData($attributeName, $attributeValue); } - $this->_auth_obj->setAuthData('attributes', $attributes); - } else {

« previous php.pear.cvs (#35942) next »