migrated a few functions to new Settings class and removed unused function createAWStatsVhost(), refs #1325

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2013-12-15 13:05:19 +01:00
parent 558108008a
commit 52aaedd33a
15 changed files with 85 additions and 177 deletions

View File

@@ -26,24 +26,22 @@
*
* @return string either the password or an errormessage+exit
*/
function validatePassword($password = null)
{
global $settings, $theme;
function validatePassword($password = null) {
if ($settings['panel']['password_min_length'] > 0) {
if (Settings::Get('panel.password_min_length') > 0) {
$password = validate(
$password,
$settings['panel']['password_min_length'], /* replacer needs to be password length, not the fieldname */
'/^.{'.(int)$settings['panel']['password_min_length'].',}$/D',
Settings::Get('panel.password_min_length'),
'/^.{'.(int)Settings::Get('panel.password_min_length').',}$/D',
'notrequiredpasswordlength'
);
}
if ($settings['panel']['password_regex'] != '') {
if (Settings::Get('panel.password_regex') != '') {
$password = validate(
$password,
$settings['panel']['password_regex'],
$settings['panel']['password_regex'],
Settings::Get('panel.password_regex'),
Settings::Get('panel.password_regex'),
'notrequiredpasswordcomplexity'
);
}