ILIAS
release_6 Revision v6.24-5-g0c8bfefb3b8
◀ ilDoc Overview
HasSpecialChars.php
Go to the documentation of this file.
1
<?
php
2
/* Copyright (c) 2018 Nils Haagen <nils.haagen@concepts-and-training.de> Extended GPL, see docs/LICENSE */
3
4
namespace
ILIAS\Refinery\Password
;
5
6
use
ILIAS\Refinery\Custom\Constraint
as CustomConstraint;
7
use
ILIAS\Refinery\Constraint
;
8
use
ILIAS\Data
;
9
10
class
HasSpecialChars
extends
CustomConstraint implements
Constraint
11
{
12
protected
static
$ALLOWED_CHARS
=
'/[,_.\-#\+\*?!%ยง\(\)\$]/'
;
13
14
public
function
__construct
(Data\
Factory
$data_factory
, \
ilLanguage
$lng
)
15
{
16
parent::__construct
(
17
function
(Data\
Password
$value) {
18
return
(
bool
) preg_match(static::$ALLOWED_CHARS, $value->toString());
19
},
20
function
($value) {
21
return
"Password must contain special chars."
;
22
},
23
$data_factory
,
24
$lng
25
);
26
}
27
}
php
An exception for terminatinating execution or to throw for unit testing.
ILIAS\Data\Factory
Builds data types.
Definition:
Factory.php:20
ILIAS\Data\Password
A password is used as part of credentials for authentication.
Definition:
Password.php:14
ILIAS\Refinery\Custom\Constraint
Definition:
Constraint.php:13
ILIAS\Refinery\Custom\Constraint\$data_factory
$data_factory
Definition:
Constraint.php:20
ILIAS\Refinery\Custom\Constraint\$lng
$lng
Definition:
Constraint.php:25
ILIAS\Refinery\Password\HasSpecialChars
Definition:
HasSpecialChars.php:11
ILIAS\Refinery\Password\HasSpecialChars\__construct
__construct(Data\Factory $data_factory, \ilLanguage $lng)
Definition:
HasSpecialChars.php:14
ILIAS\Refinery\Password\HasSpecialChars\$ALLOWED_CHARS
static $ALLOWED_CHARS
Definition:
HasSpecialChars.php:12
ilLanguage
language handling
Definition:
class.ilLanguage.php:27
ILIAS\Refinery\Constraint
A constraint encodes some resrtictions on values.
Definition:
Constraint.php:15
ILIAS\Data
Definition:
Alphanumeric.php:10
ILIAS\GlobalScreen\Provider\__construct
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Definition:
PluginProviderHelper.php:30
ILIAS\Refinery\Password
Definition:
Group.php:4
src
Refinery
Password
HasSpecialChars.php
Generated on Sat Oct 4 2025 20:01:11 for ILIAS by
1.9.4 (using
Doxyfile
)