*edit - jabber password as encrypted field and not individual

This commit is contained in:
Ing. Petr Suchy 2020-02-10 08:21:24 +01:00
parent 70dd0a3480
commit c72ffd0253
No known key found for this signature in database
GPG Key ID: 5BC9AFE53BB0E8A2
1 changed files with 5 additions and 10 deletions

View File

@ -77,8 +77,7 @@ class ConfigController extends AbstractController
'jabber_host',
'jabber_port',
'jabber_username',
'jabber_domain',
//'jabber_password' // not typical input - and saved encrypted
'jabber_domain'
);
/**
@ -86,7 +85,8 @@ class ConfigController extends AbstractController
* @var array
*/
protected $encryptedFields = [
'email_smtp_password'
'email_smtp_password',
'jabber_password'
];
private $default_tab = 'general';
@ -221,9 +221,7 @@ class ConfigController extends AbstractController
protected function executeSave()
{
if (!empty($_POST)) {
$jabberPassword = filter_input(INPUT_POST, 'jabber_password');
// save new config
// save new config
$clean = array(
'language' => $_POST['language'],
'sms_gateway' => $_POST['sms_gateway'],
@ -236,10 +234,7 @@ class ConfigController extends AbstractController
'log_retention_period' => intval(psm_POST('log_retention_period', 365)),
'password_encrypt_key' => psm_POST('password_encrypt_key', sha1(microtime()))
);
if ($jabberPassword !== null && $jabberPassword !== '') {
$clean['jabber_password'] = psm_password_encrypt(psm_get_conf('password_encrypt_key'), $jabberPassword);
}
foreach ($this->checkboxes as $input_key) {
foreach ($this->checkboxes as $input_key) {
$clean[$input_key] = (isset($_POST[$input_key])) ? '1' : '0';
}
foreach ($this->fields as $input_key) {