cosmétique minime
This commit is contained in:
@@ -18,7 +18,7 @@ RACINE=$(echo $PRG | awk '{print $1}')
|
||||
TFILE_INT_PAHEKO_ACTION=$(mktemp /tmp/XXXXXXXX_INT_PAHEKO_ACTION.json)
|
||||
TFILE_INT_PAHEKO_IDFILE=$(mktemp /tmp/XXXXXXXX_TFILE_INT_PAHEKO_IDFILE.json)
|
||||
FILE_CREATEUSER="$KAZ_ROOT/tmp/createUser.txt"
|
||||
|
||||
FILE_NOTIFICATION="${KAZ_TEMP_DIR}/${PRG}.txt"
|
||||
sep=' '
|
||||
|
||||
#trap "rm -f ${TFILE_INT_PAHEKO_IDFILE} ${TFILE_INT_PAHEKO_ACTION} " 0 1 2 3 15
|
||||
@@ -59,7 +59,6 @@ ExpMail() {
|
||||
printf "Subject:${MAIL_SUJET}\n${MAIL_TEXTE}" | msmtp ${MAIL_DEST}
|
||||
}
|
||||
|
||||
|
||||
Int_paheko_Action() {
|
||||
# $1 est une action;
|
||||
ACTION=$1
|
||||
@@ -86,7 +85,7 @@ Int_paheko_Action() {
|
||||
done
|
||||
################################
|
||||
# test du mail valide en $domain
|
||||
echo ${email} | grep -i "${domain}" || { echo "Erreur : le mail ${email} n'est pas en ${domain}"; exit ;}
|
||||
echo ${email} | grep -i "${domain}" >/dev/null || { echo "Erreur : le mail ${email} n'est pas en ${domain}"; exit ;}
|
||||
################################
|
||||
#comme tout va bien on continue
|
||||
#on compte le nom de champs dans la zone nom pour gérer les noms et prénoms composés
|
||||
@@ -125,6 +124,8 @@ Int_paheko_Action() {
|
||||
prenom_ok="${prenom_ok#${sep}}"
|
||||
if [ -z "${nom_ok}" ] || [ -z "${prenom_ok}" ]; then
|
||||
ERRMSG="Erreur : Il faut corriger le champ nom qui contient plus de 2 infos dans paheko"
|
||||
OLDIFS=${IFS}
|
||||
IFS=''
|
||||
[ "${IP_MAIL}" = "true" ] && ExpMail ${IP_MAILDEST} "Erreur dans la fiche paheko" "${ERRMSG}" || echo ${ERRMSG}
|
||||
rm -f $FILE_CREATEUSER
|
||||
exit
|
||||
@@ -132,7 +133,6 @@ Int_paheko_Action() {
|
||||
esac
|
||||
# comme l' orga est à null nom orga est a vide, pas d' admin orga, on met dans l' agora générale
|
||||
# pas d' équipe agora et de groupe nextcloud spécifique
|
||||
|
||||
nom_orga=" "
|
||||
admin_orga="N"
|
||||
nc_base="O"
|
||||
@@ -146,7 +146,10 @@ Int_paheko_Action() {
|
||||
[ "$OPTION" = "silence" ] || echo -e "${NC}Orga : ${GREEN}${nom_orga}${NC}"
|
||||
nom_ok=$nom_orga
|
||||
# test des caractères autorisés dans le nom d' orga: lettres, chiffres et/ou le tiret
|
||||
if ! [[ "${nom_ok}" =~ ^[[:alnum:]-]+$ ]]; then
|
||||
if ! [[ "${nom_ok}" =~ ^[[:alnum:]-]+$ ]]
|
||||
then
|
||||
OLDIFS=${IFS}
|
||||
IFS=''
|
||||
ERRMSG="Erreur : l' orga doit être avec des lettres et/ou des chiffres. Le séparateur doit être le tiret"
|
||||
[ "${IP_MAIL}" = "true" ] && ExpMail ${IP_MAILDEST} "Erreur dans la fiche Paheko" "${ERRMSG}" || echo ${ERRMSG}
|
||||
rm -f $FILE_CREATEUSER
|
||||
|
||||
Reference in New Issue
Block a user