Apache Zeta Components Manual :: File Source for ldap_info.php

Source for file ldap_info.php

Documentation is available at ldap_info.php

  1. <?php
  2. /**
  3.  * File containing the ezcAuthenticationLdapInfo structure.
  4.  *
  5.  * Licensed to the Apache Software Foundation (ASF) under one
  6.  * or more contributor license agreements.  See the NOTICE file
  7.  * distributed with this work for additional information
  8.  * regarding copyright ownership.  The ASF licenses this file
  9.  * to you under the Apache License, Version 2.0 (the
  10.  * "License"); you may not use this file except in compliance
  11.  * with the License.  You may obtain a copy of the License at
  12.  * 
  13.  *   http://www.apache.org/licenses/LICENSE-2.0
  14.  * 
  15.  * Unless required by applicable law or agreed to in writing,
  16.  * software distributed under the License is distributed on an
  17.  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  18.  * KIND, either express or implied.  See the License for the
  19.  * specific language governing permissions and limitations
  20.  * under the License.
  21.  *
  22.  * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
  23.  * @filesource
  24.  * @package Authentication
  25.  * @version //autogen//
  26.  */
  27.  
  28. /**
  29.  * Structure for defining the LDAP directory to authenticate against.
  30.  *
  31.  * @package Authentication
  32.  * @version //autogen//
  33.  */
  34. {
  35.     /**
  36.      * The hostname of the LDAP server, for example 'localhost'.
  37.      *
  38.      * @var string 
  39.      */
  40.     public $host;
  41.  
  42.     /**
  43.      * The format of the directory entry, for example 'uid=%id'. %id% is a
  44.      * placeholder name which will be replaced by the actual value.
  45.      *
  46.      * @var string 
  47.      */
  48.     public $format;
  49.  
  50.     /**
  51.      * The base of the directory entry, for example 'dc=example,dc=com'.
  52.      *
  53.      * @var string 
  54.      */
  55.     public $base;
  56.  
  57.     /**
  58.      * Port to connect to $host.
  59.      *
  60.      * Default is 389 for plain connection.
  61.      * The port is 636 if using SSL (not implemented yet).
  62.      *
  63.      * The port is not usable if $host is specified as an uri, for example
  64.      * 'ldap://localhost'.
  65.      *
  66.      * @var int 
  67.      */
  68.     public $port;
  69.  
  70.     /**
  71.      * Protocol to use to connect to LDAP.
  72.      *
  73.      * One of these values:
  74.      *  - ezcAuthenticationLdapFilter::PROTOCOL_PLAIN (default)
  75.      *  - ezcAuthenticationLdapFilter::PROTOCOL_TLS
  76.      *
  77.      * @var int 
  78.      * @apichange Remove this as it is used already as an option
  79.      */
  80.     public $protocol;
  81.  
  82.     /**
  83.      * Constructs a new ezcAuthenticationLdapInfo object.
  84.      *
  85.      * @param string $host Hostname of the LDAP server
  86.      * @param string $format Format of an entry, for example 'uid=%id%'
  87.      * @param string $base Base of an entry, for example 'dc=example,dc=com'
  88.      * @param int $port The port to connect to $host
  89.      * @param int $protocol The protocol to use to connect to $host
  90.      */
  91.     public function __construct$host$format$base$port 389$protocol ezcAuthenticationLdapFilter::PROTOCOL_PLAIN )
  92.     {
  93.         $this->host = $host;
  94.         $this->format = $format;
  95.         $this->base = $base;
  96.         $this->port = $port;
  97.         $this->protocol = $protocol;
  98.     }
  99.  
  100.     /**
  101.      * Returns a new instance of this class with the data specified by $array.
  102.      *
  103.      * $array contains all the data members of this class in the form:
  104.      * array('member_name'=>value).
  105.      *
  106.      * __set_state makes this class exportable with var_export.
  107.      * var_export() generates code, that calls this method when it
  108.      * is parsed with PHP.
  109.      *
  110.      * @param array(string=>mixed) $array Associative array of data members for this class
  111.      * @return ezcAuthenticationLdapInfo 
  112.      */
  113.     static public function __set_statearray $array )
  114.     {
  115.         return new ezcAuthenticationLdapInfo$array['host']$array['format']$array['base']$array['port']$array['protocol');
  116.     }
  117. }
  118. ?>
Documentation generated by phpDocumentor 1.4.3