@@ -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 | } |
@@ -177,18 +177,18 @@ discard block |
||
| 177 | 177 | $this->access->getConnection()->ldapUserDisplayName, |
| 178 | 178 | $this->access->getConnection()->ldapUserDisplayName2, |
| 179 | 179 | ); |
| 180 | - foreach($possible as $attr) { |
|
| 181 | - if(!is_null($attr)) { |
|
| 180 | + foreach ($possible as $attr) { |
|
| 181 | + if (!is_null($attr)) { |
|
| 182 | 182 | $attributes[] = $attr; |
| 183 | 183 | } |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | $homeRule = $this->access->getConnection()->homeFolderNamingRule; |
| 187 | - if(strpos($homeRule, 'attr:') === 0) { |
|
| 187 | + if (strpos($homeRule, 'attr:') === 0) { |
|
| 188 | 188 | $attributes[] = substr($homeRule, strlen('attr:')); |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | - if(!$minimal) { |
|
| 191 | + if (!$minimal) { |
|
| 192 | 192 | // attributes that are not really important but may come with big |
| 193 | 193 | // payload. |
| 194 | 194 | $attributes = array_merge( |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | |
| 200 | 200 | // remove possible empty attributes |
| 201 | 201 | $attributes = array_values( |
| 202 | - array_filter($attributes, function ($attributeName) { |
|
| 202 | + array_filter($attributes, function($attributeName) { |
|
| 203 | 203 | return !empty($attributeName); |
| 204 | 204 | }) |
| 205 | 205 | ); |
@@ -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 | } |