<?php
 namespace Modules\Admin\Config\UsersPasswordSecurity; class Controller extends \App\Mvc\Controller\Form\WindowAbstract { protected function initialize() { parent::initialize(); $this->actionsCfg['index'] = ['checkSection' => true,]; } protected function getDefaultFormData($R) { $cfg=\App\Config\PasswordSecurity::getInstance()->getAll(); return [ 'minLength'=> $cfg['minLength'], 'validity'=> $cfg['validity'], 'historyLimit'=> $cfg['historyLimit'], 'digitsCount'=> $cfg['digitsCount'], 'upperLettersCount'=> $cfg['upperLettersCount'], 'specialCharsCount'=> $cfg['specialCharsCount'], 'sessionLifetime' => round($cfg['sessionLifetime']/60, 2), 'loginWithPassword' => $cfg['loginWithPassword'], 'loginWithAzure' => $cfg['loginWithAzure'], ]; } protected function processFormData(Array $formData, \App\MessagesCollector $msgs) { try { $cfg=\App\Config\PasswordSecurity::getAdmin(); $cfg->set('minLength', $formData['minLength']); $cfg->set('validity', $formData['validity']); $cfg->set('historyLimit', $formData['historyLimit']); $cfg->set('digitsCount', $formData['digitsCount']); $cfg->set('upperLettersCount', $formData['upperLettersCount']); $cfg->set('specialCharsCount', $formData['specialCharsCount']); $cfg->set('sessionLifetime', round($formData['sessionLifetime']*60)); $cfg->set('loginWithPassword', $formData['loginWithPassword']); $cfg->set('loginWithAzure', $formData['loginWithAzure']); $cfg->save(); $msgs->addSuccess($this->lang['index']['saveOkMsg']); return true; } catch (\App\Config\MessageException $e) { $msgs->addWarning($e->getMessage()); return false; } } }