Commit af193abc authored by Stefan Busemann's avatar Stefan Busemann
Browse files

Merge branch '157-allow-only-lower-chars-as-username' into 'develop'

Resolve "allow only lower chars as username"

See merge request !79
parents ccc55d9a 6a88476b
Pipeline #4950 passed with stages
in 7 minutes and 56 seconds
......@@ -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,20 @@ class ServersideValidator extends \In2code\Femanager\Domain\Validator\Serverside
}
}
/**
* @param \In2code\Femanager\Domain\Model\User $user
* @param string $value
* @param array $validationSetting
* @param string $fieldName
*/
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
......
......@@ -14,6 +14,7 @@ plugin.tx_femanager {
uniqueInDb = 0
uniqueInLdap = 1
notInOldUserTable = 1
lowerChars = 1
}
password {
min = 12
......
......@@ -160,7 +160,7 @@
<!-- ///////////////////////////////////////////////////// -->
<p style="Margin:0;color:#f49800;font-family:'Source Sans Pro', 'Helvetica', 'Arial', sans-serif;font-size:22px;font-weight:400;line-height:30px;margin:0;padding:0;text-align:center;text-transform: uppercase;">
<p style="Margin:0;color:#f49800;font-family:'Source Sans Pro', 'Helvetica', 'Arial', sans-serif;font-size:22px;font-weight:400;line-height:30px;margin:0;padding:0;text-align:center;">
<stong>Hi {user.username},</stong>
</p>
......
......@@ -233,7 +233,7 @@
<!-- ///////////////////////////////////////////////////// -->
<p style="Margin:0;color:#f49800;font-family:'Source Sans Pro', 'Helvetica', 'Arial', sans-serif;font-size:22px;font-weight:400;line-height:30px;margin:0;padding:0;text-align:center;text-transform: uppercase;">
<p style="Margin:0;color:#f49800;font-family:'Source Sans Pro', 'Helvetica', 'Arial', sans-serif;font-size:22px;font-weight:400;line-height:30px;margin:0;padding:0;text-align:center;">
<stong>Dear {user.name},</stong>
</p>
......
......@@ -161,7 +161,7 @@
<!-- ///////////////////////////////////////////////////// -->
<p style="Margin:0;color:#f49800;font-family:'Source Sans Pro', 'Helvetica', 'Arial', sans-serif;font-size:22px;font-weight:400;line-height:30px;margin:0;padding:0;text-align:center;text-transform: uppercase;">
<p style="Margin:0;color:#f49800;font-family:'Source Sans Pro', 'Helvetica', 'Arial', sans-serif;font-size:22px;font-weight:400;line-height:30px;margin:0;padding:0;text-align:center;">
<stong>Dear <a href="https://typo3.org" style="text-decoration: none; color:#f49800">typo3.org</a> user,</stong>
</p>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment