resetdb: supprime la regexp de validation sur pslBadgeCSN (#33401)

This commit is contained in:
Benjamin Dauvergne 2019-05-24 13:31:11 +02:00
parent af2c7c7e96
commit 842a431cd1
2 changed files with 3 additions and 4 deletions

View File

@ -227,7 +227,6 @@ olcConstraintAttribute: supannEtablissement,
supannEtuTypeDiplome,
regex "^\{[^}]+\}.*$"
olcConstraintAttribute: supannEtuAnneeInscription regex "^[0-9][0-9][0-9][0-9]$"
olcConstraintAttribute: pslBadgeCSN regex "^[0-9A-F]{8,14}$"
add olcOverlay={4}unique,olcDatabase={2}mdb,cn=config
objectClass: olcOverlayConfig

View File

@ -135,12 +135,12 @@ olcConstraintAttribute: supannAliasLogin regex "^[[:alnum:]]+$"
EOF
echoonerror ldapmodify -H ldapi:// -Y EXTERNAL -f $LDIF && echo "- contrainte supannAliasLogin retiré"
fi
# add the pslBadgeCSN constraint
if ! (ldapsearch -H ldapi:// -Y EXTERNAL -b "$DN2" 'olcConstraintAttribute=pslBadgeCSN regex "^[0-9A-F]{8,14}$"' 2>/dev/null | grep -q ^olc); then
# remove the pslBadgeCSN constraint
if (ldapsearch -H ldapi:// -Y EXTERNAL -b "$DN2" 'olcConstraintAttribute=pslBadgeCSN regex "^[0-9A-F]{8,14}$"' 2>/dev/null | grep -q ^olc); then
cat <<EOF >$LDIF
dn: $DN2
changetype: modify
add: olcConstraintAttribute
delete: olcConstraintAttribute
olcConstraintAttribute: pslBadgeCSN regex "^[0-9A-F]{8,14}$"
EOF
echoonerror ldapmodify -H ldapi:// -Y EXTERNAL -f $LDIF && echo "- contrainte pslBadgeCSN ajouté"