Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
t3o
my.typo3.org
Commits
bb2a7875
Commit
bb2a7875
authored
Jul 12, 2018
by
Thomas Löffler
Browse files
Add validation of username to not allow capital chars
parent
b386848d
Pipeline
#4935
failed with stages
in 13 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
html/typo3conf/ext/t3omy/Classes/Domain/Validator/ServersideValidator.php
View file @
bb2a7875
...
...
@@ -69,6 +69,10 @@ class ServersideValidator extends \In2code\Femanager\Domain\Validator\Serverside
$this
->
checkUniqueInLdapValidation
(
$user
,
$value
,
$validationSetting
,
$fieldName
);
break
;
case
'lowerChars'
:
$this
->
checkLowerCharsValidation
(
$user
,
$value
,
$validationSetting
,
$fieldName
);
break
;
case
'notInOldUserTable'
:
$this
->
notInOldUserTableValidation
(
$user
,
$value
,
$validationSetting
,
$fieldName
);
break
;
...
...
@@ -122,6 +126,21 @@ class ServersideValidator extends \In2code\Femanager\Domain\Validator\Serverside
}
}
/**
* @param \In2code\Femanager\Domain\Model\User $user
* @param string $value
* @param array $validationSetting
* @param string $fieldName
* @return void
*/
protected
function
checkLowerCharsValidation
(
$user
,
$value
,
$validationSetting
,
$fieldName
)
{
if
(
preg_match
(
'/[A-Z]/'
,
$value
)
!==
false
)
{
$this
->
addError
(
ucfirst
(
$fieldName
)
.
' may not contain upper case characters!'
,
$fieldName
);
$this
->
isValid
=
false
;
}
}
/**
* @param \In2code\Femanager\Domain\Model\User $user
* @param $value
...
...
html/typo3conf/ext/t3omy/Configuration/TypoScript/femanager.txt
View file @
bb2a7875
...
...
@@ -14,6 +14,7 @@ plugin.tx_femanager {
uniqueInDb = 0
uniqueInLdap = 1
notInOldUserTable = 1
lowerChars = 1
}
password {
min = 12
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment