@@ -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 | } |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Auth; |
3 | 3 | |
4 | -if(!function_exists('password_hash') || !function_exists('password_verify')) |
|
4 | +if(!function_exists('password_hash') || !function_exists('password_verify')) |
|
5 | 5 | { |
6 | 6 | define('PASSWORD_BCRYPT', 1); |
7 | 7 | define('PASSWORD_DEFAULT', PASSWORD_BCRYPT); |
@@ -149,7 +149,10 @@ discard block |
||
149 | 149 | |
150 | 150 | public function login($username, $password) |
151 | 151 | { |
152 | - if($this->current === false) return false; |
|
152 | + if($this->current === false) |
|
153 | + { |
|
154 | + return false; |
|
155 | + } |
|
153 | 156 | $userDataTable = $this->getDataTable('user'); |
154 | 157 | $filter = new \Data\Filter("uid eq '$username'"); |
155 | 158 | $users = $userDataTable->read($filter); |
@@ -239,9 +242,15 @@ discard block |
||
239 | 242 | |
240 | 243 | public function getPendingUserCount() |
241 | 244 | { |
242 | - if($this->pending === false) return 0; |
|
245 | + if($this->pending === false) |
|
246 | + { |
|
247 | + return 0; |
|
248 | + } |
|
243 | 249 | $dataTable = $this->getPendingUserDataTable(); |
244 | - if($dataTable === null) return 0; |
|
250 | + if($dataTable === null) |
|
251 | + { |
|
252 | + return 0; |
|
253 | + } |
|
245 | 254 | return $dataTable->count(); |
246 | 255 | } |
247 | 256 | |
@@ -277,9 +286,11 @@ discard block |
||
277 | 286 | } |
278 | 287 | |
279 | 288 | public function getPendingUsersByFilter($filter, $select=false, $top=false, $skip=false, $orderby=false) |
280 | - |
|
281 | 289 | { |
282 | - if($this->pending === false) return false; |
|
290 | + if($this->pending === false) |
|
291 | + { |
|
292 | + return false; |
|
293 | + } |
|
283 | 294 | if($filter !== false && !$filter->contains('hash')) |
284 | 295 | { |
285 | 296 | return $this->searchPendingUsers($filter, $select, $top, $skip, $orderby); |
@@ -300,7 +311,10 @@ discard block |
||
300 | 311 | |
301 | 312 | public function createPendingUser($user) |
302 | 313 | { |
303 | - if($this->pending === false) return false; |
|
314 | + if($this->pending === false) |
|
315 | + { |
|
316 | + return false; |
|
317 | + } |
|
304 | 318 | $userDataTable = $this->getPendingUserDataTable(); |
305 | 319 | if(isset($user->password2)) |
306 | 320 | { |
@@ -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; |
@@ -46,11 +46,15 @@ discard block |
||
46 | 46 | public function jsonSerialize() |
47 | 47 | { |
48 | 48 | $group = array(); |
49 | - try{ |
|
49 | + try |
|
50 | + { |
|
50 | 51 | $group['cn'] = $this->getGroupName(); |
51 | 52 | $group['description'] = $this->getDescription(); |
52 | 53 | $group['member'] = $this->getMemberUids(); |
53 | - } catch(\Exception $e) {echo $e->getMessage(); die();} |
|
54 | + } |
|
55 | + catch(\Exception $e) |
|
56 | + { |
|
57 | +echo $e->getMessage(); die();} |
|
54 | 58 | return $group; |
55 | 59 | } |
56 | 60 | |
@@ -86,7 +90,10 @@ discard block |
||
86 | 90 | { |
87 | 91 | $isLast = true; |
88 | 92 | } |
89 | - if(!isset($group->member[$i]->type)) continue; |
|
93 | + if(!isset($group->member[$i]->type)) |
|
94 | + { |
|
95 | + continue; |
|
96 | + } |
|
90 | 97 | if($group->member[$i]->type === 'Group') |
91 | 98 | { |
92 | 99 | $this->addMember($group->member[$i]->cn, true, $isLast); |
@@ -423,7 +423,10 @@ |
||
423 | 423 | */ |
424 | 424 | private function setupVars() |
425 | 425 | { |
426 | - if($this->minified !== null && $this->cdn !== null) return; |
|
426 | + if($this->minified !== null && $this->cdn !== null) |
|
427 | + { |
|
428 | + return; |
|
429 | + } |
|
427 | 430 | $this->minified = 'min'; |
428 | 431 | $this->cdn = 'cdn'; |
429 | 432 | if(isset(FlipsideSettings::$global)) |
@@ -16,8 +16,14 @@ |
||
16 | 16 | $ret = array(); |
17 | 17 | foreach ($this as $key => $value) |
18 | 18 | { |
19 | - if($key === 'server' || $key === 'count') continue; |
|
20 | - if(is_numeric($key)) continue; |
|
19 | + if($key === 'server' || $key === 'count') |
|
20 | + { |
|
21 | + continue; |
|
22 | + } |
|
23 | + if(is_numeric($key)) |
|
24 | + { |
|
25 | + continue; |
|
26 | + } |
|
21 | 27 | if($key === 'jpegphoto') |
22 | 28 | { |
23 | 29 | $ret[$key] = base64_encode($value[0]); |
@@ -1,6 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | require_once('Autoload.php'); |
3 | -if(!isset($_SESSION) && php_sapi_name() !== 'cli') { session_start(); } |
|
3 | +if(!isset($_SESSION) && php_sapi_name() !== 'cli') |
|
4 | +{ |
|
5 | +session_start(); } |
|
4 | 6 | if(!isset($_SESSION['ip_address']) && isset($_SERVER['REMOTE_ADDR'])) |
5 | 7 | { |
6 | 8 | $_SESSION['ip_address'] = $_SERVER['REMOTE_ADDR']; |
@@ -156,7 +158,10 @@ discard block |
||
156 | 158 | $pos = strpos($sessionData, "|", $offset); |
157 | 159 | $len = $pos - $offset; |
158 | 160 | $name = substr($sessionData, $offset, $len); |
159 | - if($name === false) break; |
|
161 | + if($name === false) |
|
162 | + { |
|
163 | + break; |
|
164 | + } |
|
160 | 165 | $offset += $len+1; |
161 | 166 | $data = @unserialize(substr($sessionData, $offset)); |
162 | 167 | $res[$name] = $data; |
@@ -22,7 +22,8 @@ |
||
22 | 22 | * @license http://www.opensource.org/licenses/bsd-license New BSD License |
23 | 23 | * @link http://www.php.net/manual/en/class.jsonserializable.php |
24 | 24 | */ |
25 | -interface JsonSerializable { |
|
25 | +interface JsonSerializable |
|
26 | +{ |
|
26 | 27 | /** The jsonSerizlize function as defined by PHP 5.4 and greater */ |
27 | 28 | public function jsonSerialize(); |
28 | 29 | } |