@@ -77,10 +77,10 @@ discard block |
||
77 | 77 | if (isset($account)) { |
78 | 78 | foreach ($account as $key => $value) { |
79 | 79 | if (strpos($key, 'record') !== false) { |
80 | - unset($account[ $key ]); |
|
80 | + unset($account[$key]); |
|
81 | 81 | } elseif (in_array($key, |
82 | 82 | ['password', 'pin', 'token', 'sso', 'id_sys_user', 'id_sys_module', 'id_sys_module_role'])) { |
83 | - unset($account[ $key ]); |
|
83 | + unset($account[$key]); |
|
84 | 84 | } |
85 | 85 | } |
86 | 86 | |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | $column = 'id'; |
110 | 110 | } elseif (filter_var($username, FILTER_VALIDATE_EMAIL)) { |
111 | 111 | $column = 'email'; |
112 | - } elseif (preg_match($this->config[ 'msisdnRegex' ], $username)) { |
|
112 | + } elseif (preg_match($this->config['msisdnRegex'], $username)) { |
|
113 | 113 | $column = 'msisdn'; |
114 | 114 | } |
115 | 115 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | public function loggedIn() |
132 | 132 | { |
133 | 133 | if (parent::loggedIn()) { |
134 | - $account = new Account($_SESSION[ 'account' ]); |
|
134 | + $account = new Account($_SESSION['account']); |
|
135 | 135 | |
136 | 136 | if ($user = models('users')->findWhere(['username' => $account->username], 1)) { |
137 | 137 | // Store Account Profile |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | $column = 'id'; |
181 | 181 | } elseif (filter_var($username, FILTER_VALIDATE_EMAIL)) { |
182 | 182 | $column = 'email'; |
183 | - } elseif (preg_match($this->config[ 'msisdnRegex' ], $username)) { |
|
183 | + } elseif (preg_match($this->config['msisdnRegex'], $username)) { |
|
184 | 184 | $column = 'msisdn'; |
185 | 185 | } elseif (strpos($username, 'token-') !== false) { |
186 | 186 | $username = str_replace('token-', '', $username); |
@@ -195,15 +195,15 @@ discard block |
||
195 | 195 | |
196 | 196 | foreach ($account as $key => $value) { |
197 | 197 | if (strpos($key, 'record') !== false) { |
198 | - unset($account[ $key ]); |
|
198 | + unset($account[$key]); |
|
199 | 199 | } elseif (in_array($key, ['password', 'pin', 'token', 'sso'])) { |
200 | - unset($account[ $key ]); |
|
200 | + unset($account[$key]); |
|
201 | 201 | } |
202 | 202 | } |
203 | 203 | |
204 | 204 | if ($column === 'token') { |
205 | 205 | models('users')->update([ |
206 | - 'id' => $account[ 'id' ], |
|
206 | + 'id' => $account['id'], |
|
207 | 207 | 'token' => null, |
208 | 208 | ]); |
209 | 209 | } |
@@ -227,9 +227,9 @@ discard block |
||
227 | 227 | */ |
228 | 228 | public function authorize(ServerRequest $request) |
229 | 229 | { |
230 | - if (isset($GLOBALS[ 'account' ][ 'role' ])) { |
|
230 | + if (isset($GLOBALS['account']['role'])) { |
|
231 | 231 | $uriSegments = $request->getUri()->getSegments()->getString(); |
232 | - $role = $GLOBALS[ 'account' ][ 'role' ]; |
|
232 | + $role = $GLOBALS['account']['role']; |
|
233 | 233 | if (in_array($role->code, ['DEVELOPER', 'ADMINISTRATOR'])) { |
234 | 234 | globals()->store('authority', new Authority([ |
235 | 235 | 'permission' => 'GRANTED', |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | public function getIframeCode() |
270 | 270 | { |
271 | 271 | if ($this->signedOn() && $this->loggedIn() === false) { |
272 | - return '<iframe id="sign-on-iframe" width="1" height="1" src="' . rtrim($this->config[ 'sso' ][ 'server' ], |
|
272 | + return '<iframe id="sign-on-iframe" width="1" height="1" src="' . rtrim($this->config['sso']['server'], |
|
273 | 273 | '/') . '" style="display: none; visibility: hidden;"></iframe>'; |
274 | 274 | } |
275 | 275 |