diff options
author | Bot <bot@myigel.name> | 2017-12-25 23:12:52 +0100 |
---|---|---|
committer | Igor Scheller <igor.scheller@igorshp.de> | 2017-12-25 23:51:15 +0100 |
commit | 952c7892f3ac7bfadf8419062e44ff1af66ecc57 (patch) | |
tree | 69a85e8e4719801a064b8fa2d521fe000f959cd5 /includes/model/User_model.php | |
parent | 879918864a9c6da0fe9be1aca6c443ec8df0afc3 (diff) |
Formatting & Docstrings
Diffstat (limited to 'includes/model/User_model.php')
-rw-r--r-- | includes/model/User_model.php | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/includes/model/User_model.php b/includes/model/User_model.php index 2d1767e6..33fca639 100644 --- a/includes/model/User_model.php +++ b/includes/model/User_model.php @@ -209,7 +209,7 @@ function User_is_freeloader($user) * Returns all users that are not member of given angeltype. * * @param array $angeltype Angeltype - * @return array + * @return array[] */ function Users_by_angeltype_inverted($angeltype) { @@ -231,7 +231,7 @@ function Users_by_angeltype_inverted($angeltype) * Returns all members of given angeltype. * * @param array $angeltype - * @return array + * @return array[] */ function Users_by_angeltype($angeltype) { @@ -258,7 +258,7 @@ function Users_by_angeltype($angeltype) /** * Returns User id array * - * @return array + * @return array[] */ function User_ids() { @@ -268,6 +268,7 @@ function User_ids() /** * Strip unwanted characters from a users nick. Allowed are letters, numbers, connecting punctuation and simple space. * Nick is trimmed. + * * @param string $nick * @return string */ @@ -279,8 +280,7 @@ function User_validate_Nick($nick) /** * Validate user email address. * - * @param string $mail - * The email address to validate + * @param string $mail The email address to validate * @return ValidationResult */ function User_validate_mail($mail) @@ -292,8 +292,7 @@ function User_validate_mail($mail) /** * Validate user jabber address * - * @param string $jabber - * Jabber-ID to validate + * @param string $jabber Jabber-ID to validate * @return ValidationResult */ function User_validate_jabber($jabber) @@ -337,10 +336,8 @@ function User_validate_planned_arrival_date($planned_arrival_date) /** * Validate the planned departure date * - * @param int $planned_arrival_date - * Unix timestamp - * @param int $planned_departure_date - * Unix timestamp + * @param int $planned_arrival_date Unix timestamp + * @param int $planned_departure_date Unix timestamp * @return ValidationResult */ function User_validate_planned_departure_date($planned_arrival_date, $planned_departure_date) @@ -383,8 +380,7 @@ function User($user_id) /** * Returns User by api_key. * - * @param string $api_key - * User api key + * @param string $api_key User api key * @return array|null Matching user, null if not found */ function User_by_api_key($api_key) @@ -396,7 +392,7 @@ function User_by_api_key($api_key) * Returns User by email. * * @param string $email - * @return array|null Matching user, null or false on error + * @return array|null Matching user, null on error */ function User_by_email($email) { @@ -460,7 +456,9 @@ function User_generate_password_recovery_token(&$user) $user['UID'], ] ); + engelsystem_log('Password recovery for ' . User_Nick_render($user) . ' started.'); + return $user['password_recovery_token']; } @@ -474,10 +472,10 @@ function User_get_eligable_voucher_count(&$user) $shifts_done = count(ShiftEntries_finished_by_user($user)); $earned_vouchers = $user['got_voucher'] - $voucher_settings['initial_vouchers']; - $elegible_vouchers = $shifts_done / $voucher_settings['shifts_per_voucher'] - $earned_vouchers; - if ($elegible_vouchers < 0) { + $eligable_vouchers = $shifts_done / $voucher_settings['shifts_per_voucher'] - $earned_vouchers; + if ($eligable_vouchers < 0) { return 0; } - return $elegible_vouchers; + return $eligable_vouchers; } |