@@ -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(); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $this->host = $this->getHostParam($params); |
93 | 93 | $this->user_base = $this->getParam($params, 'user_base'); |
94 | 94 | $this->group_base = $this->getParam($params, 'group_base'); |
95 | - $this->bind_dn = $this->getParam($params, 'bind_dn', '$ldap_auth', 'read_write_pass'); |
|
95 | + $this->bind_dn = $this->getParam($params, 'bind_dn', '$ldap_auth', 'read_write_pass'); |
|
96 | 96 | $this->bind_pass = $this->getParam($params, 'bind_pass', '$ldap_auth', 'read_write_user'); |
97 | 97 | } |
98 | 98 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | * |
131 | 131 | * @SuppressWarnings("StaticAccess") |
132 | 132 | */ |
133 | - private function getParam($params, $paramName, $settingsLocation='$ldap', $settingsName=false) |
|
133 | + private function getParam($params, $paramName, $settingsLocation = '$ldap', $settingsName = false) |
|
134 | 134 | { |
135 | 135 | if($settingsName === false) |
136 | 136 | { |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | * |
157 | 157 | * @SuppressWarnings("StaticAccess") |
158 | 158 | */ |
159 | - public function get_and_bind_server($bind_write=false) |
|
159 | + public function get_and_bind_server($bind_write = false) |
|
160 | 160 | { |
161 | 161 | $server = \LDAP\LDAPServer::getInstance(); |
162 | 162 | $server->user_base = $this->user_base; |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | return LDAPGroup::from_name($name, $server); |
247 | 247 | } |
248 | 248 | |
249 | - public function getGroupsByFilter($filter, $select=false, $top=false, $skip=false, $orderby=false) |
|
249 | + public function getGroupsByFilter($filter, $select = false, $top = false, $skip = false, $orderby = false) |
|
250 | 250 | { |
251 | 251 | $server = $this->get_and_bind_server(); |
252 | 252 | if($server === false) |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | } |
311 | 311 | } |
312 | 312 | |
313 | - public function getUsersByFilter($filter, $select=false, $top=false, $skip=false, $orderby=false) |
|
313 | + public function getUsersByFilter($filter, $select = false, $top = false, $skip = false, $orderby = false) |
|
314 | 314 | { |
315 | 315 | $server = $this->get_and_bind_server(); |
316 | 316 | if($server === false) |
@@ -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 | } |
@@ -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)) |
@@ -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 | } |
@@ -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 | { |
@@ -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 | { |
@@ -116,26 +116,26 @@ |
||
116 | 116 | |
117 | 117 | private function getDataTable($name, $pending=false) |
118 | 118 | { |
119 | - if(isset($this->dataTables[$name]) && isset($this->dataTables[$name][$pending])) |
|
120 | - { |
|
121 | - return $this->dataTables[$name][$pending]; |
|
122 | - } |
|
123 | - $dataSet = $this->dataSet; |
|
124 | - if($pending) |
|
125 | - { |
|
126 | - $dataSet = $this->pendingDataSet; |
|
127 | - } |
|
128 | - if($dataSet === null) |
|
129 | - { |
|
130 | - throw new \Exception('Unable to obtain dataset for SQL Authentication!'); |
|
131 | - } |
|
132 | - $dataTable = $dataSet[$name]; |
|
133 | - if(!isset($this->dataTables[$name])) |
|
134 | - { |
|
135 | - $this->dataTables[$name] = array(); |
|
136 | - } |
|
137 | - $this->dataTables[$name][$pending] = $dataTable; |
|
138 | - return $dataTable; |
|
119 | + if(isset($this->dataTables[$name]) && isset($this->dataTables[$name][$pending])) |
|
120 | + { |
|
121 | + return $this->dataTables[$name][$pending]; |
|
122 | + } |
|
123 | + $dataSet = $this->dataSet; |
|
124 | + if($pending) |
|
125 | + { |
|
126 | + $dataSet = $this->pendingDataSet; |
|
127 | + } |
|
128 | + if($dataSet === null) |
|
129 | + { |
|
130 | + throw new \Exception('Unable to obtain dataset for SQL Authentication!'); |
|
131 | + } |
|
132 | + $dataTable = $dataSet[$name]; |
|
133 | + if(!isset($this->dataTables[$name])) |
|
134 | + { |
|
135 | + $this->dataTables[$name] = array(); |
|
136 | + } |
|
137 | + $this->dataTables[$name][$pending] = $dataTable; |
|
138 | + return $dataTable; |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | private function getPendingUserDataTable() |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | } |
21 | 21 | if(!is_int($algo)) |
22 | 22 | { |
23 | - trigger_error("password_hash() expects parameter 2 to be long, " . gettype($algo) . " given", E_USER_WARNING); |
|
23 | + trigger_error("password_hash() expects parameter 2 to be long, ".gettype($algo)." given", E_USER_WARNING); |
|
24 | 24 | return false; |
25 | 25 | } |
26 | 26 | $resultLength = 0; |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | $base64String = base64_encode($salt); |
44 | 44 | $salt = strtr(rtrim($base64String, '='), $base64Digits, $bcrypt64Digits); |
45 | 45 | $salt = substr($salt, 0, $requiredSaltLen); |
46 | - $hash = $hashFormat . $salt; |
|
46 | + $hash = $hashFormat.$salt; |
|
47 | 47 | $ret = crypt($password, $hash); |
48 | 48 | if(!is_string($ret) || strlen($ret) != $resultLength) |
49 | 49 | { |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | return \DataSetFactory::getDataSetByName('pending_authentication'); |
115 | 115 | } |
116 | 116 | |
117 | - private function getDataTable($name, $pending=false) |
|
117 | + private function getDataTable($name, $pending = false) |
|
118 | 118 | { |
119 | 119 | if(isset($this->dataTables[$name]) && isset($this->dataTables[$name][$pending])) |
120 | 120 | { |
@@ -227,12 +227,12 @@ discard block |
||
227 | 227 | return $data; |
228 | 228 | } |
229 | 229 | |
230 | - public function getGroupsByFilter($filter, $select=false, $top=false, $skip=false, $orderby=false) |
|
230 | + public function getGroupsByFilter($filter, $select = false, $top = false, $skip = false, $orderby = false) |
|
231 | 231 | { |
232 | 232 | return $this->convertDataToClass('group', 'SQLGroup', $filter, $select, $top, $skip, $orderby); |
233 | 233 | } |
234 | 234 | |
235 | - public function getUsersByFilter($filter, $select=false, $top=false, $skip=false, $orderby=false) |
|
235 | + public function getUsersByFilter($filter, $select = false, $top = false, $skip = false, $orderby = false) |
|
236 | 236 | { |
237 | 237 | return $this->convertDataToClass('group', 'SQLUser', $filter, $select, $top, $skip, $orderby); |
238 | 238 | } |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | { |
250 | 250 | $userDataTable = $this->getPendingUserDataTable(); |
251 | 251 | $fieldData = $filter->to_mongo_filter(); |
252 | - $firstFilter = new \Data\Filter('substringof(data,"'.implode($fieldData,' ').'")'); |
|
252 | + $firstFilter = new \Data\Filter('substringof(data,"'.implode($fieldData, ' ').'")'); |
|
253 | 253 | $users = $userDataTable->read($firstFilter, $select, $top, $skip, $orderby); |
254 | 254 | if($users === false) |
255 | 255 | { |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | return $ret; |
277 | 277 | } |
278 | 278 | |
279 | - public function getPendingUsersByFilter($filter, $select=false, $top=false, $skip=false, $orderby=false) |
|
279 | + public function getPendingUsersByFilter($filter, $select = false, $top = false, $skip = false, $orderby = false) |
|
280 | 280 | |
281 | 281 | { |
282 | 282 | if($this->pending === false) return false; |
@@ -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 | { |
@@ -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) |
@@ -16,7 +16,7 @@ |
||
16 | 16 | /** Only load the HTTPFul bootstrap if it isn't already loaded*/ |
17 | 17 | if(!class_exists('Httpful\Request')) |
18 | 18 | { |
19 | - require dirname(__FILE__) . '/../../libs/httpful/bootstrap.php'; |
|
19 | + require dirname(__FILE__).'/../../libs/httpful/bootstrap.php'; |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | /** |
@@ -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 | */ |
@@ -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) |
@@ -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 | { |
@@ -59,239 +59,239 @@ |
||
59 | 59 | |
60 | 60 | global $jsArray; |
61 | 61 | $jsArray = array( |
62 | - JS_JQUERY => array( |
|
63 | - 'no' => array( |
|
64 | - 'no' => '/js/common/jquery.js', |
|
65 | - 'min' => '/js/common/jquery.min.js' |
|
66 | - ), |
|
67 | - 'cdn' => array( |
|
68 | - 'no' => '//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.js', |
|
69 | - 'min' => '//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js' |
|
70 | - ) |
|
71 | - ), |
|
72 | - JS_JQUERY_UI => array( |
|
73 | - 'no' => array( |
|
74 | - 'no' => '/js/common/jquery-ui.js', |
|
75 | - 'min' => '/js/common/jquery-ui.min.js' |
|
76 | - ), |
|
77 | - 'cdn' => array( |
|
78 | - 'no' => '//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.js', |
|
79 | - 'min' => '//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js' |
|
80 | - ) |
|
81 | - ), |
|
82 | - JS_BOOTSTRAP => array( |
|
83 | - 'no' => array( |
|
84 | - 'no' => '/js/common/bootstrap.js', |
|
85 | - 'min' => '/js/common/bootstrap.min.js' |
|
86 | - ), |
|
87 | - 'cdn' => array( |
|
88 | - 'no' => '//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.js', |
|
89 | - 'min' => '//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js' |
|
90 | - ) |
|
91 | - ), |
|
92 | - JQUERY_VALIDATE => array( |
|
93 | - 'no' => array( |
|
94 | - 'no' => '/js/common/jquery.validate.js', |
|
95 | - 'min' => '/js/common/jquery.validate.min.js' |
|
96 | - ), |
|
97 | - 'cdn' => array( |
|
98 | - 'no' => '//ajax.aspnetcdn.com/ajax/jquery.validate/1.13.1/jquery.validate.js', |
|
99 | - 'min' => '//ajax.aspnetcdn.com/ajax/jquery.validate/1.13.1/jquery.validate.min.js' |
|
100 | - ) |
|
101 | - ), |
|
102 | - JQUERY_TOUCH => array( |
|
103 | - 'no' => array( |
|
104 | - 'no' => '/js/common/jquery.ui.touch-punch.min.js', |
|
105 | - 'min' => '/js/common/jquery.ui.touch-punch.min.js' |
|
106 | - ), |
|
107 | - 'cdn' => array( |
|
108 | - 'no' => '//cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.3/jquery.ui.touch-punch.min.js', |
|
109 | - 'min' => '//cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.3/jquery.ui.touch-punch.min.js' |
|
110 | - ) |
|
111 | - ), |
|
112 | - JS_TINYNAV => array( |
|
113 | - 'no' => array( |
|
114 | - 'no' => '/js/common/tinynav.js', |
|
115 | - 'min' => '/js/common/tinynav.min.js' |
|
116 | - ), |
|
117 | - 'cdn' => array( |
|
118 | - 'no' => '//cdnjs.cloudflare.com/ajax/libs/TinyNav.js/1.2.0/tinynav.js', |
|
119 | - 'min' => '//cdnjs.cloudflare.com/ajax/libs/TinyNav.js/1.2.0/tinynav.min.js' |
|
120 | - ) |
|
121 | - ), |
|
122 | - JS_BOOTSTRAP_FH => array( |
|
123 | - 'no' => array( |
|
124 | - 'no' => '/js/common/bootstrap-formhelpers.js', |
|
125 | - 'min' => '/js/common/bootstrap-formhelpers.min.js' |
|
126 | - ), |
|
127 | - 'cdn' => array( |
|
128 | - 'no' => '//cdnjs.cloudflare.com/ajax/libs/bootstrap-formhelpers/2.3.0/js/bootstrap-formhelpers.js', |
|
129 | - 'min' => '//cdnjs.cloudflare.com/ajax/libs/bootstrap-formhelpers/2.3.0/js/bootstrap-formhelpers.min.js' |
|
130 | - ) |
|
131 | - ), |
|
132 | - JS_BOOTSTRAP_SW => array( |
|
133 | - 'no' => array( |
|
134 | - 'no' => '/js/common/bootstrap-switch.js', |
|
135 | - 'min' => '/js/common/bootstrap-switch.min.js' |
|
136 | - ), |
|
137 | - 'cdn' => array( |
|
138 | - 'no' => '//cdnjs.cloudflare.com/ajax/libs/bootstrap-switch/3.3.2/js/bootstrap-switch.js', |
|
139 | - 'min' => '//cdnjs.cloudflare.com/ajax/libs/bootstrap-switch/3.3.2/js/bootstrap-switch.min.js' |
|
140 | - ) |
|
141 | - ), |
|
142 | - JS_DATATABLE => array( |
|
143 | - 'no' => array( |
|
144 | - 'no' => '/js/common/jquery.dataTables.js', |
|
145 | - 'min' => '/js/common/jquery.dataTables.min.js' |
|
146 | - ), |
|
147 | - 'cdn' => array( |
|
148 | - 'no' => '//cdn.datatables.net/1.10.7/js/jquery.dataTables.js', |
|
149 | - 'min' => '//cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js' |
|
150 | - ) |
|
151 | - ), |
|
152 | - JS_CHART => array( |
|
153 | - 'no' => array( |
|
154 | - 'no' => '/js/common/Chart.js', |
|
155 | - 'min' => '/js/common/Chart.min.js' |
|
156 | - ), |
|
157 | - 'cdn' => array( |
|
158 | - 'no' => '//cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.js', |
|
159 | - 'min' => '//cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js' |
|
160 | - ) |
|
161 | - ), |
|
162 | - JS_METISMENU => array( |
|
163 | - 'no' => array( |
|
164 | - 'no' => '/js/common/metisMenu.js', |
|
165 | - 'min' => '/js/common/metisMenu.min.js' |
|
166 | - ), |
|
167 | - 'cdn' => array( |
|
168 | - 'no' => '//cdnjs.cloudflare.com/ajax/libs/metisMenu/2.0.2/metisMenu.js', |
|
169 | - 'min' => '//cdnjs.cloudflare.com/ajax/libs/metisMenu/2.0.2/metisMenu.min.js' |
|
170 | - ) |
|
171 | - ), |
|
172 | - JS_BOOTBOX => array( |
|
173 | - 'no' => array( |
|
174 | - 'no' => '/js/common/bootbox.js', |
|
175 | - 'min' => '/js/common/bootbox.min.js' |
|
176 | - ), |
|
177 | - 'cdn' => array( |
|
178 | - 'no' => '//cdnjs.cloudflare.com/ajax/libs/bootbox.js/4.3.0/bootbox.js', |
|
179 | - 'min' => '//cdnjs.cloudflare.com/ajax/libs/bootbox.js/4.3.0/bootbox.min.js' |
|
180 | - ) |
|
181 | - ), |
|
182 | - JS_DATATABLE_ODATA => array( |
|
183 | - 'no' => array( |
|
184 | - 'no' => '/js/common/jquery.dataTables.odata.js', |
|
185 | - 'min' => '/js/common/jquery.dataTables.odata.js', |
|
186 | - ), |
|
187 | - 'cdn' => array( |
|
188 | - 'no' => '/js/common/jquery.dataTables.odata.js', |
|
189 | - 'min' => '/js/common/jquery.dataTables.odata.js', |
|
190 | - ) |
|
191 | - ), |
|
192 | - JS_CRYPTO_MD5_JS => array( |
|
193 | - 'no' => array( |
|
194 | - 'no' => '/js/common/md5.js', |
|
195 | - 'min' => '/js/common/md5.js', |
|
196 | - ), |
|
197 | - 'cdn' => array( |
|
198 | - 'no' => '//cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/md5.js', |
|
199 | - 'min' => '//cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/md5.js', |
|
200 | - ) |
|
201 | - ), |
|
202 | - JS_JCROP => array( |
|
203 | - 'no' => array( |
|
204 | - 'no' => '/js/common/jquery.Jcrop.min.js', |
|
205 | - 'min' => '/js/common/jquery.Jcrop.min.js' |
|
206 | - ), |
|
207 | - 'cdn' => array( |
|
208 | - 'no' => '//cdnjs.cloudflare.com/ajax/libs/jquery-jcrop/0.9.12/js/jquery.Jcrop.min.js', |
|
209 | - 'min' => '//cdnjs.cloudflare.com/ajax/libs/jquery-jcrop/0.9.12/js/jquery.Jcrop.min.js' |
|
210 | - ) |
|
211 | - ), |
|
212 | - JS_TYPEAHEAD => array( |
|
213 | - 'no' => array( |
|
214 | - 'no' => '/js/common/typeahead.bundle.js', |
|
215 | - 'min' => '/js/common/typeahead.bundle.min.js' |
|
216 | - ), |
|
217 | - 'cdn' => array( |
|
218 | - 'no' => '//cdnjs.cloudflare.com/ajax/libs/typeahead.js/0.11.1/typeahead.bundle.js', |
|
219 | - 'min' => '//cdnjs.cloudflare.com/ajax/libs/typeahead.js/0.11.1/typeahead.bundle.min.js' |
|
220 | - ) |
|
221 | - ), |
|
222 | - JS_FLIPSIDE => array( |
|
223 | - 'no' => array( |
|
224 | - 'no' => '/js/common/flipside.js', |
|
225 | - 'min' => '/js/common/flipside.min.js' |
|
226 | - ), |
|
227 | - 'cdn' => array( |
|
228 | - 'no' => '/js/common/flipside.js', |
|
229 | - 'min' => '/js/common/flipside.min.js' |
|
230 | - ) |
|
231 | - ), |
|
232 | - JS_LOGIN => array( |
|
233 | - 'no' => array( |
|
234 | - 'no' => '/js/common/login.js', |
|
235 | - 'min' => '/js/common/login.min.js' |
|
236 | - ), |
|
237 | - 'cdn' => array( |
|
238 | - 'no' => '/js/common/login.js', |
|
239 | - 'min' => '/js/common/login.min.js' |
|
240 | - ) |
|
241 | - ) |
|
62 | + JS_JQUERY => array( |
|
63 | + 'no' => array( |
|
64 | + 'no' => '/js/common/jquery.js', |
|
65 | + 'min' => '/js/common/jquery.min.js' |
|
66 | + ), |
|
67 | + 'cdn' => array( |
|
68 | + 'no' => '//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.js', |
|
69 | + 'min' => '//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js' |
|
70 | + ) |
|
71 | + ), |
|
72 | + JS_JQUERY_UI => array( |
|
73 | + 'no' => array( |
|
74 | + 'no' => '/js/common/jquery-ui.js', |
|
75 | + 'min' => '/js/common/jquery-ui.min.js' |
|
76 | + ), |
|
77 | + 'cdn' => array( |
|
78 | + 'no' => '//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.js', |
|
79 | + 'min' => '//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js' |
|
80 | + ) |
|
81 | + ), |
|
82 | + JS_BOOTSTRAP => array( |
|
83 | + 'no' => array( |
|
84 | + 'no' => '/js/common/bootstrap.js', |
|
85 | + 'min' => '/js/common/bootstrap.min.js' |
|
86 | + ), |
|
87 | + 'cdn' => array( |
|
88 | + 'no' => '//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.js', |
|
89 | + 'min' => '//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js' |
|
90 | + ) |
|
91 | + ), |
|
92 | + JQUERY_VALIDATE => array( |
|
93 | + 'no' => array( |
|
94 | + 'no' => '/js/common/jquery.validate.js', |
|
95 | + 'min' => '/js/common/jquery.validate.min.js' |
|
96 | + ), |
|
97 | + 'cdn' => array( |
|
98 | + 'no' => '//ajax.aspnetcdn.com/ajax/jquery.validate/1.13.1/jquery.validate.js', |
|
99 | + 'min' => '//ajax.aspnetcdn.com/ajax/jquery.validate/1.13.1/jquery.validate.min.js' |
|
100 | + ) |
|
101 | + ), |
|
102 | + JQUERY_TOUCH => array( |
|
103 | + 'no' => array( |
|
104 | + 'no' => '/js/common/jquery.ui.touch-punch.min.js', |
|
105 | + 'min' => '/js/common/jquery.ui.touch-punch.min.js' |
|
106 | + ), |
|
107 | + 'cdn' => array( |
|
108 | + 'no' => '//cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.3/jquery.ui.touch-punch.min.js', |
|
109 | + 'min' => '//cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.3/jquery.ui.touch-punch.min.js' |
|
110 | + ) |
|
111 | + ), |
|
112 | + JS_TINYNAV => array( |
|
113 | + 'no' => array( |
|
114 | + 'no' => '/js/common/tinynav.js', |
|
115 | + 'min' => '/js/common/tinynav.min.js' |
|
116 | + ), |
|
117 | + 'cdn' => array( |
|
118 | + 'no' => '//cdnjs.cloudflare.com/ajax/libs/TinyNav.js/1.2.0/tinynav.js', |
|
119 | + 'min' => '//cdnjs.cloudflare.com/ajax/libs/TinyNav.js/1.2.0/tinynav.min.js' |
|
120 | + ) |
|
121 | + ), |
|
122 | + JS_BOOTSTRAP_FH => array( |
|
123 | + 'no' => array( |
|
124 | + 'no' => '/js/common/bootstrap-formhelpers.js', |
|
125 | + 'min' => '/js/common/bootstrap-formhelpers.min.js' |
|
126 | + ), |
|
127 | + 'cdn' => array( |
|
128 | + 'no' => '//cdnjs.cloudflare.com/ajax/libs/bootstrap-formhelpers/2.3.0/js/bootstrap-formhelpers.js', |
|
129 | + 'min' => '//cdnjs.cloudflare.com/ajax/libs/bootstrap-formhelpers/2.3.0/js/bootstrap-formhelpers.min.js' |
|
130 | + ) |
|
131 | + ), |
|
132 | + JS_BOOTSTRAP_SW => array( |
|
133 | + 'no' => array( |
|
134 | + 'no' => '/js/common/bootstrap-switch.js', |
|
135 | + 'min' => '/js/common/bootstrap-switch.min.js' |
|
136 | + ), |
|
137 | + 'cdn' => array( |
|
138 | + 'no' => '//cdnjs.cloudflare.com/ajax/libs/bootstrap-switch/3.3.2/js/bootstrap-switch.js', |
|
139 | + 'min' => '//cdnjs.cloudflare.com/ajax/libs/bootstrap-switch/3.3.2/js/bootstrap-switch.min.js' |
|
140 | + ) |
|
141 | + ), |
|
142 | + JS_DATATABLE => array( |
|
143 | + 'no' => array( |
|
144 | + 'no' => '/js/common/jquery.dataTables.js', |
|
145 | + 'min' => '/js/common/jquery.dataTables.min.js' |
|
146 | + ), |
|
147 | + 'cdn' => array( |
|
148 | + 'no' => '//cdn.datatables.net/1.10.7/js/jquery.dataTables.js', |
|
149 | + 'min' => '//cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js' |
|
150 | + ) |
|
151 | + ), |
|
152 | + JS_CHART => array( |
|
153 | + 'no' => array( |
|
154 | + 'no' => '/js/common/Chart.js', |
|
155 | + 'min' => '/js/common/Chart.min.js' |
|
156 | + ), |
|
157 | + 'cdn' => array( |
|
158 | + 'no' => '//cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.js', |
|
159 | + 'min' => '//cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js' |
|
160 | + ) |
|
161 | + ), |
|
162 | + JS_METISMENU => array( |
|
163 | + 'no' => array( |
|
164 | + 'no' => '/js/common/metisMenu.js', |
|
165 | + 'min' => '/js/common/metisMenu.min.js' |
|
166 | + ), |
|
167 | + 'cdn' => array( |
|
168 | + 'no' => '//cdnjs.cloudflare.com/ajax/libs/metisMenu/2.0.2/metisMenu.js', |
|
169 | + 'min' => '//cdnjs.cloudflare.com/ajax/libs/metisMenu/2.0.2/metisMenu.min.js' |
|
170 | + ) |
|
171 | + ), |
|
172 | + JS_BOOTBOX => array( |
|
173 | + 'no' => array( |
|
174 | + 'no' => '/js/common/bootbox.js', |
|
175 | + 'min' => '/js/common/bootbox.min.js' |
|
176 | + ), |
|
177 | + 'cdn' => array( |
|
178 | + 'no' => '//cdnjs.cloudflare.com/ajax/libs/bootbox.js/4.3.0/bootbox.js', |
|
179 | + 'min' => '//cdnjs.cloudflare.com/ajax/libs/bootbox.js/4.3.0/bootbox.min.js' |
|
180 | + ) |
|
181 | + ), |
|
182 | + JS_DATATABLE_ODATA => array( |
|
183 | + 'no' => array( |
|
184 | + 'no' => '/js/common/jquery.dataTables.odata.js', |
|
185 | + 'min' => '/js/common/jquery.dataTables.odata.js', |
|
186 | + ), |
|
187 | + 'cdn' => array( |
|
188 | + 'no' => '/js/common/jquery.dataTables.odata.js', |
|
189 | + 'min' => '/js/common/jquery.dataTables.odata.js', |
|
190 | + ) |
|
191 | + ), |
|
192 | + JS_CRYPTO_MD5_JS => array( |
|
193 | + 'no' => array( |
|
194 | + 'no' => '/js/common/md5.js', |
|
195 | + 'min' => '/js/common/md5.js', |
|
196 | + ), |
|
197 | + 'cdn' => array( |
|
198 | + 'no' => '//cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/md5.js', |
|
199 | + 'min' => '//cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/md5.js', |
|
200 | + ) |
|
201 | + ), |
|
202 | + JS_JCROP => array( |
|
203 | + 'no' => array( |
|
204 | + 'no' => '/js/common/jquery.Jcrop.min.js', |
|
205 | + 'min' => '/js/common/jquery.Jcrop.min.js' |
|
206 | + ), |
|
207 | + 'cdn' => array( |
|
208 | + 'no' => '//cdnjs.cloudflare.com/ajax/libs/jquery-jcrop/0.9.12/js/jquery.Jcrop.min.js', |
|
209 | + 'min' => '//cdnjs.cloudflare.com/ajax/libs/jquery-jcrop/0.9.12/js/jquery.Jcrop.min.js' |
|
210 | + ) |
|
211 | + ), |
|
212 | + JS_TYPEAHEAD => array( |
|
213 | + 'no' => array( |
|
214 | + 'no' => '/js/common/typeahead.bundle.js', |
|
215 | + 'min' => '/js/common/typeahead.bundle.min.js' |
|
216 | + ), |
|
217 | + 'cdn' => array( |
|
218 | + 'no' => '//cdnjs.cloudflare.com/ajax/libs/typeahead.js/0.11.1/typeahead.bundle.js', |
|
219 | + 'min' => '//cdnjs.cloudflare.com/ajax/libs/typeahead.js/0.11.1/typeahead.bundle.min.js' |
|
220 | + ) |
|
221 | + ), |
|
222 | + JS_FLIPSIDE => array( |
|
223 | + 'no' => array( |
|
224 | + 'no' => '/js/common/flipside.js', |
|
225 | + 'min' => '/js/common/flipside.min.js' |
|
226 | + ), |
|
227 | + 'cdn' => array( |
|
228 | + 'no' => '/js/common/flipside.js', |
|
229 | + 'min' => '/js/common/flipside.min.js' |
|
230 | + ) |
|
231 | + ), |
|
232 | + JS_LOGIN => array( |
|
233 | + 'no' => array( |
|
234 | + 'no' => '/js/common/login.js', |
|
235 | + 'min' => '/js/common/login.min.js' |
|
236 | + ), |
|
237 | + 'cdn' => array( |
|
238 | + 'no' => '/js/common/login.js', |
|
239 | + 'min' => '/js/common/login.min.js' |
|
240 | + ) |
|
241 | + ) |
|
242 | 242 | ); |
243 | 243 | |
244 | 244 | global $cssArray; |
245 | 245 | $cssArray = array( |
246 | 246 | CSS_JQUERY_UI => array( |
247 | 247 | 'no' => array( |
248 | - 'no' => '/css/common/jquery-ui.css', |
|
249 | - 'min' => '/css/common/jquery-ui.min.css' |
|
250 | - ), |
|
251 | - 'cdn' => array( |
|
252 | - 'no' => '//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css', |
|
253 | - 'min' => '//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.min.css' |
|
254 | - ) |
|
248 | + 'no' => '/css/common/jquery-ui.css', |
|
249 | + 'min' => '/css/common/jquery-ui.min.css' |
|
250 | + ), |
|
251 | + 'cdn' => array( |
|
252 | + 'no' => '//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css', |
|
253 | + 'min' => '//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.min.css' |
|
254 | + ) |
|
255 | 255 | ), |
256 | 256 | CSS_BOOTSTRAP => array( |
257 | - 'no' => array( |
|
258 | - 'no' => '/css/common/bootstrap.css', |
|
259 | - 'min' => '/css/common/bootstrap.min.css' |
|
260 | - ), |
|
261 | - 'cdn' => array( |
|
262 | - 'no' => '//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.css', |
|
263 | - 'min' => '//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css' |
|
264 | - ) |
|
257 | + 'no' => array( |
|
258 | + 'no' => '/css/common/bootstrap.css', |
|
259 | + 'min' => '/css/common/bootstrap.min.css' |
|
260 | + ), |
|
261 | + 'cdn' => array( |
|
262 | + 'no' => '//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.css', |
|
263 | + 'min' => '//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css' |
|
264 | + ) |
|
265 | 265 | ), |
266 | 266 | CSS_BOOTSTRAP_FH => array( |
267 | 267 | 'no' => array( |
268 | - 'no' => '/css/common/bootstrap-formhelpers.css', |
|
269 | - 'min' => '/css/common/bootstrap-formhelpers.min.css' |
|
270 | - ), |
|
271 | - 'cdn' => array( |
|
272 | - 'no' => '//cdnjs.cloudflare.com/ajax/libs/bootstrap-formhelpers/2.3.0/css/bootstrap-formhelpers.css', |
|
273 | - 'min' => '//cdnjs.cloudflare.com/ajax/libs/bootstrap-formhelpers/2.3.0/css/bootstrap-formhelpers.min.css' |
|
274 | - ) |
|
268 | + 'no' => '/css/common/bootstrap-formhelpers.css', |
|
269 | + 'min' => '/css/common/bootstrap-formhelpers.min.css' |
|
270 | + ), |
|
271 | + 'cdn' => array( |
|
272 | + 'no' => '//cdnjs.cloudflare.com/ajax/libs/bootstrap-formhelpers/2.3.0/css/bootstrap-formhelpers.css', |
|
273 | + 'min' => '//cdnjs.cloudflare.com/ajax/libs/bootstrap-formhelpers/2.3.0/css/bootstrap-formhelpers.min.css' |
|
274 | + ) |
|
275 | 275 | ), |
276 | 276 | CSS_BOOTSTRAP_SW => array( |
277 | - 'no' => array( |
|
278 | - 'no' => '/css/common/bootstrap-switch.css', |
|
279 | - 'min' => '/css/common/bootstrap-switch.min.css' |
|
280 | - ), |
|
281 | - 'cdn' => array( |
|
282 | - 'no' => '//cdnjs.cloudflare.com/ajax/libs/bootstrap-switch/3.3.2/css/bootstrap3/bootstrap-switch.css', |
|
283 | - 'min' => '//cdnjs.cloudflare.com/ajax/libs/bootstrap-switch/3.3.2/css/bootstrap3/bootstrap-switch.min.css' |
|
284 | - ) |
|
277 | + 'no' => array( |
|
278 | + 'no' => '/css/common/bootstrap-switch.css', |
|
279 | + 'min' => '/css/common/bootstrap-switch.min.css' |
|
280 | + ), |
|
281 | + 'cdn' => array( |
|
282 | + 'no' => '//cdnjs.cloudflare.com/ajax/libs/bootstrap-switch/3.3.2/css/bootstrap3/bootstrap-switch.css', |
|
283 | + 'min' => '//cdnjs.cloudflare.com/ajax/libs/bootstrap-switch/3.3.2/css/bootstrap3/bootstrap-switch.min.css' |
|
284 | + ) |
|
285 | 285 | ), |
286 | 286 | CSS_DATATABLE => array( |
287 | 287 | 'no' => array( |
288 | - 'no' => '/css/common/jquery.dataTables.css', |
|
289 | - 'min' => '/css/common/jquery.dataTables.min.css' |
|
290 | - ), |
|
291 | - 'cdn' => array( |
|
292 | - 'no' => '//cdn.datatables.net/1.10.7/css/jquery.dataTables.css', |
|
293 | - 'min' => '//cdn.datatables.net/1.10.7/css/jquery.dataTables.min.css' |
|
294 | - ) |
|
288 | + 'no' => '/css/common/jquery.dataTables.css', |
|
289 | + 'min' => '/css/common/jquery.dataTables.min.css' |
|
290 | + ), |
|
291 | + 'cdn' => array( |
|
292 | + 'no' => '//cdn.datatables.net/1.10.7/css/jquery.dataTables.css', |
|
293 | + 'min' => '//cdn.datatables.net/1.10.7/css/jquery.dataTables.min.css' |
|
294 | + ) |
|
295 | 295 | ), |
296 | 296 | CSS_JCROP => array( |
297 | 297 | 'no' => array( |
@@ -30,32 +30,32 @@ discard block |
||
30 | 30 | */ |
31 | 31 | require_once('class.WebPage.php'); |
32 | 32 | |
33 | -define('JS_JQUERY', 0); |
|
34 | -define('JS_JQUERY_UI', 1); |
|
35 | -define('JS_BOOTSTRAP', 2); |
|
33 | +define('JS_JQUERY', 0); |
|
34 | +define('JS_JQUERY_UI', 1); |
|
35 | +define('JS_BOOTSTRAP', 2); |
|
36 | 36 | define('JQUERY_VALIDATE', 3); |
37 | -define('JQUERY_TOUCH', 4); |
|
38 | -define('JS_TINYNAV', 5); |
|
37 | +define('JQUERY_TOUCH', 4); |
|
38 | +define('JS_TINYNAV', 5); |
|
39 | 39 | define('JS_BOOTSTRAP_FH', 6); |
40 | 40 | define('JS_BOOTSTRAP_SW', 7); |
41 | -define('JS_DATATABLE', 8); |
|
42 | -define('JS_CHART', 9); |
|
43 | -define('JS_METISMENU', 10); |
|
44 | -define('JS_BOOTBOX', 11); |
|
41 | +define('JS_DATATABLE', 8); |
|
42 | +define('JS_CHART', 9); |
|
43 | +define('JS_METISMENU', 10); |
|
44 | +define('JS_BOOTBOX', 11); |
|
45 | 45 | define('JS_DATATABLE_ODATA', 12); |
46 | -define('JS_CRYPTO_MD5_JS', 13); |
|
47 | -define('JS_JCROP', 14); |
|
48 | -define('JS_TYPEAHEAD', 15); |
|
49 | -define('JS_FLIPSIDE', 20); |
|
50 | -define('JS_LOGIN', 21); |
|
51 | - |
|
52 | -define('CSS_JQUERY_UI', 0); |
|
53 | -define('CSS_BOOTSTRAP', 1); |
|
46 | +define('JS_CRYPTO_MD5_JS', 13); |
|
47 | +define('JS_JCROP', 14); |
|
48 | +define('JS_TYPEAHEAD', 15); |
|
49 | +define('JS_FLIPSIDE', 20); |
|
50 | +define('JS_LOGIN', 21); |
|
51 | + |
|
52 | +define('CSS_JQUERY_UI', 0); |
|
53 | +define('CSS_BOOTSTRAP', 1); |
|
54 | 54 | define('CSS_BOOTSTRAP_FH', 2); |
55 | 55 | define('CSS_BOOTSTRAP_SW', 3); |
56 | -define('CSS_DATATABLE', 4); |
|
57 | -define('CSS_JCROP', 5); |
|
58 | -define('CSS_FONTAWESOME', 6); |
|
56 | +define('CSS_DATATABLE', 4); |
|
57 | +define('CSS_JCROP', 5); |
|
58 | +define('CSS_FONTAWESOME', 6); |
|
59 | 59 | |
60 | 60 | global $jsArray; |
61 | 61 | $jsArray = array( |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | * |
350 | 350 | * @SuppressWarnings("StaticAccess") |
351 | 351 | */ |
352 | - function __construct($title, $header=true) |
|
352 | + function __construct($title, $header = true) |
|
353 | 353 | { |
354 | 354 | parent::__construct($title); |
355 | 355 | $this->setupVars(); |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | * |
448 | 448 | * @deprecated 2.0.0 Please use addJSByURI() instead |
449 | 449 | */ |
450 | - function add_js_from_src($src, $async=true) |
|
450 | + function add_js_from_src($src, $async = true) |
|
451 | 451 | { |
452 | 452 | $this->addJSByURI($src, $async); |
453 | 453 | } |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | * @param string $uri The webpath to the JavaScript file |
459 | 459 | * @param boolean $async Can the JavaScript be loaded asynchronously? |
460 | 460 | */ |
461 | - public function addJSByURI($uri, $async=true) |
|
461 | + public function addJSByURI($uri, $async = true) |
|
462 | 462 | { |
463 | 463 | $attributes = array('src'=>$uri, 'type'=>'text/javascript'); |
464 | 464 | if($async === true) |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | * |
480 | 480 | * @deprecated 2.0.0 Please use addCSSByURI() instead |
481 | 481 | */ |
482 | - function add_css_from_src($src, $import=false) |
|
482 | + function add_css_from_src($src, $import = false) |
|
483 | 483 | { |
484 | 484 | $this->addCSSByURI($src, $import); |
485 | 485 | } |
@@ -490,7 +490,7 @@ discard block |
||
490 | 490 | * @param string $src The webpath to the Cascading Style Sheet file |
491 | 491 | * @param boolean $async Can the CSS be loaded asynchronously? |
492 | 492 | */ |
493 | - public function addCSSByURI($uri, $async=false) |
|
493 | + public function addCSSByURI($uri, $async = false) |
|
494 | 494 | { |
495 | 495 | $attributes = array('rel'=>'stylesheet', 'href'=>$uri, 'type'=>'text/css'); |
496 | 496 | if($async === true && $this->importSupport === true) |
@@ -509,12 +509,12 @@ discard block |
||
509 | 509 | * |
510 | 510 | * @deprecated 2.0.0 Please use addWellKnownJS() instead |
511 | 511 | */ |
512 | - function addJS($type, $async=true) |
|
512 | + function addJS($type, $async = true) |
|
513 | 513 | { |
514 | 514 | $this->addWellKnownJS($type, $async); |
515 | 515 | } |
516 | 516 | |
517 | - function add_js($type, $async=true) |
|
517 | + function add_js($type, $async = true) |
|
518 | 518 | { |
519 | 519 | $this->addWellKnownJS($type, $async); |
520 | 520 | } |
@@ -525,7 +525,7 @@ discard block |
||
525 | 525 | * @param string $jsFileID the ID of the JS file |
526 | 526 | * @param boolean $async Can the JS file be loaded asynchronously? |
527 | 527 | */ |
528 | - public function addWellKnownJS($jsFileID, $async=true) |
|
528 | + public function addWellKnownJS($jsFileID, $async = true) |
|
529 | 529 | { |
530 | 530 | global $jsArray; |
531 | 531 | $this->setupVars(); |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | * |
542 | 542 | * @deprecated 2.0.0 Please use addWellKnownCSS() instead |
543 | 543 | */ |
544 | - function add_css($type, $import=false) |
|
544 | + function add_css($type, $import = false) |
|
545 | 545 | { |
546 | 546 | $this->addWellKnownCSS($type, $import); |
547 | 547 | } |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | * @param string $cssFileID the ID of the CSS file |
553 | 553 | * @param boolean $async Can the CSS file be loaded asynchronously? |
554 | 554 | */ |
555 | - public function addWellKnownCSS($cssFileID, $async=true) |
|
555 | + public function addWellKnownCSS($cssFileID, $async = true) |
|
556 | 556 | { |
557 | 557 | global $cssArray; |
558 | 558 | $this->setupVars(); |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | $ret = ''; |
578 | 578 | foreach($names as $name) |
579 | 579 | { |
580 | - $ret.='<li>'.$this->createLink($name, $sites[$name]).'</li>'; |
|
580 | + $ret .= '<li>'.$this->createLink($name, $sites[$name]).'</li>'; |
|
581 | 581 | } |
582 | 582 | return $ret; |
583 | 583 | } |
@@ -597,14 +597,14 @@ discard block |
||
597 | 597 | { |
598 | 598 | $ret = '<li class="dropdown">'; |
599 | 599 | $href = $this->getHrefForDropdown($link); |
600 | - $ret.= '<a href="'.$href.'" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">'.$name.' <span class="caret"></span></a>'; |
|
601 | - $ret.='<ul class="dropdown-menu">'; |
|
600 | + $ret .= '<a href="'.$href.'" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">'.$name.' <span class="caret"></span></a>'; |
|
601 | + $ret .= '<ul class="dropdown-menu">'; |
|
602 | 602 | $subNames = array_keys($link); |
603 | 603 | foreach($subNames as $subName) |
604 | 604 | { |
605 | - $ret.=$this->getLinkByName($subName, $link); |
|
605 | + $ret .= $this->getLinkByName($subName, $link); |
|
606 | 606 | } |
607 | - $ret.='</ul></li>'; |
|
607 | + $ret .= '</ul></li>'; |
|
608 | 608 | return $ret; |
609 | 609 | } |
610 | 610 | |
@@ -627,7 +627,7 @@ discard block |
||
627 | 627 | $ret = ''; |
628 | 628 | foreach($names as $name) |
629 | 629 | { |
630 | - $ret.=$this->getLinkByName($name, $this->links); |
|
630 | + $ret .= $this->getLinkByName($name, $this->links); |
|
631 | 631 | } |
632 | 632 | return $ret; |
633 | 633 | } |
@@ -639,7 +639,7 @@ discard block |
||
639 | 639 | { |
640 | 640 | $sites = $this->getSiteLinksForHeader(); |
641 | 641 | $links = $this->getLinksMenus(); |
642 | - $header ='<nav class="navbar navbar-default navbar-fixed-top"> |
|
642 | + $header = '<nav class="navbar navbar-default navbar-fixed-top"> |
|
643 | 643 | <div class="container-fluid"> |
644 | 644 | <!-- Brand and toggle get grouped for better mobile display --> |
645 | 645 | <div class="navbar-header"> |
@@ -668,7 +668,7 @@ discard block |
||
668 | 668 | </div> |
669 | 669 | </nav>'; |
670 | 670 | $this->body = $header.$this->body; |
671 | - $this->body_tags.='style="padding-top: 60px;"'; |
|
671 | + $this->body_tags .= 'style="padding-top: 60px;"'; |
|
672 | 672 | } |
673 | 673 | |
674 | 674 | /** Notification that is green for success */ |
@@ -689,7 +689,7 @@ discard block |
||
689 | 689 | * |
690 | 690 | * @deprecated 2.0.0 Use the addNotification function instead |
691 | 691 | */ |
692 | - function add_notification($msg, $sev=self::NOTIFICATION_INFO, $dismissible=1) |
|
692 | + function add_notification($msg, $sev = self::NOTIFICATION_INFO, $dismissible = 1) |
|
693 | 693 | { |
694 | 694 | $notice = array('msg'=>$msg, 'sev'=>$sev, 'dismissible'=>$dismissible); |
695 | 695 | array_push($this->notifications, $notice); |
@@ -702,7 +702,7 @@ discard block |
||
702 | 702 | * @param string $sevity The severity of the notifcation |
703 | 703 | * @param boolean $dismissible Can the user dismiss the notificaton? |
704 | 704 | */ |
705 | - public function addNotification($message, $severity=self::NOTIFICATION_INFO, $dismissible=true) |
|
705 | + public function addNotification($message, $severity = self::NOTIFICATION_INFO, $dismissible = true) |
|
706 | 706 | { |
707 | 707 | array_push($this->notifications, array('msg'=>$message, 'sev'=>$severity, 'dismissible'=>$dismissible)); |
708 | 708 | } |
@@ -740,10 +740,10 @@ discard block |
||
740 | 740 | break; |
741 | 741 | } |
742 | 742 | $style = ''; |
743 | - if($i+1 < count($this->notifications)) |
|
743 | + if($i + 1 < count($this->notifications)) |
|
744 | 744 | { |
745 | 745 | //Not the last notification, remove the end margin |
746 | - $style='style="margin: 0px;"'; |
|
746 | + $style = 'style="margin: 0px;"'; |
|
747 | 747 | } |
748 | 748 | $this->body = ' |
749 | 749 | <div class="'.$class.'" role="alert" '.$style.'> |
@@ -793,7 +793,7 @@ discard block |
||
793 | 793 | * @param boolean $header Draw the header |
794 | 794 | * @param boolean $analytics Include analytics on the page |
795 | 795 | */ |
796 | - public function printPage($header=true) |
|
796 | + public function printPage($header = true) |
|
797 | 797 | { |
798 | 798 | $this->renderNotifications(); |
799 | 799 | $this->addNoScript(); |
@@ -814,7 +814,7 @@ discard block |
||
814 | 814 | * |
815 | 815 | * @deprecated 1.0.0 Use addLink instead |
816 | 816 | */ |
817 | - function add_link($name, $url=false, $submenu=false) |
|
817 | + function add_link($name, $url = false, $submenu = false) |
|
818 | 818 | { |
819 | 819 | $this->addLink($name, $url, $submenu); |
820 | 820 | } |
@@ -826,7 +826,7 @@ discard block |
||
826 | 826 | * @param false|string $url The URL to link to |
827 | 827 | * @param false|array $subment Any submenu items for the dropdown |
828 | 828 | */ |
829 | - public function addLink($name, $url=false, $submenu=false) |
|
829 | + public function addLink($name, $url = false, $submenu = false) |
|
830 | 830 | { |
831 | 831 | if(is_array($submenu)) |
832 | 832 | { |
@@ -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)) |