diff --git a/src/Eccube/Form/Type/Admin/LoginType.php b/src/Eccube/Form/Type/Admin/LoginType.php index 5f7152619f1..8c4cca69949 100644 --- a/src/Eccube/Form/Type/Admin/LoginType.php +++ b/src/Eccube/Form/Type/Admin/LoginType.php @@ -13,6 +13,7 @@ namespace Eccube\Form\Type\Admin; +use Eccube\Common\EccubeConfig; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\PasswordType; use Symfony\Component\Form\Extension\Core\Type\TextType; @@ -23,13 +24,21 @@ class LoginType extends AbstractType { + /** + * @var EccubeConfig + */ + protected $eccubeConfig; + /** * @var SessionInterface */ protected $session; - public function __construct(SessionInterface $session) - { + public function __construct( + EccubeConfig $eccubeConfig, + SessionInterface $session + ) { + $this->eccubeConfig = $eccubeConfig; $this->session = $session; } @@ -40,7 +49,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('login_id', TextType::class, [ 'attr' => [ - 'maxlength' => 50, + 'maxlength' => $this->eccubeConfig['eccube_id_max_len'], ], 'constraints' => [ new Assert\NotBlank(), @@ -49,7 +58,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) ]); $builder->add('password', PasswordType::class, [ 'attr' => [ - 'maxlength' => 50, + 'maxlength' => $this->eccubeConfig['eccube_password_max_len'], ], 'constraints' => [ new Assert\NotBlank(),