From cc28aebe4ec90048806874e73e874b36ccae756b Mon Sep 17 00:00:00 2001 From: didier Date: Thu, 20 Aug 2026 11:53:37 +0200 Subject: [PATCH] gestion de l'attribut mobile mobile --- bin/gestUsers.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/bin/gestUsers.sh b/bin/gestUsers.sh index 0988df2..05b0814 100755 --- a/bin/gestUsers.sh +++ b/bin/gestUsers.sh @@ -220,6 +220,11 @@ infoEmail() { echo -ne "${GREEN}" ldapsearch -H ldap://${LDAP_IP} -D "cn=${LDAP_ADMIN_USERNAME},${ldap_root}" -x -w "${LDAP_ADMIN_PASSWORD}" -b "cn=${CHOIX_MAIL},ou=users,${ldap_root}" | grep -i maildeSecours | sed -e 's/mailDeSecours://' echo -ne "${NC}" + echo -ne " - Tel Mobile : " + echo -ne "${GREEN}" + REPMOBILE=$(ldapsearch -H ldap://${LDAP_IP} -D "cn=${LDAP_ADMIN_USERNAME},${ldap_root}" -x -w "${LDAP_ADMIN_PASSWORD}" -b "cn=${CHOIX_MAIL},ou=users,${ldap_root}" | grep -i mobile | sed -e 's/mobile://') + [ -z ${REPMOBILE} ] && echo "NC" || echo ${REPMOBILE} + echo -ne "${NC}" echo -n " - Alias (Ldap) : " echo -ne "${GREEN}" LDAP_ALIAS=$(ldapsearch -H ldap://${LDAP_IP} -D "cn=${LDAP_ADMIN_USERNAME},${ldap_root}" -x -w "${LDAP_ADMIN_PASSWORD}" -b "cn=${CHOIX_MAIL},ou=users,${ldap_root}" | grep -i alias | cut -c 11-60) @@ -881,7 +886,7 @@ updateUser() { MAILDESECOURSACTUEL="" MAILDESECOURS="" Ucompteur=1 - for attribut in mailDeSecours mailAlias mailQuota nextcloudQuota + for attribut in mailDeSecours mailAlias mailQuota nextcloudQuota mobile do ATTRIB+=([${attribut}]=$(ldapsearch -H ldap://${LDAP_IP} \ -x -D "cn=${LDAP_ADMIN_USERNAME},${ldap_root}" \ @@ -960,6 +965,18 @@ updateUser() { fi faitAttrib=0 ;; + mobile ) + read -p "Quel est le numéo du mobile au format 0XXXXXXXXXXX : " RCHANGE + if [[ ${RCHANGE} =~ ^[0-9]+$ ]] && [ "$(echo ${RCHANGE} | wc -L)" -eq "10" ] + then + # prévoir un passage en +33XXXXXXXXXX ? + CHANGED+=([mobile]="${RCHANGE}") + else + echo "Valeur incorecte" + sleep 3 + fi + faitAttrib=0 + ;; mailDeSecours ) echo "------------------------------------------------" read -p " - Nouveau Mail de Secours : " RCHANGE