@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * @param string $username The username |
25 | 25 | * @param string $password The password |
26 | 26 | * |
27 | - * @return mixed False if unsuccessfuly login, opaque data otherwise |
|
27 | + * @return boolean False if unsuccessfuly login, opaque data otherwise |
|
28 | 28 | * |
29 | 29 | * @SuppressWarnings("UnusedFormalParameter") |
30 | 30 | */ |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | /** |
37 | 37 | * Does the data indicate a logged in user? |
38 | 38 | * |
39 | - * @param mixed $data The data returned from login |
|
39 | + * @param \stdClass $data The data returned from login |
|
40 | 40 | * |
41 | 41 | * @return boolean True if successfully logged in, false otherwise |
42 | 42 | * |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | /** |
51 | 51 | * Get the user data for the specified data |
52 | 52 | * |
53 | - * @param mixed $data The data returned from login |
|
53 | + * @param \stdClass $data The data returned from login |
|
54 | 54 | * |
55 | 55 | * @return Auth\User The user object if successfully logged in or null otherwise |
56 | 56 | * |
@@ -93,12 +93,12 @@ discard block |
||
93 | 93 | * Get the groups that match the filters |
94 | 94 | * |
95 | 95 | * @param mixed $filter The filter to use to find a set of groups |
96 | - * @param mixed $select The list of fields to select |
|
96 | + * @param boolean $select The list of fields to select |
|
97 | 97 | * @param mixed $top The number of groups to select |
98 | 98 | * @param mixed $skip The number of groups to skip |
99 | 99 | * @param mixed $orderby The fields to sort by |
100 | 100 | * |
101 | - * @return array All groups that fit the filters |
|
101 | + * @return boolean All groups that fit the filters |
|
102 | 102 | * |
103 | 103 | * @SuppressWarnings("UnusedFormalParameter") |
104 | 104 | */ |
@@ -111,12 +111,12 @@ discard block |
||
111 | 111 | * Get the users that match the filters |
112 | 112 | * |
113 | 113 | * @param mixed $filter The filter to use to find a set of users |
114 | - * @param mixed $select The list of fields to select |
|
114 | + * @param boolean $select The list of fields to select |
|
115 | 115 | * @param mixed $top The number of users to select |
116 | 116 | * @param mixed $skip The number of users to skip |
117 | 117 | * @param mixed $orderby The fields to sort by |
118 | 118 | * |
119 | - * @return array All users that fit the filters |
|
119 | + * @return boolean All users that fit the filters |
|
120 | 120 | * |
121 | 121 | * @SuppressWarnings("UnusedFormalParameter") |
122 | 122 | */ |
@@ -129,12 +129,12 @@ discard block |
||
129 | 129 | * Get the pending users that match the filters |
130 | 130 | * |
131 | 131 | * @param mixed $filter The filter to use to find a set of users |
132 | - * @param mixed $select The list of fields to select |
|
132 | + * @param boolean $select The list of fields to select |
|
133 | 133 | * @param mixed $top The number of users to select |
134 | 134 | * @param mixed $skip The number of users to skip |
135 | 135 | * @param mixed $orderby The fields to sort by |
136 | 136 | * |
137 | - * @return array All users that fit the filters |
|
137 | + * @return boolean All users that fit the filters |
|
138 | 138 | * |
139 | 139 | * @SuppressWarnings("UnusedFormalParameter") |
140 | 140 | */ |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | /** |
192 | 192 | * Get the link to login using this method |
193 | 193 | * |
194 | - * @return string The link to login using this method |
|
194 | + * @return boolean The link to login using this method |
|
195 | 195 | */ |
196 | 196 | public function getSupplementLink() |
197 | 197 | { |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | /** |
216 | 216 | * Convert a pending user to an active user |
217 | 217 | * |
218 | - * @param Auth\PendingUser $user The user to activate |
|
218 | + * @param PendingUser $user The user to activate |
|
219 | 219 | * |
220 | 220 | * @return boolean True if activated, false otherwise |
221 | 221 | * |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | * |
232 | 232 | * @param string $hash The hash to search by |
233 | 233 | * |
234 | - * @return Auth\User The user whoes hash was specified |
|
234 | + * @return boolean The user whoes hash was specified |
|
235 | 235 | * |
236 | 236 | * @SuppressWarnings("UnusedFormalParameter") |
237 | 237 | */ |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | * |
246 | 246 | * @param string $hash The hash to search by |
247 | 247 | * |
248 | - * @return Auth\PendingUser The user whoes hash was specified |
|
248 | + * @return boolean The user whoes hash was specified |
|
249 | 249 | * |
250 | 250 | * @SuppressWarnings("UnusedFormalParameter") |
251 | 251 | */ |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | /** |
258 | 258 | * Get the host name this authenticator uses |
259 | 259 | * |
260 | - * @return string The host name this authenticator uses |
|
260 | + * @return boolean The host name this authenticator uses |
|
261 | 261 | */ |
262 | 262 | public function getHostName() |
263 | 263 | { |
@@ -279,6 +279,12 @@ discard block |
||
279 | 279 | return $server->count($this->user_base); |
280 | 280 | } |
281 | 281 | |
282 | + /** |
|
283 | + * @param boolean $select |
|
284 | + * @param boolean $top |
|
285 | + * @param boolean $skip |
|
286 | + * @param boolean $orderby |
|
287 | + */ |
|
282 | 288 | private function processFilteringParams(&$data, &$select, $top, $skip, $orderby) |
283 | 289 | { |
284 | 290 | if($orderby !== false) |
@@ -303,6 +309,9 @@ discard block |
||
303 | 309 | } |
304 | 310 | } |
305 | 311 | |
312 | + /** |
|
313 | + * @param \Data\Filter $filter |
|
314 | + */ |
|
306 | 315 | public function getUsersByFilter($filter, $select=false, $top=false, $skip=false, $orderby=false) |
307 | 316 | { |
308 | 317 | $server = $this->get_and_bind_server(); |
@@ -17,8 +17,7 @@ discard block |
||
17 | 17 | if(isset($GLOBALS['FLIPSIDE_SETTINGS_LOC'])) |
18 | 18 | { |
19 | 19 | require_once($GLOBALS['FLIPSIDE_SETTINGS_LOC'].'/class.FlipsideSettings.php'); |
20 | -} |
|
21 | -else |
|
20 | +} else |
|
22 | 21 | { |
23 | 22 | require_once('/var/www/secure_settings/class.FlipsideSettings.php'); |
24 | 23 | } |
@@ -41,10 +40,14 @@ discard block |
||
41 | 40 | switch($orderby[$keys[0]]) |
42 | 41 | { |
43 | 42 | case 1: |
44 | - if($d > 0) swap($array, $i, $j); |
|
43 | + if($d > 0) { |
|
44 | + swap($array, $i, $j); |
|
45 | + } |
|
45 | 46 | break; |
46 | 47 | case 0: |
47 | - if($d < 0) swap($array, $i, $j); |
|
48 | + if($d < 0) { |
|
49 | + swap($array, $i, $j); |
|
50 | + } |
|
48 | 51 | break; |
49 | 52 | } |
50 | 53 | } |
@@ -165,8 +168,7 @@ discard block |
||
165 | 168 | if($bind_write === false) |
166 | 169 | { |
167 | 170 | $ret = $server->bind(); |
168 | - } |
|
169 | - else |
|
171 | + } else |
|
170 | 172 | { |
171 | 173 | $ret = $server->bind($this->bind_dn, $this->bind_pass); |
172 | 174 | } |
@@ -299,12 +301,10 @@ discard block |
||
299 | 301 | if($skip !== false && $top !== false) |
300 | 302 | { |
301 | 303 | $data = array_slice($data, $skip, $top); |
302 | - } |
|
303 | - else if($top !== false) |
|
304 | + } else if($top !== false) |
|
304 | 305 | { |
305 | 306 | $data = array_slice($data, 0, $top); |
306 | - } |
|
307 | - else if($skip !== false) |
|
307 | + } else if($skip !== false) |
|
308 | 308 | { |
309 | 309 | $data = array_slice($data, $skip); |
310 | 310 | } |
@@ -18,6 +18,9 @@ discard block |
||
18 | 18 | } |
19 | 19 | } |
20 | 20 | |
21 | + /** |
|
22 | + * @param string $fieldName |
|
23 | + */ |
|
21 | 24 | protected function getField($fieldName) |
22 | 25 | { |
23 | 26 | if(!is_object($this->ldapObj)) |
@@ -27,6 +30,9 @@ discard block |
||
27 | 30 | return $this->getFieldServer($fieldName); |
28 | 31 | } |
29 | 32 | |
33 | + /** |
|
34 | + * @param string $fieldName |
|
35 | + */ |
|
30 | 36 | protected function getFieldSingleValue($fieldName) |
31 | 37 | { |
32 | 38 | if(!is_object($this->ldapObj)) |
@@ -36,6 +42,9 @@ discard block |
||
36 | 42 | return $this->getFieldServerSingleValue($fieldName); |
37 | 43 | } |
38 | 44 | |
45 | + /** |
|
46 | + * @param string $fieldName |
|
47 | + */ |
|
39 | 48 | protected function setField($fieldName, $fieldValue) |
40 | 49 | { |
41 | 50 | if(!is_object($this->ldapObj)) |
@@ -45,6 +54,9 @@ discard block |
||
45 | 54 | return $this->setFieldServer($fieldName, $fieldValue); |
46 | 55 | } |
47 | 56 | |
57 | + /** |
|
58 | + * @param string $fieldName |
|
59 | + */ |
|
48 | 60 | protected function appendField($fieldName, $fieldValue) |
49 | 61 | { |
50 | 62 | if(!is_object($this->ldapObj)) |
@@ -8,12 +8,13 @@ discard block |
||
8 | 8 | try |
9 | 9 | { |
10 | 10 | return $this->server->update($obj); |
11 | - } |
|
12 | - catch(\Exception $ex) |
|
11 | + } catch(\Exception $ex) |
|
13 | 12 | { |
14 | 13 | $auth = \AuthProvider::getInstance(); |
15 | 14 | $ldap = $auth->getAuthenticator('Auth\LDAPAuthenticator'); |
16 | - if($ldap === false) return false; |
|
15 | + if($ldap === false) { |
|
16 | + return false; |
|
17 | + } |
|
17 | 18 | $this->server = $ldap->get_and_bind_server(true); |
18 | 19 | return $this->server->update($obj); |
19 | 20 | } |
@@ -116,8 +117,7 @@ discard block |
||
116 | 117 | if($fieldValue !== null && strlen($fieldValue) > 0) |
117 | 118 | { |
118 | 119 | $obj[$fieldName] = $fieldValue; |
119 | - } |
|
120 | - else |
|
120 | + } else |
|
121 | 121 | { |
122 | 122 | $obj[$fieldName] = null; |
123 | 123 | } |
@@ -134,8 +134,7 @@ discard block |
||
134 | 134 | $obj[$fieldName] = $this->ldapObj->{$fieldName}; |
135 | 135 | $obj[$fieldName][$obj[$fieldName]['count']] = $fieldValue; |
136 | 136 | $obj[$fieldName]['count']++; |
137 | - } |
|
138 | - else |
|
137 | + } else |
|
139 | 138 | { |
140 | 139 | $obj[$fieldName] = $fieldValue; |
141 | 140 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * |
36 | 36 | * @param string $name The name of the group to check if the user is in |
37 | 37 | * |
38 | - * @return true|false True if the user is in the group, false otherwise |
|
38 | + * @return boolean True if the user is in the group, false otherwise |
|
39 | 39 | */ |
40 | 40 | public function isInGroupNamed($name) |
41 | 41 | { |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * We need the ability to obtain the user's unhashed plain text password to allow for it to be sent |
91 | 91 | * to the correct backend which will hash it |
92 | 92 | * |
93 | - * @return string The current password |
|
93 | + * @return boolean The current password |
|
94 | 94 | */ |
95 | 95 | public function getPassword() |
96 | 96 | { |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | * |
136 | 136 | * @param string $email The user's new email address |
137 | 137 | * |
138 | - * @return true|false true if the user's email address was changed, false otherwise |
|
138 | + * @return boolean true if the user's email address was changed, false otherwise |
|
139 | 139 | */ |
140 | 140 | public function setEmail($email) |
141 | 141 | { |
@@ -146,9 +146,8 @@ discard block |
||
146 | 146 | /** |
147 | 147 | * Set the user's given (first) name |
148 | 148 | * |
149 | - * @param string $name The user's new given name |
|
150 | 149 | * |
151 | - * @return true|false true if the user's given name was changed, false otherwise |
|
150 | + * @return boolean true if the user's given name was changed, false otherwise |
|
152 | 151 | */ |
153 | 152 | public function setGivenName($givenName) |
154 | 153 | { |
@@ -161,7 +160,7 @@ discard block |
||
161 | 160 | * |
162 | 161 | * @param string $sn The user's new last name |
163 | 162 | * |
164 | - * @return true|false true if the user's last name was changed, false otherwise |
|
163 | + * @return boolean true if the user's last name was changed, false otherwise |
|
165 | 164 | */ |
166 | 165 | public function setLastName($sn) |
167 | 166 | { |
@@ -34,8 +34,7 @@ |
||
34 | 34 | $args['RawMessage'] = array(); |
35 | 35 | $args['RawMessage']['Data'] = base64_encode($email->getRawMessage()); |
36 | 36 | return $this->ses->sendRawEmail($args); |
37 | - } |
|
38 | - else |
|
37 | + } else |
|
39 | 38 | { |
40 | 39 | $args = array(); |
41 | 40 | $args['Source'] = $email->getFromAddress(); |
@@ -138,6 +138,9 @@ discard block |
||
138 | 138 | return $dataTable; |
139 | 139 | } |
140 | 140 | |
141 | + /** |
|
142 | + * @return boolean |
|
143 | + */ |
|
141 | 144 | private function getPendingUserDataTable() |
142 | 145 | { |
143 | 146 | if(isset($this->params['pending_user_table'])) |
@@ -208,6 +211,14 @@ discard block |
||
208 | 211 | return $dataTable->read($filter, $select, $top, $skip, $orderby); |
209 | 212 | } |
210 | 213 | |
214 | + /** |
|
215 | + * @param string $dataTableName |
|
216 | + * @param string $className |
|
217 | + * @param boolean $select |
|
218 | + * @param boolean $top |
|
219 | + * @param boolean $skip |
|
220 | + * @param boolean $orderby |
|
221 | + */ |
|
211 | 222 | private function convertDataToClass($dataTableName, $className, $filter, $select, $top, $skip, $orderby) |
212 | 223 | { |
213 | 224 | $data = $this->getDataByFilter($dataTableName, $filter, $select, $top, $skip, $orderby); |
@@ -241,6 +252,12 @@ discard block |
||
241 | 252 | return $dataTable->count(); |
242 | 253 | } |
243 | 254 | |
255 | + /** |
|
256 | + * @param boolean $select |
|
257 | + * @param boolean $top |
|
258 | + * @param boolean $skip |
|
259 | + * @param boolean $orderby |
|
260 | + */ |
|
244 | 261 | private function searchPendingUsers($filter, $select, $top, $skip, $orderby) |
245 | 262 | { |
246 | 263 | $userDataTable = $this->getPendingUserDataTable(); |
@@ -272,6 +289,9 @@ discard block |
||
272 | 289 | return $ret; |
273 | 290 | } |
274 | 291 | |
292 | + /** |
|
293 | + * @param \Data\Filter $filter |
|
294 | + */ |
|
275 | 295 | public function getPendingUsersByFilter($filter, $select=false, $top=false, $skip=false, $orderby=false) |
276 | 296 | |
277 | 297 | { |
@@ -149,7 +149,9 @@ 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 | + return false; |
|
154 | + } |
|
153 | 155 | $userDataTable = $this->getDataTable('user'); |
154 | 156 | $filter = new \Data\Filter("uid eq '$username'"); |
155 | 157 | $users = $userDataTable->read($filter, 'uid,pass'); |
@@ -235,9 +237,13 @@ discard block |
||
235 | 237 | |
236 | 238 | public function getPendingUserCount() |
237 | 239 | { |
238 | - if($this->pending === false) return 0; |
|
240 | + if($this->pending === false) { |
|
241 | + return 0; |
|
242 | + } |
|
239 | 243 | $dataTable = $this->getPendingUserDataTable(); |
240 | - if($dataTable === null) return 0; |
|
244 | + if($dataTable === null) { |
|
245 | + return 0; |
|
246 | + } |
|
241 | 247 | return $dataTable->count(); |
242 | 248 | } |
243 | 249 | |
@@ -275,7 +281,9 @@ discard block |
||
275 | 281 | public function getPendingUsersByFilter($filter, $select=false, $top=false, $skip=false, $orderby=false) |
276 | 282 | |
277 | 283 | { |
278 | - if($this->pending === false) return false; |
|
284 | + if($this->pending === false) { |
|
285 | + return false; |
|
286 | + } |
|
279 | 287 | if($filter !== false && !$filter->contains('hash')) |
280 | 288 | { |
281 | 289 | return $this->searchPendingUsers($filter, $select, $top, $skip, $orderby); |
@@ -296,7 +304,9 @@ discard block |
||
296 | 304 | |
297 | 305 | public function createPendingUser($user) |
298 | 306 | { |
299 | - if($this->pending === false) return false; |
|
307 | + if($this->pending === false) { |
|
308 | + return false; |
|
309 | + } |
|
300 | 310 | $userDataTable = $this->getPendingUserDataTable(); |
301 | 311 | if(isset($user->password2)) |
302 | 312 | { |
@@ -109,7 +109,7 @@ |
||
109 | 109 | * @param $params The set of parameters obtained from the authentication call |
110 | 110 | * @param $current_user The user from the current system if the user is not authorized to login via this method |
111 | 111 | * |
112 | - * @return SUCCESS|LOGIN_FAILED|ALREADY_PRESENT SUCCESS if the user is now logged in. ALREADY_PRESENT if the authorization was |
|
112 | + * @return integer SUCCESS if the user is now logged in. ALREADY_PRESENT if the authorization was |
|
113 | 113 | * successful, but the user has not authorized that login method. LOGIN_FAILED for all other errors |
114 | 114 | */ |
115 | 115 | public function authenticate($params, &$current_user) |
@@ -34,8 +34,7 @@ |
||
34 | 34 | $args['RawMessage'] = array(); |
35 | 35 | $args['RawMessage']['Data'] = base64_encode($email->getRawMessage()); |
36 | 36 | return $this->ses->sendRawEmail($args); |
37 | - } |
|
38 | - else |
|
37 | + } else |
|
39 | 38 | { |
40 | 39 | $args = array(); |
41 | 40 | $args['Source'] = $email->getFromAddress(); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * |
54 | 54 | * @param string $methodName The class name of the Authenticator to get the instance for |
55 | 55 | * |
56 | - * @return Auth\Authenticator|false The specified Authenticator class instance or false if it is not loaded |
|
56 | + * @return string The specified Authenticator class instance or false if it is not loaded |
|
57 | 57 | */ |
58 | 58 | public function getAuthenticator($methodName) |
59 | 59 | { |
@@ -269,11 +269,11 @@ discard block |
||
269 | 269 | * Get an array of Auth\PendingUser from a filtered set |
270 | 270 | * |
271 | 271 | * @param Data\Filter|false $filter The filter conditions or false to retreive all |
272 | - * @param array|false $methodName The user fields to obtain or false to obtain all |
|
273 | - * @param integer|false $top The number of users to obtain or false to obtain all |
|
274 | - * @param integer|false $skip The number of users to skip or false to skip none |
|
275 | - * @param array|false $orderby The field to sort by and the method to sort or false to not sort |
|
276 | - * @param string|false $methodName The AuthMethod if information is desired only from a particular Auth\Authenticator |
|
272 | + * @param boolean $methodName The user fields to obtain or false to obtain all |
|
273 | + * @param boolean $top The number of users to obtain or false to obtain all |
|
274 | + * @param boolean $skip The number of users to skip or false to skip none |
|
275 | + * @param boolean $orderby The field to sort by and the method to sort or false to not sort |
|
276 | + * @param boolean $methodName The AuthMethod if information is desired only from a particular Auth\Authenticator |
|
277 | 277 | * |
278 | 278 | * @return array|false An array of Auth\PendingUser objects or false if no pending users were found |
279 | 279 | */ |
@@ -21,8 +21,7 @@ discard block |
||
21 | 21 | if(isset($GLOBALS['FLIPSIDE_SETTINGS_LOC'])) |
22 | 22 | { |
23 | 23 | require_once($GLOBALS['FLIPSIDE_SETTINGS_LOC'].'/class.FlipsideSettings.php'); |
24 | -} |
|
25 | -else |
|
24 | +} else |
|
26 | 25 | { |
27 | 26 | require_once('/var/www/secure_settings/class.FlipsideSettings.php'); |
28 | 27 | } |
@@ -381,7 +380,9 @@ discard block |
||
381 | 380 | $count = count($this->methods); |
382 | 381 | for($i = 0; $i < $count; $i++) |
383 | 382 | { |
384 | - if($this->methods[$i]->supplement === false) continue; |
|
383 | + if($this->methods[$i]->supplement === false) { |
|
384 | + continue; |
|
385 | + } |
|
385 | 386 | |
386 | 387 | array_push($ret, $this->methods[$i]->getSupplementLink()); |
387 | 388 | } |
@@ -420,7 +421,9 @@ discard block |
||
420 | 421 | $count = count($this->methods); |
421 | 422 | for($i = 0; $i < $count; $i++) |
422 | 423 | { |
423 | - if($this->methods[$i]->pending === false) continue; |
|
424 | + if($this->methods[$i]->pending === false) { |
|
425 | + continue; |
|
426 | + } |
|
424 | 427 | |
425 | 428 | $ret = $this->methods[$i]->getTempUserByHash($hash); |
426 | 429 | if($ret !== false) |
@@ -449,7 +452,9 @@ discard block |
||
449 | 452 | $count = count($this->methods); |
450 | 453 | for($i = 0; $i < $count; $i++) |
451 | 454 | { |
452 | - if($this->methods[$i]->pending === false) continue; |
|
455 | + if($this->methods[$i]->pending === false) { |
|
456 | + continue; |
|
457 | + } |
|
453 | 458 | |
454 | 459 | $ret = $this->methods[$i]->createPendingUser($user); |
455 | 460 | if($ret !== false) |
@@ -481,7 +486,9 @@ discard block |
||
481 | 486 | $count = count($this->methods); |
482 | 487 | for($i = 0; $i < $count; $i++) |
483 | 488 | { |
484 | - if($this->methods[$i]->current === false) continue; |
|
489 | + if($this->methods[$i]->current === false) { |
|
490 | + continue; |
|
491 | + } |
|
485 | 492 | |
486 | 493 | $ret = $this->methods[$i]->activatePendingUser($user); |
487 | 494 | if($ret !== false) |
@@ -511,7 +518,9 @@ discard block |
||
511 | 518 | $count = count($this->methods); |
512 | 519 | for($i = 0; $i < $count; $i++) |
513 | 520 | { |
514 | - if($this->methods[$i]->current === false) continue; |
|
521 | + if($this->methods[$i]->current === false) { |
|
522 | + continue; |
|
523 | + } |
|
515 | 524 | |
516 | 525 | $ret = $this->methods[$i]->getUserByResetHash($hash); |
517 | 526 | if($ret !== false) |
@@ -541,7 +550,9 @@ discard block |
||
541 | 550 | $count = count($this->methods); |
542 | 551 | for($i = 0; $i < $count; $i++) |
543 | 552 | { |
544 | - if($this->methods[$i]->supplement === false) continue; |
|
553 | + if($this->methods[$i]->supplement === false) { |
|
554 | + continue; |
|
555 | + } |
|
545 | 556 | |
546 | 557 | if($this->methods[$i]->getHostName() === $host) |
547 | 558 | { |
@@ -20,6 +20,9 @@ |
||
20 | 20 | $this->addWellKnownJS(JS_METISMENU, false); |
21 | 21 | } |
22 | 22 | |
23 | + /** |
|
24 | + * @param string $adminGroup |
|
25 | + */ |
|
23 | 26 | protected function userIsAdmin($adminGroup) |
24 | 27 | { |
25 | 28 | if($this->user === false || $this->user === null) |
@@ -34,8 +34,7 @@ discard block |
||
34 | 34 | if($this->user === false || $this->user === null) |
35 | 35 | { |
36 | 36 | $this->add_link('<i class="fa fa-sign-in"></i> Login', $this->loginUrl); |
37 | - } |
|
38 | - else |
|
37 | + } else |
|
39 | 38 | { |
40 | 39 | $this->add_links(); |
41 | 40 | $this->add_link('<i class="fa fa-sign-out"></i> Logout', $this->logoutUrl); |
@@ -166,8 +165,7 @@ discard block |
||
166 | 165 | <h1 class="page-header">You must <a href="'.$this->loginUrl.'?return='.$this->current_url().'">log in <span class="glyphicon glyphicon-log-in"></span></a> to access the '.$this->title.' Admin system!</h1> |
167 | 166 | </div> |
168 | 167 | </div>'; |
169 | - } |
|
170 | - else if($this->is_admin === false) |
|
168 | + } else if($this->is_admin === false) |
|
171 | 169 | { |
172 | 170 | $this->body = ' |
173 | 171 | <div class="row"> |
@@ -487,7 +487,6 @@ discard block |
||
487 | 487 | /** |
488 | 488 | * Add a Cascading Style Sheet file from its src URI |
489 | 489 | * |
490 | - * @param string $src The webpath to the Cascading Style Sheet file |
|
491 | 490 | * @param boolean $async Can the CSS be loaded asynchronously? |
492 | 491 | */ |
493 | 492 | public function addCSSByURI($uri, $async=false) |
@@ -514,6 +513,9 @@ discard block |
||
514 | 513 | $this->addWellKnownJS($type, $async); |
515 | 514 | } |
516 | 515 | |
516 | + /** |
|
517 | + * @param integer $type |
|
518 | + */ |
|
517 | 519 | function add_js($type, $async=true) |
518 | 520 | { |
519 | 521 | $this->addWellKnownJS($type, $async); |
@@ -582,6 +584,9 @@ discard block |
||
582 | 584 | return $ret; |
583 | 585 | } |
584 | 586 | |
587 | + /** |
|
588 | + * @return string |
|
589 | + */ |
|
585 | 590 | protected function getHrefForDropdown(&$link) |
586 | 591 | { |
587 | 592 | if(isset($link['_'])) |
@@ -685,7 +690,7 @@ discard block |
||
685 | 690 | * |
686 | 691 | * @param string $msg The message to show in the notifcation |
687 | 692 | * @param string $sev The severity of the notifcation |
688 | - * @param boolean $dismissible Can the user dismiss the notificaton? |
|
693 | + * @param integer $dismissible Can the user dismiss the notificaton? |
|
689 | 694 | * |
690 | 695 | * @deprecated 2.0.0 Use the addNotification function instead |
691 | 696 | */ |
@@ -699,7 +704,7 @@ discard block |
||
699 | 704 | * Add a notification to the page |
700 | 705 | * |
701 | 706 | * @param string $message The message to show in the notifcation |
702 | - * @param string $sevity The severity of the notifcation |
|
707 | + * @param string $severity The severity of the notifcation |
|
703 | 708 | * @param boolean $dismissible Can the user dismiss the notificaton? |
704 | 709 | * |
705 | 710 | * @deprecated 2.0.0 Use the addNotification function instead |
@@ -793,7 +798,6 @@ discard block |
||
793 | 798 | * Draw the page |
794 | 799 | * |
795 | 800 | * @param boolean $header Draw the header |
796 | - * @param boolean $analytics Include analytics on the page |
|
797 | 801 | */ |
798 | 802 | public function printPage($header=true) |
799 | 803 | { |
@@ -812,7 +816,7 @@ discard block |
||
812 | 816 | * |
813 | 817 | * @param string $name The name of the link |
814 | 818 | * @param false|string $url The URL to link to |
815 | - * @param false|array $subment Any submenu items for the dropdown |
|
819 | + * @param false|array $submenu Any submenu items for the dropdown |
|
816 | 820 | * |
817 | 821 | * @deprecated 1.0.0 Use addLink instead |
818 | 822 | */ |
@@ -826,7 +830,7 @@ discard block |
||
826 | 830 | * |
827 | 831 | * @param string $name The name of the link |
828 | 832 | * @param false|string $url The URL to link to |
829 | - * @param false|array $subment Any submenu items for the dropdown |
|
833 | + * @param false|array $submenu Any submenu items for the dropdown |
|
830 | 834 | */ |
831 | 835 | public function addLink($name, $url=false, $submenu=false) |
832 | 836 | { |
@@ -19,8 +19,7 @@ discard block |
||
19 | 19 | if(isset($GLOBALS['FLIPSIDE_SETTINGS_LOC'])) |
20 | 20 | { |
21 | 21 | require_once($GLOBALS['FLIPSIDE_SETTINGS_LOC'].'/class.FlipsideSettings.php'); |
22 | -} |
|
23 | -else |
|
22 | +} else |
|
24 | 23 | { |
25 | 24 | require_once('/var/www/secure_settings/class.FlipsideSettings.php'); |
26 | 25 | } |
@@ -404,8 +403,7 @@ discard block |
||
404 | 403 | { |
405 | 404 | $this->addLink('Login', $this->loginUrl); |
406 | 405 | } |
407 | - } |
|
408 | - else |
|
406 | + } else |
|
409 | 407 | { |
410 | 408 | $this->add_links(); |
411 | 409 | $this->addLink('Logout', $this->logoutUrl); |
@@ -423,7 +421,9 @@ discard block |
||
423 | 421 | */ |
424 | 422 | private function setupVars() |
425 | 423 | { |
426 | - if($this->minified !== null && $this->cdn !== null) return; |
|
424 | + if($this->minified !== null && $this->cdn !== null) { |
|
425 | + return; |
|
426 | + } |
|
427 | 427 | $this->minified = 'min'; |
428 | 428 | $this->cdn = 'cdn'; |
429 | 429 | if(isset(FlipsideSettings::$global)) |
@@ -834,8 +834,7 @@ discard block |
||
834 | 834 | { |
835 | 835 | $submenu['_'] = $url; |
836 | 836 | $this->links[$name] = $submenu; |
837 | - } |
|
838 | - else |
|
837 | + } else |
|
839 | 838 | { |
840 | 839 | $this->links[$name] = $url; |
841 | 840 | } |