remove special characters from name when generating extrausers file
add froxlor hostname to 2fa-qrcode; refs #814 Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
2
2fa.php
2
2fa.php
@@ -38,7 +38,7 @@ if (AREA == 'admin') {
|
||||
}
|
||||
$success_message = "";
|
||||
|
||||
$tfa = new \Froxlor\FroxlorTwoFactorAuth('Froxlor');
|
||||
$tfa = new \Froxlor\FroxlorTwoFactorAuth('Froxlor ' . Settings::Get('system.hostname'));
|
||||
|
||||
// do the delete and then just show a success-message
|
||||
if ($action == 'delete') {
|
||||
|
||||
@@ -67,7 +67,7 @@ class Extrausers
|
||||
'name' => \Froxlor\Customer\Customer::getCustomerDetail($u['customerid'], 'name'),
|
||||
'company' => \Froxlor\Customer\Customer::getCustomerDetail($u['customerid'], 'company')
|
||||
);
|
||||
$u['comment'] = \Froxlor\User::getCorrectUserSalutation($salutation_array);
|
||||
$u['comment'] = self::cleanString(\Froxlor\User::getCorrectUserSalutation($salutation_array));
|
||||
if ($u['login_enabled'] != 'Y') {
|
||||
$u['password'] = '*';
|
||||
$u['shell'] = '/bin/false';
|
||||
@@ -90,4 +90,10 @@ class Extrausers
|
||||
$cronlog->logAction(\Froxlor\FroxlorLogger::CRON_ACTION, LOG_NOTICE, 'Error when writing ' . $type . ' file entries');
|
||||
}
|
||||
}
|
||||
|
||||
private static function cleanString($string = null)
|
||||
{
|
||||
$allowed = "/[^a-z0-9\\.\\-\\_\\ ]/i";
|
||||
return preg_replace($allowed, "", $string);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user