Net_LDAP
[ class tree: Net_LDAP ] [ index: Net_LDAP ] [ all elements ]

Source for file RootDSE.php

Documentation is available at RootDSE.php

  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4: */
  3.  
  4. require_once 'PEAR.php';
  5.  
  6. /**
  7. * Getting the rootDSE entry of a LDAP server
  8. *
  9. @category Net
  10. @package  Net_LDAP
  11. @author   Jan Wagner <wagner@netsols.de>
  12. @license  http://www.gnu.org/copyleft/lesser.html LGPL
  13. @version  CVS $Id: RootDSE.php,v 1.11 2007/10/24 05:59:25 beni Exp $
  14. @link     http://pear.php.net/package/Net_LDAP/
  15. */
  16. class Net_LDAP_RootDSE extends PEAR
  17. {
  18.     /**
  19.     * @access private
  20.     * @var object Net_LDAP_Entry 
  21.     ***/
  22.     var $_entry;
  23.  
  24.     /**
  25.     * Class constructor
  26.     *
  27.     * @param Net_LDAP_Entry &$entry Net_LDAP_Entry object
  28.     */
  29.     function Net_LDAP_RootDSE(&$entry)
  30.     {
  31.         $this->_entry $entry;
  32.     }
  33.  
  34.     /**
  35.     * Gets the requested attribute value
  36.     *
  37.     * Same usuage as {@link Net_LDAP_Entry::getValue()}
  38.     *
  39.     * @param string $attr    Attribute name
  40.     * @param array  $options Array of options
  41.     *
  42.     * @access public
  43.     * @return mixed Net_LDAP_Error object or attribute values
  44.     * @see Net_LDAP_Entry::get_value()
  45.     */
  46.     function getValue($attr ''$options '')
  47.     {
  48.         return $this->_entry->get_value($attr$options);
  49.     }
  50.  
  51.     /**
  52.     * Alias function of getValue() for perl-ldap interface
  53.     *
  54.     * @see getValue()
  55.     */
  56.     function get_value()
  57.     {
  58.         $args func_get_args();
  59.         return call_user_func_array(array&$this'getValue' )$args);
  60.     }
  61.  
  62.     /**
  63.     * Determines if the extension is supported
  64.     *
  65.     * @param array $oids Array of oids to check
  66.     *
  67.     * @access public
  68.     * @return boolean 
  69.     */
  70.     function supportedExtension($oids)
  71.     {
  72.         return $this->_checkAttr($oids'supportedExtension');
  73.     }
  74.  
  75.     /**
  76.     * Alias function of supportedExtension() for perl-ldap interface
  77.     *
  78.     * @see supportedExtension()
  79.     */
  80.     function supported_extension()
  81.     {
  82.         $args func_get_args();
  83.         return call_user_func_array(array&$this'supportedExtension')$args);
  84.     }
  85.  
  86.     /**
  87.     * Determines if the version is supported
  88.     *
  89.     * @param array $versions Versions to check
  90.     *
  91.     * @access public
  92.     * @return boolean 
  93.     */
  94.     function supportedVersion($versions)
  95.     {
  96.         return $this->_checkAttr($versions'supportedLDAPVersion');
  97.     }
  98.  
  99.     /**
  100.     * Alias function of supportedVersion() for perl-ldap interface
  101.     *
  102.     * @see supportedVersion()
  103.     */
  104.     function supported_version()
  105.     {
  106.         $args func_get_args();
  107.         return call_user_func_array(array(&$this'supportedVersion')$args);
  108.     }
  109.  
  110.     /**
  111.     * Determines if the control is supported
  112.     *
  113.     * @param array $oids Control oids to check
  114.     *
  115.     * @access public
  116.     * @return boolean 
  117.     */
  118.     function supportedControl($oids)
  119.     {
  120.         return $this->_checkAttr($oids'supportedControl');
  121.     }
  122.  
  123.     /**
  124.     * Alias function of supportedControl() for perl-ldap interface
  125.     *
  126.     * @see supportedControl()
  127.     */
  128.     function supported_control()
  129.     {
  130.         $args func_get_args();
  131.         return call_user_func_array(array(&$this'supportedControl' )$args);
  132.     }
  133.  
  134.     /**
  135.     * Determines if the sasl mechanism is supported
  136.     *
  137.     * @param array $mechlist SASL mechanisms to check
  138.     *
  139.     * @access public
  140.     * @return boolean 
  141.     */
  142.     function supportedSASLMechanism($mechlist)
  143.     {
  144.         return $this->_checkAttr($mechlist'supportedSASLMechanisms');
  145.     }
  146.  
  147.     /**
  148.     * Alias function of supportedSASLMechanism() for perl-ldap interface
  149.     *
  150.     * @see supportedSASLMechanism()
  151.     */
  152.     function supported_sasl_mechanism(
  153.     {
  154.         $args func_get_args();
  155.         return call_user_func_array(array(&$this'supportedSASLMechanism')$args);
  156.     }
  157.  
  158.     /**
  159.     * Checks for existance of value in attribute
  160.     *
  161.     * @param array  $values values to check
  162.     * @param string $attr   attribute name
  163.     *
  164.     * @access private
  165.     * @return boolean 
  166.     */
  167.     function _checkAttr($values$attr)
  168.     {
  169.         if (!is_array($values)) $values = array($values);
  170.  
  171.         foreach ($values as $value{
  172.             if (!@in_array($value$this->get_value($attr'all'))) {
  173.                 return false;
  174.             }
  175.         }
  176.         return true;
  177.     }
  178. }
  179.  
  180. ?>

Documentation generated on Mon, 11 Mar 2019 15:22:33 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.