Commit f1e8b69d authored by Arnaud Pauget's avatar Arnaud Pauget
Browse files

Merge branch 'develop' into 'Support/2.8.X'

fix(19647) : changing the pattern regex in html to prevent validation error...

See merge request !718
parents 959b9fb0 d887b830
Pipeline #18116 failed with stages
in 22 seconds
# CHANGELOG
## Version 2.8.3
- `Fixed` Recherche par côte d'archive non fonctionnelle.
- `Fixed` Vérification du pattern de l'adresse email lors de la création d'un nouvel utilisateur.
## Version 2.8.2
- `Changed` Possibilité d'ajouter des caractères spéciaux dans les identifiants d'organisations.
- `Fixed` Blocage du process d'extraction fulltext si un document était en erreur dans Apache Tika.
......
......@@ -223,6 +223,11 @@ class userAccount
$userAccount->accountId = \laabs::newId();
$userAccount->accountType = 'user';
if (!is_null($userAccount->emailAddress) && !filter_var($userAccount->emailAddress, FILTER_VALIDATE_EMAIL)) {
$validationErrors = ["Email malformed"];
throw \laabs::newException("auth/invalidUserInformationException", $validationErrors);
}
$organizationController = \laabs::newController('organization/organization');
if (!is_null($organizations)) {
$organization = $organizationController->read($organizations[0]);
......
......@@ -85,6 +85,10 @@ trait archiveAccessTrait
$checkAccess = true,
$maxResults = null
) {
if(is_null($originatorArchiveId)) {
$originatorArchiveId = $archiverArchiveId;
}
$accountController = \laabs::newController('auth/userAccount');
$accountController->isAuthorized('user');
......@@ -1035,6 +1039,11 @@ trait archiveAccessTrait
$queryParts['archiverArchiveId'] = "archiverArchiveId= :archiverArchiveId";
$queryParams['archiverArchiveId'] = $args['archiverArchiveId'];
}
if (!empty($args['originatorArchiveId']) && !empty($args['archiverArchiveId']) && $args['originatorArchiveId'] == $args['archiverArchiveId']) {
$queryParts['originatorArchiveId'] = "(archiveId= :archiveId OR originatorArchiveId= :originatorArchiveId OR archiverArchiveId= :archiverArchiveId)";
$queryParams['archiveId'] = $args['originatorArchiveId'];
unset($queryParts['archiverArchiveId']);
}
if (!empty($args['originatingDate'])) {
if (!empty($args['originatingDate'][0]) && is_string($args['originatingDate'][0])) {
$args['originatingDate'][0] = \laabs::newDate($args['originatingDate'][0]);
......
......@@ -279,7 +279,7 @@
}
function validateEmail($email) {
var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
var emailReg = /(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/;
return emailReg.test($email);
}
......
......@@ -339,7 +339,7 @@ FulltextSearchForm = {
} else if ($(this).hasClass('dateTimePicker')) {
var operation = ($(this).data('range') == 'start') ? ">=" : "<=";
// TODO fix datetime sent in params with a date conversion (done @rm/archives/search.html)
value = name + operation + "'" + $(this).data('DateTimePicker').date().format('YYYY-MM-DD HH:MM:SS') + "'";
value = name + operation + "'" + $(this).data('DateTimePicker').date().format('YYYY-MM-DD HH:mm:ss') + "'";
// Fill start and end values
if (query.description[name] == undefined) {
......
Supports Markdown
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