Source for file Util.php
Documentation is available at Util.php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +--------------------------------------------------------------------------+
// +--------------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +--------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | Lesser General Public License for more details. |
// | You should have received a copy of the GNU Lesser General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +--------------------------------------------------------------------------+
// | Authors: Jan Wagner |
// +--------------------------------------------------------------------------+
// $Id: Util.php,v 1.4.2.1 2004/03/08 11:42:45 jw Exp $
* Utility Class for Net_LDAP
* @author Jan Wagner <wagner@netsols.de>
* @version $Revision: 1.4.2.1 $
* Reference to LDAP object
* @var object Net_LDAP_Schema
* Takes an LDAP object by reference and saves it. Then the schema will be fetched.
$this->_schema = $this->_ldap->schema();
* Encodes given attributes to UTF8 if needed
* This function takes attributes in an array and then checks against the schema if they need
* UTF8 encoding. If that is so, they will be encoded. An encoded array will be returned and
* can be used for adding or modifying.
* @param array Array of attributes
* @return array Array of UTF8 encoded attributes
return $this->_utf8 ($attributes, 'utf8_encode');
* Decodes the given attribute values
* @param array Array of attributes
* @return array Array with decoded attribute values
return $this->_utf8 ($attributes, 'utf8_decode');
* Encodes or decodes attribute values if needed
* @param array Array of attributes
* @param array Function to apply to attribute values
* @return array Array of attributes with function applied to values
function _utf8 ($attributes, $function)
foreach( $attributes as $k => $v ) {
$attr = $this->_schema->get('attribute', $k);
if (false !== strpos($attr['syntax'], '1.3.6.1.4.1.1466.115.121.1.15')) {
foreach ($v as $ak => $av ) {
Documentation generated on Mon, 11 Mar 2019 14:26:18 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|