@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | * @param $uid |
| 142 | 142 | */ |
| 143 | 143 | public function invalidate($uid) { |
| 144 | - if(!isset($this->usersByUid[$uid])) { |
|
| 144 | + if (!isset($this->usersByUid[$uid])) { |
|
| 145 | 145 | return; |
| 146 | 146 | } |
| 147 | 147 | $dn = $this->usersByUid[$uid]->getDN(); |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | * @return null |
| 156 | 156 | */ |
| 157 | 157 | private function checkAccess() { |
| 158 | - if(is_null($this->access)) { |
|
| 158 | + if (is_null($this->access)) { |
|
| 159 | 159 | throw new \Exception('LDAP Access instance must be set first'); |
| 160 | 160 | } |
| 161 | 161 | } |
@@ -179,11 +179,11 @@ discard block |
||
| 179 | 179 | ]; |
| 180 | 180 | |
| 181 | 181 | $homeRule = $this->access->getConnection()->homeFolderNamingRule; |
| 182 | - if(strpos($homeRule, 'attr:') === 0) { |
|
| 182 | + if (strpos($homeRule, 'attr:') === 0) { |
|
| 183 | 183 | $attributes[] = substr($homeRule, strlen('attr:')); |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | - if(!$minimal) { |
|
| 186 | + if (!$minimal) { |
|
| 187 | 187 | // attributes that are not really important but may come with big |
| 188 | 188 | // payload. |
| 189 | 189 | $attributes = array_merge( |
@@ -194,8 +194,8 @@ discard block |
||
| 194 | 194 | |
| 195 | 195 | $attributes = array_reduce($attributes, |
| 196 | 196 | function($list, $attribute) { |
| 197 | - $attribute = strtolower(trim((string)$attribute)); |
|
| 198 | - if(!empty($attribute) && !in_array($attribute, $list)) { |
|
| 197 | + $attribute = strtolower(trim((string) $attribute)); |
|
| 198 | + if (!empty($attribute) && !in_array($attribute, $list)) { |
|
| 199 | 199 | $list[] = $attribute; |
| 200 | 200 | } |
| 201 | 201 | |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | public function isDeletedUser($id) { |
| 216 | 216 | $isDeleted = $this->ocConfig->getUserValue( |
| 217 | 217 | $id, 'user_ldap', 'isDeleted', 0); |
| 218 | - return (int)$isDeleted === 1; |
|
| 218 | + return (int) $isDeleted === 1; |
|
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | /** |
@@ -238,11 +238,11 @@ discard block |
||
| 238 | 238 | */ |
| 239 | 239 | protected function createInstancyByUserName($id) { |
| 240 | 240 | //most likely a uid. Check whether it is a deleted user |
| 241 | - if($this->isDeletedUser($id)) { |
|
| 241 | + if ($this->isDeletedUser($id)) { |
|
| 242 | 242 | return $this->getDeletedUser($id); |
| 243 | 243 | } |
| 244 | 244 | $dn = $this->access->username2dn($id); |
| 245 | - if($dn !== false) { |
|
| 245 | + if ($dn !== false) { |
|
| 246 | 246 | return $this->createAndCache($dn, $id); |
| 247 | 247 | } |
| 248 | 248 | return null; |
@@ -256,15 +256,15 @@ discard block |
||
| 256 | 256 | */ |
| 257 | 257 | public function get($id) { |
| 258 | 258 | $this->checkAccess(); |
| 259 | - if(isset($this->usersByDN[$id])) { |
|
| 259 | + if (isset($this->usersByDN[$id])) { |
|
| 260 | 260 | return $this->usersByDN[$id]; |
| 261 | - } else if(isset($this->usersByUid[$id])) { |
|
| 261 | + } else if (isset($this->usersByUid[$id])) { |
|
| 262 | 262 | return $this->usersByUid[$id]; |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | - if($this->access->stringResemblesDN($id) ) { |
|
| 265 | + if ($this->access->stringResemblesDN($id)) { |
|
| 266 | 266 | $uid = $this->access->dn2username($id); |
| 267 | - if($uid !== false) { |
|
| 267 | + if ($uid !== false) { |
|
| 268 | 268 | return $this->createAndCache($id, $uid); |
| 269 | 269 | } |
| 270 | 270 | } |