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

Source for file htpasswd_options.php

Documentation is available at htpasswd_options.php

  1. <?php
  2. /**
  3.  * File containing the ezcAuthenticationHtpasswdOptions class.
  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.  * Class containing the options for the htpasswd authentication filter.
  30.  *
  31.  * Example of use:
  32.  * <code>
  33.  * // create an options object
  34.  * $options = new ezcAuthenticationHtpasswdOptions();
  35.  * $options->plain = true;
  36.  *
  37.  * // use the options object when creating a new htpasswd filter
  38.  * $filter = new ezcAuthenticationHtpasswdFilter( '/etc/htpasswd', $options );
  39.  *
  40.  * // alternatively, you can set the options to an existing filter
  41.  * $filter = new ezcAuthenticationHtpasswdFilter( '/etc/htpasswd' );
  42.  * $filter->setOptions( $options );
  43.  * </code>
  44.  *
  45.  * @property bool $plain 
  46.  *            Specifies if the password is passed to the filter in plain
  47.  *            text or encrypted. The encryption will be autodetected by the
  48.  *            filter from the password stored in the htpasswd file.
  49.  *
  50.  * @package Authentication
  51.  * @version //autogen//
  52.  */
  53. {
  54.     /**
  55.      * Constructs an object with the specified values.
  56.      *
  57.      * @throws ezcBasePropertyNotFoundException
  58.      *          if $options contains a property not defined
  59.      * @throws ezcBaseValueException
  60.      *          if $options contains a property with a value not allowed
  61.      * @param array(string=>mixed) $options Options for this class
  62.      */
  63.     public function __constructarray $options array() )
  64.     {
  65.         $this->plain false;
  66.  
  67.         parent::__construct$options );
  68.     }
  69.  
  70.     /**
  71.      * Sets the option $name to $value.
  72.      *
  73.      * @throws ezcBasePropertyNotFoundException
  74.      *          if the property $name is not defined
  75.      * @throws ezcBaseValueException
  76.      *          if $value is not correct for the property $name
  77.      * @param string $name The name of the property to set
  78.      * @param mixed $value The new value of the property
  79.      * @ignore
  80.      */
  81.     public function __set$name$value )
  82.     {
  83.         switch $name )
  84.         {
  85.             case 'plain':
  86.                 if !is_bool$value ) )
  87.                 {
  88.                     throw new ezcBaseValueException$name$value'bool' );
  89.                 }
  90.                 $this->properties[$name$value;
  91.                 break;
  92.  
  93.             default:
  94.                 parent::__set$name$value );
  95.         }
  96.     }
  97. }
  98. ?>
Documentation generated by phpDocumentor 1.4.3