@@ -75,8 +75,8 @@ |
||
75 | 75 | if(!isset($this->headers['Authorization'])) |
76 | 76 | { |
77 | 77 | $this->app->user = $this->getUserFromSession(); |
78 | - } |
|
79 | - else |
|
78 | + } |
|
79 | + else |
|
80 | 80 | { |
81 | 81 | $header = $this->headers['Authorization']; |
82 | 82 | $this->app->user = $this->getUserFromHeader($header); |
@@ -35,11 +35,17 @@ discard block |
||
35 | 35 | return array(new FilterClause($string)); |
36 | 36 | } |
37 | 37 | $children = array(); |
38 | - if($parens) array_push($children, '('); |
|
38 | + if($parens) |
|
39 | + { |
|
40 | + array_push($children, '('); |
|
41 | + } |
|
39 | 42 | $children = array_merge($children, self::process_string($clauses[1])); |
40 | 43 | array_push($children, trim($clauses[2])); |
41 | 44 | $children = array_merge($children, self::process_string($clauses[3])); |
42 | - if($parens) array_push($children, ')'); |
|
45 | + if($parens) |
|
46 | + { |
|
47 | + array_push($children, ')'); |
|
48 | + } |
|
43 | 49 | return $children; |
44 | 50 | } |
45 | 51 | |
@@ -178,7 +184,10 @@ discard block |
||
178 | 184 | $count = count($this->children); |
179 | 185 | for($i = 0; $i < $count; $i++) |
180 | 186 | { |
181 | - if(!is_object($this->children[$i])) continue; |
|
187 | + if(!is_object($this->children[$i])) |
|
188 | + { |
|
189 | + continue; |
|
190 | + } |
|
182 | 191 | if(strstr($this->children[$i]->var1, $substr) !== false || |
183 | 192 | strstr($this->children[$i]->var2, $substr) !== false) |
184 | 193 | { |
@@ -9,7 +9,10 @@ |
||
9 | 9 | |
10 | 10 | function __construct($string=false) |
11 | 11 | { |
12 | - if($string !== false) $this->process_filter_string($string); |
|
12 | + if($string !== false) |
|
13 | + { |
|
14 | + $this->process_filter_string($string); |
|
15 | + } |
|
13 | 16 | } |
14 | 17 | |
15 | 18 | static function str_startswith($haystack, $needle) |
@@ -280,11 +280,17 @@ |
||
280 | 280 | public function canLoginWith($provider) |
281 | 281 | { |
282 | 282 | $hosts = $this->getLoginProviders(); |
283 | - if($hosts === false) return false; |
|
283 | + if($hosts === false) |
|
284 | + { |
|
285 | + return false; |
|
286 | + } |
|
284 | 287 | $count = count($hosts); |
285 | 288 | for($i = 0; $i < $count; $i++) |
286 | 289 | { |
287 | - if(strcasecmp($hosts[$i], $provider) === 0) return true; |
|
290 | + if(strcasecmp($hosts[$i], $provider) === 0) |
|
291 | + { |
|
292 | + return true; |
|
293 | + } |
|
288 | 294 | } |
289 | 295 | return false; |
290 | 296 | } |
@@ -179,7 +179,10 @@ |
||
179 | 179 | $count = count($groups); |
180 | 180 | for($i = 0; $i < $count; $i++) |
181 | 181 | { |
182 | - if($groups[$i] === false || $groups[$i] === null) continue; |
|
182 | + if($groups[$i] === false || $groups[$i] === null) |
|
183 | + { |
|
184 | + continue; |
|
185 | + } |
|
183 | 186 | array_push($data, new LDAPGroup($groups[$i])); |
184 | 187 | } |
185 | 188 | $users = $this->server->read($this->server->user_base, $userFilter, false, $select); |
@@ -41,10 +41,16 @@ |
||
41 | 41 | switch($orderby[$keys[0]]) |
42 | 42 | { |
43 | 43 | case 1: |
44 | - if($d > 0) swap($array, $i, $j); |
|
44 | + if($d > 0) |
|
45 | + { |
|
46 | + swap($array, $i, $j); |
|
47 | + } |
|
45 | 48 | break; |
46 | 49 | case 0: |
47 | - if($d < 0) swap($array, $i, $j); |
|
50 | + if($d < 0) |
|
51 | + { |
|
52 | + swap($array, $i, $j); |
|
53 | + } |
|
48 | 54 | break; |
49 | 55 | } |
50 | 56 | } |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Auth; |
3 | 3 | |
4 | -trait LDAPCachableObject |
|
4 | +trait LDAPCachableObject |
|
5 | 5 | { |
6 | 6 | protected function update($obj) |
7 | 7 | { |
@@ -13,7 +13,10 @@ discard block |
||
13 | 13 | { |
14 | 14 | $auth = \AuthProvider::getInstance(); |
15 | 15 | $ldap = $auth->getAuthenticator('Auth\LDAPAuthenticator'); |
16 | - if($ldap === false) return false; |
|
16 | + if($ldap === false) |
|
17 | + { |
|
18 | + return false; |
|
19 | + } |
|
17 | 20 | $this->server = $ldap->get_and_bind_server(true); |
18 | 21 | return $this->server->update($obj); |
19 | 22 | } |
@@ -1,24 +1,24 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace Auth; |
3 | 3 | |
4 | -class NullAuthenticator extends Authenticator |
|
5 | -{ |
|
6 | - public function login($username, $password) |
|
7 | - { |
|
4 | +class NullAuthenticator extends Authenticator |
|
5 | +{ |
|
6 | + public function login($username, $password) |
|
7 | + { |
|
8 | 8 | return array('res'=>true, 'extended'=>null); |
9 | 9 | } |
10 | 10 | |
11 | - public function isLoggedIn($data) |
|
12 | - { |
|
13 | - if(isset($data['res'])) |
|
14 | - { |
|
11 | + public function isLoggedIn($data) |
|
12 | + { |
|
13 | + if(isset($data['res'])) |
|
14 | + { |
|
15 | 15 | return $data['res']; |
16 | 16 | } |
17 | 17 | return false; |
18 | 18 | } |
19 | 19 | |
20 | - public function getUser($data) |
|
21 | - { |
|
20 | + public function getUser($data) |
|
21 | + { |
|
22 | 22 | return null; |
23 | 23 | } |
24 | 24 | } |
@@ -44,7 +44,10 @@ |
||
44 | 44 | { |
45 | 45 | $dn = explode(',', $array[$i]); |
46 | 46 | $res = $this->isInGroupNamed(substr($dn[0], 3)); |
47 | - if($res) return $res; |
|
47 | + if($res) |
|
48 | + { |
|
49 | + return $res; |
|
50 | + } |
|
48 | 51 | } |
49 | 52 | } |
50 | 53 | return $res; |