## 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. */
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. class ezcAuthenticationHtpasswdOptions extends ezcAuthenticationFilterOptions
54. {
55. /**
56. * Constructs an object with the specified values.
57. *
58. * @throws ezcBasePropertyNotFoundException
59. * if $options contains a property not defined
60. * @throws ezcBaseValueException
61. * if $options contains a property with a value not allowed
62. * @param array(string=>mixed) $options Options for this class
63. */
64. public function __construct ( array $options = array() )
65. {
66. $this->plain = false;
68. parent:: __construct ( $options );
69. }
71. /**
72. * Sets the option $name to $value.
73. *
74. * @throws ezcBasePropertyNotFoundException
75. * if the property $name is not defined
76. * @throws ezcBaseValueException
77. * if $value is not correct for the property $name
78. * @param string $name The name of the property to set
79. * @param mixed $value The new value of the property
80. * @ignore
81. */
82. public function __set( $name, $value )
83. {
84. switch ( $name )
85. {
86. case 'plain':
87. if ( ! is_bool ( $value ) )
88. {
89. throw new ezcBaseValueException ( $name, $value, 'bool' );
90. }
91. $this-> properties [$name] = $value;
92. break;
94. default:
95. parent::__set( $name, $value );
96. }
97. }
98. }
99. ?>

Documentation generated by phpDocumentor 1.4.3