diff options
author | Igor Scheller <igor.scheller@igorshp.de> | 2017-01-21 23:07:20 +0100 |
---|---|---|
committer | Igor Scheller <igor.scheller@igorshp.de> | 2017-01-21 23:07:20 +0100 |
commit | 8506d6d27e3b926521007064abcdcc2f69c6aa06 (patch) | |
tree | 4c0207871b3e9a831f8a619ff095ad71adb66f05 /includes/pages/user_settings.php | |
parent | 740026a9de6cba73c4e77aba78950d0a791b6b62 (diff) |
Refactoring: Config cleanup / moved to class
Diffstat (limited to 'includes/pages/user_settings.php')
-rw-r--r-- | includes/pages/user_settings.php | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/includes/pages/user_settings.php b/includes/pages/user_settings.php index 5d4ba368..a2a486f4 100644 --- a/includes/pages/user_settings.php +++ b/includes/pages/user_settings.php @@ -97,13 +97,12 @@ function user_settings_main($user_source, $enable_tshirt_size, $tshirt_sizes) */ function user_settings_password($user_source) { - global $min_password_length; if ( !isset($_REQUEST['password']) || !verify_password($_REQUEST['password'], $user_source['Passwort'], $user_source['UID']) ) { error(_('-> not OK. Please try again.')); - } elseif (strlen($_REQUEST['new_password']) < $min_password_length) { + } elseif (strlen($_REQUEST['new_password']) < config('min_password_length')) { error(_('Your password is to short (please use at least 6 characters).')); } elseif ($_REQUEST['new_password'] != $_REQUEST['new_password2']) { error(_('Your passwords don\'t match.')); @@ -195,8 +194,11 @@ function user_settings_locale($user_source, $locales) */ function user_settings() { - global $enable_tshirt_size, $tshirt_sizes, $themes, $locales; - global $user; + global $themes, $user; + + $enable_tshirt_size = config('enable_tshirt_size'); + $tshirt_sizes = config('tshirt_sizes'); + $locales = config('locales'); $buildup_start_date = null; $teardown_end_date = null; @@ -210,6 +212,12 @@ function user_settings() } } + foreach ($tshirt_sizes as $key => $size) { + if (empty($size)) { + unset($tshirt_sizes[$key]); + } + } + $user_source = $user; if (isset($_REQUEST['submit'])) { |