@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | # Create AD password (Microsoft Active Directory password format) |
| 144 | 144 | protected static function encodePassword($password) { |
| 145 | - $password = "\"" . $password . "\""; |
|
| 145 | + $password = "\"".$password."\""; |
|
| 146 | 146 | $adpassword = mb_convert_encoding($password, "UTF-16LE", "UTF-8"); |
| 147 | 147 | return $adpassword; |
| 148 | 148 | } |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | */ |
| 192 | 192 | public function open($anonymous = false) |
| 193 | 193 | { |
| 194 | - $token = 'Opening LDAP connection: ' . LdapUtils::recursive_implode($this->dc, ' or '); |
|
| 194 | + $token = 'Opening LDAP connection: '.LdapUtils::recursive_implode($this->dc, ' or '); |
|
| 195 | 195 | Yii::info($token, __METHOD__); |
| 196 | 196 | Yii::beginProfile($token, __METHOD__); |
| 197 | 197 | // Connect to the LDAP server. |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | # Search for user and get user DN |
| 251 | 251 | $searchResult = ldap_search($this->resource, $this->baseDn, "(&(objectClass=person)($this->loginAttribute=$username))", [$this->loginAttribute]); |
| 252 | 252 | $entry = $this->getFirstEntry($searchResult); |
| 253 | - if($entry) { |
|
| 253 | + if ($entry) { |
|
| 254 | 254 | $this->userDN = $this->getDn($entry); |
| 255 | 255 | } else { |
| 256 | 256 | $this->userDN = null; |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | // Open connection with user |
| 282 | - if(!$this->auth($username, $oldPassword)){ |
|
| 282 | + if (!$this->auth($username, $oldPassword)) { |
|
| 283 | 283 | return false; |
| 284 | 284 | } |
| 285 | 285 | |
@@ -336,20 +336,20 @@ discard block |
||
| 336 | 336 | $this->open(); |
| 337 | 337 | $results = []; |
| 338 | 338 | $cookie = ''; |
| 339 | - $token = $function . ' - params: ' . LdapUtils::recursive_implode($params, ';'); |
|
| 339 | + $token = $function.' - params: '.LdapUtils::recursive_implode($params, ';'); |
|
| 340 | 340 | |
| 341 | - Yii::info($token , 'chrmorandi\ldap\Connection::query'); |
|
| 341 | + Yii::info($token, 'chrmorandi\ldap\Connection::query'); |
|
| 342 | 342 | |
| 343 | 343 | Yii::beginProfile($token, 'chrmorandi\ldap\Connection::query'); |
| 344 | 344 | do { |
| 345 | - if($this->pageSize > 0 && true === $this->enablePaginationControl) { |
|
| 345 | + if ($this->pageSize > 0 && true === $this->enablePaginationControl) { |
|
| 346 | 346 | $this->setControlPagedResult($cookie); |
| 347 | 347 | } |
| 348 | 348 | |
| 349 | 349 | // Run the search. |
| 350 | 350 | $result = call_user_func($function, $this->resource, ...$params); |
| 351 | 351 | |
| 352 | - if($this->pageSize > 0 && true === $this->enablePaginationControl) { |
|
| 352 | + if ($this->pageSize > 0 && true === $this->enablePaginationControl) { |
|
| 353 | 353 | $this->setControlPagedResultResponse($result, $cookie); |
| 354 | 354 | } |
| 355 | 355 | |