ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ 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\Validation\Constraints\Password
;
5
6
use
ILIAS\Validation\Constraints
;
7
use
ILIAS\Validation\Constraint
;
8
use
ILIAS\Data
;
9
10
class
HasSpecialChars
extends
Constraints\Custom
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
}
ILIAS\Validation\Constraints\Password
Definition:
Factory.php:4
ILIAS\Validation\Constraints\Password\HasSpecialChars\$ALLOWED_CHARS
static $ALLOWED_CHARS
Definition:
HasSpecialChars.php:12
ILIAS\Validation\Constraint
A constraint encodes some resrtictions on values.
Definition:
Constraint.php:14
ILIAS\Validation\Constraints\Custom\$lng
$lng
Definition:
Custom.php:20
ILIAS\Data\Password
A password is used as part of credentials for authentication.
Definition:
Password.php:13
Constraint
ILIAS\Validation\Constraints\Password\HasSpecialChars
Definition:
HasSpecialChars.php:10
ILIAS\Data\Factory
Builds data types.
Definition:
Factory.php:14
ILIAS\Validation\Constraints\Custom
Definition:
Custom.php:10
ILIAS\Validation\Constraints
Definition:
Custom.php:4
ILIAS\Validation\Constraints\Custom\$data_factory
$data_factory
Definition:
Custom.php:15
ilLanguage
language handling
Definition:
class.ilLanguage.php:26
php
ILIAS\Data
Definition:
ClientId.php:4
ILIAS\Validation\Constraints\Password\HasSpecialChars\__construct
__construct(Data\Factory $data_factory, \ilLanguage $lng)
Definition:
HasSpecialChars.php:14
src
Validation
Constraints
Password
HasSpecialChars.php
Generated on Thu Jan 30 2025 19:02:12 for ILIAS by
1.8.13 (using
Doxyfile
)