1 | <?php |
||
31 | class Ldap |
||
32 | { |
||
33 | /** |
||
34 | * connection at ldap server |
||
35 | * |
||
36 | * @access private |
||
37 | * @var resource |
||
38 | */ |
||
39 | private $_rConnect; |
||
40 | |||
41 | /** |
||
42 | * the databse to connect |
||
43 | * |
||
44 | * @access private |
||
45 | * @var string |
||
46 | */ |
||
47 | private $_sBase; |
||
48 | |||
49 | /** |
||
50 | * if the user is connected or not |
||
51 | * |
||
52 | * @access private |
||
53 | * @var bool |
||
54 | */ |
||
55 | private $_bConnected = false; |
||
56 | |||
57 | /** |
||
58 | * constructor of class |
||
59 | * |
||
60 | * @access public |
||
61 | * @return \Venus\lib\Ldap |
||
|
|||
62 | */ |
||
63 | public function __construct() |
||
73 | |||
74 | /** |
||
75 | * Get groups |
||
76 | * |
||
77 | * @access public |
||
78 | * @return array |
||
79 | */ |
||
80 | public function getGroups() : array |
||
93 | |||
94 | /** |
||
95 | * Authentification in Ldap |
||
96 | * |
||
97 | * @access public |
||
98 | * @param string $sUser |
||
99 | * @param string $sPassword |
||
100 | * @return \Venus\lib\Ldap |
||
101 | */ |
||
102 | public function bind($sUser, $sPassword) : Ldap |
||
107 | |||
108 | /** |
||
109 | * Close authentification in Ldap |
||
110 | * |
||
111 | * @access public |
||
112 | * @return bool |
||
113 | */ |
||
114 | public function unbind() : bool |
||
119 | |||
120 | /** |
||
121 | * destructor of the class |
||
122 | * |
||
123 | * @access public |
||
124 | * @return void |
||
125 | */ |
||
126 | public function __destruct() |
||
130 | |||
131 | /** |
||
132 | * Call a classic ldap method. You have to ignore the ldap_ part |
||
133 | * You put all parameters without the connector |
||
134 | * |
||
135 | * @access public |
||
136 | * @param string $sFunctionName |
||
137 | * @param array $aArgv |
||
138 | * @return void |
||
139 | */ |
||
140 | public function __call(string $sFunctionName, array $aArgv) |
||
145 | |||
146 | /** |
||
147 | * get in Ldap |
||
148 | * |
||
149 | * @access public |
||
150 | * @param string $sFilter |
||
151 | * @param array $aAttributes |
||
152 | * @return array |
||
153 | */ |
||
154 | public function get(string $sFilter, array $aAttributes) |
||
160 | |||
161 | /** |
||
162 | * search in Ldap |
||
163 | * |
||
164 | * @access public |
||
165 | * @param string $sFilter |
||
166 | * @param array $aAttributes |
||
167 | * @return resource |
||
168 | */ |
||
169 | public function search(string $sFilter, array $aAttributes) |
||
173 | |||
174 | /** |
||
175 | * get in Ldap |
||
176 | * |
||
177 | * @access public |
||
178 | * @param resource $rResultIdentifier |
||
179 | * @param array $aAttributes |
||
180 | * @return array |
||
181 | */ |
||
182 | public function getEntries($rResultIdentifier, array $aAttributes) : array |
||
202 | } |
||
203 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.