@@ -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(); |
@@ -34,10 +34,14 @@ discard block |
||
| 34 | 34 | switch($orderby[$keys[0]]) |
| 35 | 35 | { |
| 36 | 36 | case 1: |
| 37 | - if($d > 0) swap($array, $i, $j); |
|
| 37 | + if($d > 0) { |
|
| 38 | + swap($array, $i, $j); |
|
| 39 | + } |
|
| 38 | 40 | break; |
| 39 | 41 | case 0: |
| 40 | - if($d < 0) swap($array, $i, $j); |
|
| 42 | + if($d < 0) { |
|
| 43 | + swap($array, $i, $j); |
|
| 44 | + } |
|
| 41 | 45 | break; |
| 42 | 46 | } |
| 43 | 47 | } |
@@ -158,8 +162,7 @@ discard block |
||
| 158 | 162 | if($bind_write === false) |
| 159 | 163 | { |
| 160 | 164 | $ret = $server->bind(); |
| 161 | - } |
|
| 162 | - else |
|
| 165 | + } else |
|
| 163 | 166 | { |
| 164 | 167 | $ret = $server->bind($this->bind_dn, $this->bind_pass); |
| 165 | 168 | } |
@@ -292,12 +295,10 @@ discard block |
||
| 292 | 295 | if($skip !== false && $top !== false) |
| 293 | 296 | { |
| 294 | 297 | $data = array_slice($data, $skip, $top); |
| 295 | - } |
|
| 296 | - else if($top !== false) |
|
| 298 | + } else if($top !== false) |
|
| 297 | 299 | { |
| 298 | 300 | $data = array_slice($data, 0, $top); |
| 299 | - } |
|
| 300 | - else if($skip !== false) |
|
| 301 | + } else if($skip !== false) |
|
| 301 | 302 | { |
| 302 | 303 | $data = array_slice($data, $skip); |
| 303 | 304 | } |
@@ -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,8 +8,7 @@ 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'); |
@@ -115,8 +114,7 @@ discard block |
||
| 115 | 114 | if($fieldValue !== null && strlen($fieldValue) > 0) |
| 116 | 115 | { |
| 117 | 116 | $obj[$fieldName] = $fieldValue; |
| 118 | - } |
|
| 119 | - else |
|
| 117 | + } else |
|
| 120 | 118 | { |
| 121 | 119 | $obj[$fieldName] = null; |
| 122 | 120 | } |
@@ -133,8 +131,7 @@ discard block |
||
| 133 | 131 | $obj[$fieldName] = $this->ldapObj->{$fieldName}; |
| 134 | 132 | $obj[$fieldName][$obj[$fieldName]['count']] = $fieldValue; |
| 135 | 133 | $obj[$fieldName]['count']++; |
| 136 | - } |
|
| 137 | - else |
|
| 134 | + } else |
|
| 138 | 135 | { |
| 139 | 136 | $obj[$fieldName] = $fieldValue; |
| 140 | 137 | } |
@@ -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 | { |
@@ -123,8 +123,7 @@ |
||
| 123 | 123 | if(isset($this->host)) |
| 124 | 124 | { |
| 125 | 125 | array_push($this->host, $provider); |
| 126 | - } |
|
| 127 | - else |
|
| 126 | + } else |
|
| 128 | 127 | { |
| 129 | 128 | $this->host = array($provider); |
| 130 | 129 | } |
@@ -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 | { |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | * |
| 32 | 32 | * @param string $name The name of the group to check if the user is in |
| 33 | 33 | * |
| 34 | - * @return true|false True if the user is in the group, false otherwise |
|
| 34 | + * @return boolean True if the user is in the group, false otherwise |
|
| 35 | 35 | */ |
| 36 | 36 | function isInGroupNamed($name) |
| 37 | 37 | { |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | /** |
| 42 | 42 | * The name the user should be displayed as |
| 43 | 43 | * |
| 44 | - * @return string The name the user should be displayed as |
|
| 44 | + * @return boolean The name the user should be displayed as |
|
| 45 | 45 | */ |
| 46 | 46 | function getDisplayName() |
| 47 | 47 | { |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | /** |
| 52 | 52 | * The given (or first) name for the user |
| 53 | 53 | * |
| 54 | - * @return string The user's first name |
|
| 54 | + * @return boolean The user's first name |
|
| 55 | 55 | */ |
| 56 | 56 | function getGivenName() |
| 57 | 57 | { |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | /** |
| 62 | 62 | * The email address for the user |
| 63 | 63 | * |
| 64 | - * @return string The user's email address |
|
| 64 | + * @return boolean The user's email address |
|
| 65 | 65 | */ |
| 66 | 66 | function getEmail() |
| 67 | 67 | { |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | /** |
| 72 | 72 | * The user ID for the user |
| 73 | 73 | * |
| 74 | - * @return string The user's ID or username |
|
| 74 | + * @return boolean The user's ID or username |
|
| 75 | 75 | */ |
| 76 | 76 | function getUid() |
| 77 | 77 | { |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | /** |
| 82 | 82 | * The photo for the user |
| 83 | 83 | * |
| 84 | - * @return string The user's photo as a binary string |
|
| 84 | + * @return boolean The user's photo as a binary string |
|
| 85 | 85 | */ |
| 86 | 86 | function getPhoto() |
| 87 | 87 | { |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | /** |
| 92 | 92 | * The phone number for the user |
| 93 | 93 | * |
| 94 | - * @return string The user's phone number |
|
| 94 | + * @return boolean The user's phone number |
|
| 95 | 95 | */ |
| 96 | 96 | function getPhoneNumber() |
| 97 | 97 | { |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | /** |
| 102 | 102 | * The organziation for the user |
| 103 | 103 | * |
| 104 | - * @return string The user's organization |
|
| 104 | + * @return boolean The user's organization |
|
| 105 | 105 | */ |
| 106 | 106 | function getOrganization() |
| 107 | 107 | { |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | /** |
| 112 | 112 | * The list of titles for the user |
| 113 | 113 | * |
| 114 | - * @return array The user's title(s) in short format |
|
| 114 | + * @return boolean The user's title(s) in short format |
|
| 115 | 115 | */ |
| 116 | 116 | function getTitles() |
| 117 | 117 | { |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | /** |
| 122 | 122 | * The list of titles for the user |
| 123 | 123 | * |
| 124 | - * @return array The user's title(s) in user friendly strings |
|
| 124 | + * @return boolean The user's title(s) in user friendly strings |
|
| 125 | 125 | * |
| 126 | 126 | * @SuppressWarnings("StaticAccess") |
| 127 | 127 | */ |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | /** |
| 160 | 160 | * The state the user's mailing address is in |
| 161 | 161 | * |
| 162 | - * @return string The user's state from their mailing address |
|
| 162 | + * @return boolean The user's state from their mailing address |
|
| 163 | 163 | */ |
| 164 | 164 | function getState() |
| 165 | 165 | { |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | /** |
| 170 | 170 | * The city the user's mailing address is in |
| 171 | 171 | * |
| 172 | - * @return string The user's city from their mailing address |
|
| 172 | + * @return boolean The user's city from their mailing address |
|
| 173 | 173 | */ |
| 174 | 174 | function getCity() |
| 175 | 175 | { |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | /** |
| 180 | 180 | * The last name for the user |
| 181 | 181 | * |
| 182 | - * @return string The user's last name |
|
| 182 | + * @return boolean The user's last name |
|
| 183 | 183 | */ |
| 184 | 184 | function getLastName() |
| 185 | 185 | { |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | /** |
| 190 | 190 | * The nick name for the user |
| 191 | 191 | * |
| 192 | - * @return string The user's nick name |
|
| 192 | + * @return boolean The user's nick name |
|
| 193 | 193 | */ |
| 194 | 194 | function getNickName() |
| 195 | 195 | { |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | /** |
| 200 | 200 | * The street address for the user |
| 201 | 201 | * |
| 202 | - * @return string The user's street address |
|
| 202 | + * @return boolean The user's street address |
|
| 203 | 203 | */ |
| 204 | 204 | function getAddress() |
| 205 | 205 | { |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | /** |
| 210 | 210 | * The postal (zip) code for the user's mailing address |
| 211 | 211 | * |
| 212 | - * @return string The user's postal code |
|
| 212 | + * @return boolean The user's postal code |
|
| 213 | 213 | */ |
| 214 | 214 | function getPostalCode() |
| 215 | 215 | { |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | /** |
| 220 | 220 | * The country the user's mailing address is in |
| 221 | 221 | * |
| 222 | - * @return string The user's country from their mailing address |
|
| 222 | + * @return boolean The user's country from their mailing address |
|
| 223 | 223 | */ |
| 224 | 224 | function getCountry() |
| 225 | 225 | { |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | * |
| 232 | 232 | * This is the same as Areas in Flipside speak. |
| 233 | 233 | * |
| 234 | - * @return array The user's orgnaiational units |
|
| 234 | + * @return boolean The user's orgnaiational units |
|
| 235 | 235 | */ |
| 236 | 236 | function getOrganizationUnits() |
| 237 | 237 | { |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | /** |
| 242 | 242 | * The supplemental login types that the user can use to login |
| 243 | 243 | * |
| 244 | - * @return array The user's login providers |
|
| 244 | + * @return boolean The user's login providers |
|
| 245 | 245 | */ |
| 246 | 246 | function getLoginProviders() |
| 247 | 247 | { |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | /** |
| 252 | 252 | * The groups the user is a part of |
| 253 | 253 | * |
| 254 | - * @return array The user's Auth\Group structures |
|
| 254 | + * @return boolean The user's Auth\Group structures |
|
| 255 | 255 | */ |
| 256 | 256 | function getGroups() |
| 257 | 257 | { |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | * |
| 276 | 276 | * @param string $provider The hostname for the provider |
| 277 | 277 | * |
| 278 | - * @return true|false true if they can login with the provider, false otherwise |
|
| 278 | + * @return boolean true if they can login with the provider, false otherwise |
|
| 279 | 279 | */ |
| 280 | 280 | function canLoginWith($provider) |
| 281 | 281 | { |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | * |
| 295 | 295 | * @param string $password The new user password |
| 296 | 296 | * |
| 297 | - * @return true|false true if the user's password was changed, false otherwise |
|
| 297 | + * @return boolean true if the user's password was changed, false otherwise |
|
| 298 | 298 | */ |
| 299 | 299 | protected function setPass($password) |
| 300 | 300 | { |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | /** |
| 305 | 305 | * Has the user completely filled out their user profile? |
| 306 | 306 | * |
| 307 | - * @return true|false true if the user's profile is complete, false otherwise |
|
| 307 | + * @return boolean true if the user's profile is complete, false otherwise |
|
| 308 | 308 | */ |
| 309 | 309 | function isProfileComplete() |
| 310 | 310 | { |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | * |
| 323 | 323 | * @param string $password The user's current password |
| 324 | 324 | * |
| 325 | - * @return true|false true if the user's password is correct, false otherwise |
|
| 325 | + * @return boolean true if the user's password is correct, false otherwise |
|
| 326 | 326 | * |
| 327 | 327 | * @SuppressWarnings("UnusedFormalParameter") |
| 328 | 328 | */ |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | * |
| 337 | 337 | * @param string $hash The user's reset hash |
| 338 | 338 | * |
| 339 | - * @return true|false true if the user's hash is correct, false otherwise |
|
| 339 | + * @return boolean true if the user's hash is correct, false otherwise |
|
| 340 | 340 | * |
| 341 | 341 | * @SuppressWarnings("UnusedFormalParameter") |
| 342 | 342 | */ |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | * @param string $newpass The user's new password |
| 353 | 353 | * @param boolean $isHash Is $old_pass a password or a hash |
| 354 | 354 | * |
| 355 | - * @return true|false true if the user's password was changed, false otherwise |
|
| 355 | + * @return boolean true if the user's password was changed, false otherwise |
|
| 356 | 356 | */ |
| 357 | 357 | function change_pass($oldpass, $newpass, $isHash=false) |
| 358 | 358 | { |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | * |
| 377 | 377 | * @param string $name The user's new display name |
| 378 | 378 | * |
| 379 | - * @return true|false true if the user's display name was changed, false otherwise |
|
| 379 | + * @return boolean true if the user's display name was changed, false otherwise |
|
| 380 | 380 | */ |
| 381 | 381 | function setDisplayName($name) |
| 382 | 382 | { |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | * |
| 389 | 389 | * @param string $name The user's new given name |
| 390 | 390 | * |
| 391 | - * @return true|false true if the user's given name was changed, false otherwise |
|
| 391 | + * @return boolean true if the user's given name was changed, false otherwise |
|
| 392 | 392 | */ |
| 393 | 393 | function setGivenName($name) |
| 394 | 394 | { |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | * |
| 401 | 401 | * @param string $email The user's new email address |
| 402 | 402 | * |
| 403 | - * @return true|false true if the user's email address was changed, false otherwise |
|
| 403 | + * @return boolean true if the user's email address was changed, false otherwise |
|
| 404 | 404 | * |
| 405 | 405 | * @SuppressWarnings("UnusedFormalParameter") |
| 406 | 406 | */ |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | * |
| 415 | 415 | * @param string $uid The user's new user ID |
| 416 | 416 | * |
| 417 | - * @return true|false true if the user's ID was changed, false otherwise |
|
| 417 | + * @return boolean true if the user's ID was changed, false otherwise |
|
| 418 | 418 | * |
| 419 | 419 | * @SuppressWarnings("UnusedFormalParameter") |
| 420 | 420 | */ |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | * |
| 429 | 429 | * @param string $photo The user's new photo as a binary string |
| 430 | 430 | * |
| 431 | - * @return true|false true if the user's photo was changed, false otherwise |
|
| 431 | + * @return boolean true if the user's photo was changed, false otherwise |
|
| 432 | 432 | * |
| 433 | 433 | * @SuppressWarnings("UnusedFormalParameter") |
| 434 | 434 | */ |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | * |
| 443 | 443 | * @param string $phone The user's new phonew number |
| 444 | 444 | * |
| 445 | - * @return true|false true if the user's phone number was changed, false otherwise |
|
| 445 | + * @return boolean true if the user's phone number was changed, false otherwise |
|
| 446 | 446 | * |
| 447 | 447 | * @SuppressWarnings("UnusedFormalParameter") |
| 448 | 448 | */ |
@@ -456,7 +456,7 @@ discard block |
||
| 456 | 456 | * |
| 457 | 457 | * @param string $org The user's new organization |
| 458 | 458 | * |
| 459 | - * @return true|false true if the user's organization was changed, false otherwise |
|
| 459 | + * @return boolean true if the user's organization was changed, false otherwise |
|
| 460 | 460 | * |
| 461 | 461 | * @SuppressWarnings("UnusedFormalParameter") |
| 462 | 462 | */ |
@@ -470,7 +470,7 @@ discard block |
||
| 470 | 470 | * |
| 471 | 471 | * @param string $titles The user's new titles |
| 472 | 472 | * |
| 473 | - * @return true|false true if the user's titles were changed, false otherwise |
|
| 473 | + * @return boolean true if the user's titles were changed, false otherwise |
|
| 474 | 474 | * |
| 475 | 475 | * @SuppressWarnings("UnusedFormalParameter") |
| 476 | 476 | */ |
@@ -484,7 +484,7 @@ discard block |
||
| 484 | 484 | * |
| 485 | 485 | * @param string $state The user's new state |
| 486 | 486 | * |
| 487 | - * @return true|false true if the user's state was changed, false otherwise |
|
| 487 | + * @return boolean true if the user's state was changed, false otherwise |
|
| 488 | 488 | * |
| 489 | 489 | * @SuppressWarnings("UnusedFormalParameter") |
| 490 | 490 | */ |
@@ -498,7 +498,7 @@ discard block |
||
| 498 | 498 | * |
| 499 | 499 | * @param string $city The user's new city |
| 500 | 500 | * |
| 501 | - * @return true|false true if the user's city was changed, false otherwise |
|
| 501 | + * @return boolean true if the user's city was changed, false otherwise |
|
| 502 | 502 | * |
| 503 | 503 | * @SuppressWarnings("UnusedFormalParameter") |
| 504 | 504 | */ |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | * |
| 513 | 513 | * @param string $sn The user's new last name |
| 514 | 514 | * |
| 515 | - * @return true|false true if the user's last name was changed, false otherwise |
|
| 515 | + * @return boolean true if the user's last name was changed, false otherwise |
|
| 516 | 516 | * |
| 517 | 517 | * @SuppressWarnings("UnusedFormalParameter") |
| 518 | 518 | */ |
@@ -526,7 +526,7 @@ discard block |
||
| 526 | 526 | * |
| 527 | 527 | * @param string $displayName The user's new nick name |
| 528 | 528 | * |
| 529 | - * @return true|false true if the user's nick name was changed, false otherwise |
|
| 529 | + * @return boolean true if the user's nick name was changed, false otherwise |
|
| 530 | 530 | */ |
| 531 | 531 | function setNickName($displayName) |
| 532 | 532 | { |
@@ -538,7 +538,7 @@ discard block |
||
| 538 | 538 | * |
| 539 | 539 | * @param string $address The user's new mailing address |
| 540 | 540 | * |
| 541 | - * @return true|false true if the user's mailing address was changed, false otherwise |
|
| 541 | + * @return boolean true if the user's mailing address was changed, false otherwise |
|
| 542 | 542 | * |
| 543 | 543 | * @SuppressWarnings("UnusedFormalParameter") |
| 544 | 544 | */ |
@@ -552,7 +552,7 @@ discard block |
||
| 552 | 552 | * |
| 553 | 553 | * @param string $postalcode The user's new postal code |
| 554 | 554 | * |
| 555 | - * @return true|false true if the user's postal code was changed, false otherwise |
|
| 555 | + * @return boolean true if the user's postal code was changed, false otherwise |
|
| 556 | 556 | * |
| 557 | 557 | * @SuppressWarnings("UnusedFormalParameter") |
| 558 | 558 | */ |
@@ -566,7 +566,7 @@ discard block |
||
| 566 | 566 | * |
| 567 | 567 | * @param string $country The user's new country |
| 568 | 568 | * |
| 569 | - * @return true|false true if the user's country was changed, false otherwise |
|
| 569 | + * @return boolean true if the user's country was changed, false otherwise |
|
| 570 | 570 | * |
| 571 | 571 | * @SuppressWarnings("UnusedFormalParameter") |
| 572 | 572 | */ |
@@ -580,7 +580,7 @@ discard block |
||
| 580 | 580 | * |
| 581 | 581 | * @param string $ous The user's new organizations |
| 582 | 582 | * |
| 583 | - * @return true|false true if the user's organizations was changed, false otherwise |
|
| 583 | + * @return boolean true if the user's organizations was changed, false otherwise |
|
| 584 | 584 | * |
| 585 | 585 | * @SuppressWarnings("UnusedFormalParameter") |
| 586 | 586 | */ |
@@ -704,7 +704,7 @@ discard block |
||
| 704 | 704 | /** |
| 705 | 705 | * Obtain the user's password reset hash |
| 706 | 706 | * |
| 707 | - * @return string|false A hash if available, false otherwise |
|
| 707 | + * @return boolean A hash if available, false otherwise |
|
| 708 | 708 | */ |
| 709 | 709 | public function getPasswordResetHash() |
| 710 | 710 | { |
@@ -280,11 +280,15 @@ discard block |
||
| 280 | 280 | function canLoginWith($provider) |
| 281 | 281 | { |
| 282 | 282 | $hosts = $this->getLoginProviders(); |
| 283 | - if($hosts === false) return false; |
|
| 283 | + if($hosts === false) { |
|
| 284 | + return false; |
|
| 285 | + } |
|
| 284 | 286 | $count = count($hosts); |
| 285 | 287 | for($i = 0; $i < $count; $i++) |
| 286 | 288 | { |
| 287 | - if(strcasecmp($hosts[$i], $provider) === 0) return true; |
|
| 289 | + if(strcasecmp($hosts[$i], $provider) === 0) { |
|
| 290 | + return true; |
|
| 291 | + } |
|
| 288 | 292 | } |
| 289 | 293 | return false; |
| 290 | 294 | } |
@@ -607,8 +611,7 @@ discard block |
||
| 607 | 611 | $this->change_pass($data->oldpass, $data->password); |
| 608 | 612 | unset($data->oldpass); |
| 609 | 613 | unset($data->password); |
| 610 | - } |
|
| 611 | - else if(isset($data->hash) && isset($data->password)) |
|
| 614 | + } else if(isset($data->hash) && isset($data->password)) |
|
| 612 | 615 | { |
| 613 | 616 | $this->change_pass($data->hash, $data->password, true); |
| 614 | 617 | return; |
@@ -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) |
@@ -40,8 +40,7 @@ |
||
| 40 | 40 | if(!isset($params['redirect_url'])) |
| 41 | 41 | { |
| 42 | 42 | $this->redirect_uri = 'https://'.$_SERVER['HTTP_HOST'].'/oauth/callbacks/'.$this->getHostName(); |
| 43 | - } |
|
| 44 | - else |
|
| 43 | + } else |
|
| 45 | 44 | { |
| 46 | 45 | $this->redirect_uri = $params['redirect_url']; |
| 47 | 46 | } |
@@ -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 | */ |
@@ -374,7 +374,9 @@ discard block |
||
| 374 | 374 | $count = count($this->methods); |
| 375 | 375 | for($i = 0; $i < $count; $i++) |
| 376 | 376 | { |
| 377 | - if($this->methods[$i]->supplement === false) continue; |
|
| 377 | + if($this->methods[$i]->supplement === false) { |
|
| 378 | + continue; |
|
| 379 | + } |
|
| 378 | 380 | |
| 379 | 381 | array_push($ret, $this->methods[$i]->getSupplementLink()); |
| 380 | 382 | } |
@@ -413,7 +415,9 @@ discard block |
||
| 413 | 415 | $count = count($this->methods); |
| 414 | 416 | for($i = 0; $i < $count; $i++) |
| 415 | 417 | { |
| 416 | - if($this->methods[$i]->pending === false) continue; |
|
| 418 | + if($this->methods[$i]->pending === false) { |
|
| 419 | + continue; |
|
| 420 | + } |
|
| 417 | 421 | |
| 418 | 422 | $ret = $this->methods[$i]->getTempUserByHash($hash); |
| 419 | 423 | if($ret !== false) |
@@ -442,7 +446,9 @@ discard block |
||
| 442 | 446 | $count = count($this->methods); |
| 443 | 447 | for($i = 0; $i < $count; $i++) |
| 444 | 448 | { |
| 445 | - if($this->methods[$i]->pending === false) continue; |
|
| 449 | + if($this->methods[$i]->pending === false) { |
|
| 450 | + continue; |
|
| 451 | + } |
|
| 446 | 452 | |
| 447 | 453 | $ret = $this->methods[$i]->createPendingUser($user); |
| 448 | 454 | if($ret !== false) |
@@ -474,7 +480,9 @@ discard block |
||
| 474 | 480 | $count = count($this->methods); |
| 475 | 481 | for($i = 0; $i < $count; $i++) |
| 476 | 482 | { |
| 477 | - if($this->methods[$i]->current === false) continue; |
|
| 483 | + if($this->methods[$i]->current === false) { |
|
| 484 | + continue; |
|
| 485 | + } |
|
| 478 | 486 | |
| 479 | 487 | $ret = $this->methods[$i]->activatePendingUser($user); |
| 480 | 488 | if($ret !== false) |
@@ -504,7 +512,9 @@ discard block |
||
| 504 | 512 | $count = count($this->methods); |
| 505 | 513 | for($i = 0; $i < $count; $i++) |
| 506 | 514 | { |
| 507 | - if($this->methods[$i]->current === false) continue; |
|
| 515 | + if($this->methods[$i]->current === false) { |
|
| 516 | + continue; |
|
| 517 | + } |
|
| 508 | 518 | |
| 509 | 519 | $ret = $this->methods[$i]->getUserByResetHash($hash); |
| 510 | 520 | if($ret !== false) |
@@ -534,7 +544,9 @@ discard block |
||
| 534 | 544 | $count = count($this->methods); |
| 535 | 545 | for($i = 0; $i < $count; $i++) |
| 536 | 546 | { |
| 537 | - if($this->methods[$i]->supplement === false) continue; |
|
| 547 | + if($this->methods[$i]->supplement === false) { |
|
| 548 | + continue; |
|
| 549 | + } |
|
| 538 | 550 | |
| 539 | 551 | if($this->methods[$i]->getHostName() === $host) |
| 540 | 552 | { |
@@ -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"> |