## 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. */
28. /**
29. * Structure for defining the LDAP directory to authenticate against.
30. *
31. * @package Authentication
32. * @version //autogen//
33. */
34. class ezcAuthenticationLdapInfo extends ezcBaseStruct
35. {
36. /**
37. * The hostname of the LDAP server, for example 'localhost'.
38. *
39. * @var string
40. */
41. public $host ;
43. /**
44. * The format of the directory entry, for example 'uid=%id'. %id% is a
45. * placeholder name which will be replaced by the actual value.
46. *
47. * @var string
48. */
49. public $format ;
51. /**
52. * The base of the directory entry, for example 'dc=example,dc=com'.
53. *
54. * @var string
55. */
56. public $base ;
58. /**
59. * Port to connect to $host.
60. *
61. * Default is 389 for plain connection.
62. * The port is 636 if using SSL (not implemented yet).
63. *
64. * The port is not usable if $host is specified as an uri, for example
65. * 'ldap://localhost'.
66. *
67. * @var int
68. */
69. public $port ;
71. /**
72. * Protocol to use to connect to LDAP.
73. *
74. * One of these values:
75. * - ezcAuthenticationLdapFilter::PROTOCOL_PLAIN (default)
76. * - ezcAuthenticationLdapFilter::PROTOCOL_TLS
77. *
78. * @var int
79. * @apichange Remove this as it is used already as an option
80. */
81. public $protocol ;
83. /**
84. * Constructs a new ezcAuthenticationLdapInfo object.
85. *
86. * @param string $host Hostname of the LDAP server
87. * @param string $format Format of an entry, for example 'uid=%id%'
88. * @param string $base Base of an entry, for example 'dc=example,dc=com'
89. * @param int $port The port to connect to $host
90. * @param int $protocol The protocol to use to connect to $host
91. */
92. public function __construct ( $host, $format, $base, $port = 389, $protocol = ezcAuthenticationLdapFilter::PROTOCOL_PLAIN )
93. {
94. $this-> host = $host;
95. $this-> format = $format;
96. $this-> base = $base;
97. $this-> port = $port;
98. $this-> protocol = $protocol;
99. }
101. /**
102. * Returns a new instance of this class with the data specified by $array.
103. *
104. * $array contains all the data members of this class in the form:
105. * array('member_name'=>value).
106. *
107. * __set_state makes this class exportable with var_export.
108. * var_export() generates code, that calls this method when it
109. * is parsed with PHP.
110. *
111. * @param array(string=>mixed) $array Associative array of data members for this class
112. * @return ezcAuthenticationLdapInfo
113. */
114. static public function __set_state ( array $array )
115. {
116. return new ezcAuthenticationLdapInfo( $array['host'], $array['format'], $array['base'], $array['port'], $array['protocol'] );
117. }
118. }
119. ?>

Documentation generated by phpDocumentor 1.4.3