diff --git a/module/fid_adlr/config/module.config.php b/module/fid_adlr/config/module.config.php index 85f3072d12c24436cffc26c1fb15b559f09a0f06..36d90ad75b1e5d0e23bf4ac6f0c75c264b2e6e77 100644 --- a/module/fid_adlr/config/module.config.php +++ b/module/fid_adlr/config/module.config.php @@ -23,6 +23,7 @@ use fid_adlr\Controller\MyResearchController; use fid_adlr\Controller\MyResearchControllerFactory; use fid_adlr\Helper\Rss; +use fid\FormModel\PasswordChangeModel; use Zend\Router\Http\Regex; use Zend\ServiceManager\Factory\InvokableFactory; @@ -31,6 +32,7 @@ $config = [ 'user-create-form' => require 'user-create-form.php', 'user-update-form' => require 'user-update-form.php', 'admin-edit-form' => require 'admin-edit-form.php', + PasswordChangeModel::class => require 'password-change-form.php', ], 'controllers' => [ 'factories' => [ diff --git a/module/fid_adlr/config/password-change-form.php b/module/fid_adlr/config/password-change-form.php new file mode 100644 index 0000000000000000000000000000000000000000..bf7417d6ca9b8de7bf5923e2fb2e9833a1befe23 --- /dev/null +++ b/module/fid_adlr/config/password-change-form.php @@ -0,0 +1,40 @@ +<?php +/** + * Copyright (C) 2019 Leipzig University Library + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Sebastian Kehr <kehr@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2 + */ + +use Zend\Validator\Regex; + +return [ + 'input_filter' => [ + 'password' => [ + 'validators' => [ + Regex::class => [ + 'name' => Regex::class, + 'options' => [ + 'pattern' => '/(?:.*[0-9].*[A-Z].*|.*[A-Z].*[0-9].*)/', + 'messages' => [ + Regex::NOT_MATCH => 'error_password_pattern', + ], + ], + ], + ], + ], + ], +]; \ No newline at end of file diff --git a/module/fid_adlr/config/user-create-form.php b/module/fid_adlr/config/user-create-form.php index d4ddf59ba3d51815456745a9a8ace4e88ba66148..a6b658fcc51e228da298792aaac07cf0716b8b1b 100644 --- a/module/fid_adlr/config/user-create-form.php +++ b/module/fid_adlr/config/user-create-form.php @@ -27,6 +27,7 @@ use Zend\Form\Element\Checkbox; use Zend\Form\Element\Select; use Zend\Form\Element\Text; use Zend\Validator\NotEmpty; +use Zend\Validator\Regex; use Zend\Validator\StringLength; return [ @@ -149,5 +150,18 @@ return [ 'college' => [ 'required' => true, ], + 'password' => [ + 'validators' => [ + Regex::class => [ + 'name' => Regex::class, + 'options' => [ + 'pattern' => '/(?:.*[0-9].*[A-Z].*|.*[A-Z].*[0-9].*)/', + 'messages' => [ + Regex::NOT_MATCH => 'error_password_pattern', + ], + ], + ], + ], + ], ], ]; \ No newline at end of file diff --git a/themes/fid_adlr/languages/de.ini b/themes/fid_adlr/languages/de.ini index a32d0ae784f77c1a88ea6ddf739538bb2d4ebfe4..f6ad5a13694384df8c45c20cfb5a9f7711bfc60d 100644 --- a/themes/fid_adlr/languages/de.ini +++ b/themes/fid_adlr/languages/de.ini @@ -55,3 +55,6 @@ Adlr Home Services Open Access Title = "adlr.link fördert Open Access" Adlr Home Services Open Access Text = "Zahlreiche Ressourcen, die man über adlr.link findet, sind frei zugänglich. Wir kennzeichnen außerdem Open Access-Dokumente bei den Suchergebnissen besonders." Adlr Home Services Resources Title = "adlr.link lizenziert Ressourcen" Adlr Home Services Resources Text = "Über adlr.link haben alle Nutzerinnen und Nutzer, die hauptberuflich in der Wissenschaft arbeiten, Zugriff auf die spezielle FID-Lizenzen. Außerdem haben wir ein ständig wachsendes Angebot an eigens für adlr.link lizenzierten E-Books." + +# 16180 +error_password_pattern = "Das Passwort muss mindestens eine Ziffer und einen Großbuchstaben enthalten." \ No newline at end of file diff --git a/themes/fid_adlr/languages/en.ini b/themes/fid_adlr/languages/en.ini index 80b66993a549d21552bf7138f20b62cf981470f8..5c39e6eb6b25a16fd80bcc71b5b0fda40ac9625b 100644 --- a/themes/fid_adlr/languages/en.ini +++ b/themes/fid_adlr/languages/en.ini @@ -52,3 +52,6 @@ Adlr Home Services Open Access Title = "adlr.link promotes Open Access" Adlr Home Services Open Access Text = "Many of the resources found via adlr.link are freely accessible. We also mark Open Access documents specifically in the search results." Adlr Home Services Resources Title = "adlr.link licenses resources" Adlr Home Services Resources Text = "Via adlr.link, all users who work full-time in science have access to special FID licenses. In addition, we have a constantly growing range of e-books licensed specifically for adlr.link." + +# 16180 +error_password_pattern = "The password needs to contain at least one digit and one capital letter." \ No newline at end of file