mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-09-24 10:27:46 +02:00
codereview
This commit is contained in:
parent
a31732592c
commit
f63faee158
@ -5,6 +5,7 @@ namespace Icinga\Forms\Config\User;
|
|||||||
|
|
||||||
use Icinga\Application\Config;
|
use Icinga\Application\Config;
|
||||||
use Icinga\Application\Hook\ConfigFormEventsHook;
|
use Icinga\Application\Hook\ConfigFormEventsHook;
|
||||||
|
use Icinga\Application\ProvidedHook\DefaultPasswordPolicy;
|
||||||
use Icinga\Authentication\PasswordValidator;
|
use Icinga\Authentication\PasswordValidator;
|
||||||
use Icinga\Data\Filter\Filter;
|
use Icinga\Data\Filter\Filter;
|
||||||
use Icinga\Forms\RepositoryForm;
|
use Icinga\Forms\RepositoryForm;
|
||||||
@ -22,7 +23,8 @@ class UserForm extends RepositoryForm
|
|||||||
$passwordPolicyObject = null;
|
$passwordPolicyObject = null;
|
||||||
$passwordPolicy = Config::app()->get(
|
$passwordPolicy = Config::app()->get(
|
||||||
'global',
|
'global',
|
||||||
'password_policy'
|
'password_policy',
|
||||||
|
DefaultPasswordPolicy::class
|
||||||
);
|
);
|
||||||
if (isset($passwordPolicy)) {
|
if (isset($passwordPolicy)) {
|
||||||
$passwordPolicyObject = new $passwordPolicy();
|
$passwordPolicyObject = new $passwordPolicy();
|
||||||
|
@ -8,7 +8,7 @@ use ErrorException;
|
|||||||
use Exception;
|
use Exception;
|
||||||
use Icinga\Application\ProvidedHook\DbMigration;
|
use Icinga\Application\ProvidedHook\DbMigration;
|
||||||
use Icinga\Application\ProvidedHook\DefaultPasswordPolicy;
|
use Icinga\Application\ProvidedHook\DefaultPasswordPolicy;
|
||||||
use Icinga\Application\ProvidedHook\NonePasswordPolicy;
|
use Icinga\Application\ProvidedHook\NoPasswordPolicy;
|
||||||
use ipl\I18n\GettextTranslator;
|
use ipl\I18n\GettextTranslator;
|
||||||
use ipl\I18n\StaticTranslator;
|
use ipl\I18n\StaticTranslator;
|
||||||
use LogicException;
|
use LogicException;
|
||||||
@ -743,7 +743,7 @@ abstract class ApplicationBootstrap
|
|||||||
{
|
{
|
||||||
Hook::register('DbMigration', DbMigration::class, DbMigration::class);
|
Hook::register('DbMigration', DbMigration::class, DbMigration::class);
|
||||||
Hook::register('passwordpolicy', DefaultPasswordPolicy::class, DefaultPasswordPolicy::class);
|
Hook::register('passwordpolicy', DefaultPasswordPolicy::class, DefaultPasswordPolicy::class);
|
||||||
Hook::register('passwordpolicy', NonePasswordPolicy::class, NonePasswordPolicy::class);
|
Hook::register('passwordpolicy', NoPasswordPolicy::class, NoPasswordPolicy::class);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ class DefaultPasswordPolicy implements PasswordPolicyHook
|
|||||||
public function getDescription(): string
|
public function getDescription(): string
|
||||||
{
|
{
|
||||||
return $this->translate(
|
return $this->translate(
|
||||||
'Password requirements: minimum 12 characters,' .
|
'Password requirements: minimum 12 characters, ' .
|
||||||
'at least 1 number, 1 special character, uppercase and lowercase letters.'
|
'at least 1 number, 1 special character, uppercase and lowercase letters.'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -9,9 +9,10 @@ use ipl\I18n\Translation;
|
|||||||
/**
|
/**
|
||||||
* None Password Policy to validate all passwords
|
* None Password Policy to validate all passwords
|
||||||
*/
|
*/
|
||||||
class NonePasswordPolicy implements PasswordPolicyHook
|
class NoPasswordPolicy implements PasswordPolicyHook
|
||||||
{
|
{
|
||||||
use Translation;
|
use Translation;
|
||||||
|
|
||||||
public function getName(): string
|
public function getName(): string
|
||||||
{
|
{
|
||||||
return $this->translate('None');
|
return $this->translate('None');
|
Loading…
x
Reference in New Issue
Block a user