@@ -21,14 +21,12 @@ discard block |
||
| 21 | 21 | throw new \Exception('No such LDAP User!'); |
| 22 | 22 | } |
| 23 | 23 | $this->ldapObj = $users[0]; |
| 24 | - } |
|
| 25 | - else |
|
| 24 | + } else |
|
| 26 | 25 | { |
| 27 | 26 | if(isset($data['extended'])) |
| 28 | 27 | { |
| 29 | 28 | $this->ldapObj = $data['extended']; |
| 30 | - } |
|
| 31 | - else |
|
| 29 | + } else |
|
| 32 | 30 | { |
| 33 | 31 | $this->ldapObj = $data; |
| 34 | 32 | } |
@@ -44,7 +42,9 @@ discard block |
||
| 44 | 42 | { |
| 45 | 43 | $dn = explode(',', $array[$i]); |
| 46 | 44 | $res = $this->isInGroupNamed(substr($dn[0], 3)); |
| 47 | - if($res) return $res; |
|
| 45 | + if($res) { |
|
| 46 | + return $res; |
|
| 47 | + } |
|
| 48 | 48 | } |
| 49 | 49 | } |
| 50 | 50 | return $res; |
@@ -206,8 +206,7 @@ discard block |
||
| 206 | 206 | } |
| 207 | 207 | } |
| 208 | 208 | return $res; |
| 209 | - } |
|
| 210 | - else |
|
| 209 | + } else |
|
| 211 | 210 | { |
| 212 | 211 | return false; |
| 213 | 212 | } |
@@ -231,8 +230,7 @@ discard block |
||
| 231 | 230 | if(!is_object($this->ldapObj)) |
| 232 | 231 | { |
| 233 | 232 | return $this->setFieldLocal('userPassword', $this->generateLDAPPass($password)); |
| 234 | - } |
|
| 235 | - else |
|
| 233 | + } else |
|
| 236 | 234 | { |
| 237 | 235 | $obj = array('dn'=>$this->ldapObj->dn); |
| 238 | 236 | $obj['userPassword'] = $this->generateLDAPPass($password); |
@@ -321,8 +319,7 @@ discard block |
||
| 321 | 319 | if(!is_object($this->ldapObj)) |
| 322 | 320 | { |
| 323 | 321 | return $this->setFieldLocal('uid', $uid); |
| 324 | - } |
|
| 325 | - else |
|
| 322 | + } else |
|
| 326 | 323 | { |
| 327 | 324 | throw new \Exception('Unsupported!'); |
| 328 | 325 | } |
@@ -416,8 +413,7 @@ discard block |
||
| 416 | 413 | if(isset($ldapObj->userpassword)) |
| 417 | 414 | { |
| 418 | 415 | $hash = hash('sha512', $ldapObj->dn.';'.$ldapObj->userpassword[0].';'.$ldapObj->mail[0]); |
| 419 | - } |
|
| 420 | - else |
|
| 416 | + } else |
|
| 421 | 417 | { |
| 422 | 418 | $hash = hash('sha512', $ldapObj->dn.';'.openssl_random_pseudo_bytes(10).';'.$ldapObj->mail[0]); |
| 423 | 419 | } |