gestion de l'attribut mobile mobile

This commit is contained in:
2026-08-20 11:54:05 +02:00
parent f55dffadf8
commit cc28aebe4e
+18 -1
View File
@@ -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