summaryrefslogtreecommitdiff
path: root/includes/model/User_model.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2017-01-21 23:07:20 +0100
committerIgor Scheller <igor.scheller@igorshp.de>2017-01-21 23:07:20 +0100
commit8506d6d27e3b926521007064abcdcc2f69c6aa06 (patch)
tree4c0207871b3e9a831f8a619ff095ad71adb66f05 /includes/model/User_model.php
parent740026a9de6cba73c4e77aba78950d0a791b6b62 (diff)
Refactoring: Config cleanup / moved to class
Diffstat (limited to 'includes/model/User_model.php')
-rw-r--r--includes/model/User_model.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/includes/model/User_model.php b/includes/model/User_model.php
index 097e8faf..53b4ce1e 100644
--- a/includes/model/User_model.php
+++ b/includes/model/User_model.php
@@ -215,9 +215,9 @@ function Users($order_by = 'Nick')
*/
function User_is_freeloader($user)
{
- global $max_freeloadable_shifts, $user;
+ global $user;
- return count(ShiftEntries_freeloaded_by_user($user)) >= $max_freeloadable_shifts;
+ return count(ShiftEntries_freeloaded_by_user($user)) >= config('max_freeloadable_shifts');
}
/**
@@ -542,8 +542,7 @@ function User_generate_password_recovery_token(&$user)
*/
function User_get_eligable_voucher_count(&$user)
{
- global $voucher_settings;
-
+ $voucher_settings = config('voucher_settings');
$shifts_done = count(ShiftEntries_finished_by_user($user));
$earned_vouchers = $user['got_voucher'] - $voucher_settings['initial_vouchers'];