| @@ 155-165 (lines=11) @@ | ||
| 152 | * |
|
| 153 | * @throws LdaphException |
|
| 154 | */ |
|
| 155 | final public function base($dcs) { |
|
| 156 | ||
| 157 | if ( empty($dcs) ) throw new LdaphException($dcs, 1410); |
|
| 158 | ||
| 159 | $pDc = preg_replace('/\s*,\s*/', ',', $dcs); |
|
| 160 | ||
| 161 | $this->dc = $pDc; |
|
| 162 | ||
| 163 | return $this; |
|
| 164 | ||
| 165 | } |
|
| 166 | ||
| 167 | /** |
|
| 168 | * Set ldap distinguished name (used in ldap bind) |
|
| @@ 290-299 (lines=10) @@ | ||
| 287 | * |
|
| 288 | * @throws LdaphException |
|
| 289 | */ |
|
| 290 | final public function account($user, $pass) { |
|
| 291 | ||
| 292 | if ( empty($user) OR empty($pass) ) throw new LdaphException("Invalid LDAP user/pass", 1402); |
|
| 293 | ||
| 294 | $this->user = $user; |
|
| 295 | $this->pass = $pass; |
|
| 296 | ||
| 297 | return $this; |
|
| 298 | ||
| 299 | } |
|
| 300 | ||
| 301 | /** |
|
| 302 | * Set ldap search base |
|