From 579fd5d2782a34d9ed647c985fe1f73d7cd70f04 Mon Sep 17 00:00:00 2001 From: plopoyop Date: Tue, 29 Jul 2014 18:20:29 +0200 Subject: [PATCH] recuperation de l'adresse mail principale --- hooks/post_user_create | 2 +- scripts/install | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hooks/post_user_create b/hooks/post_user_create index d033619..816585b 100755 --- a/hooks/post_user_create +++ b/hooks/post_user_create @@ -17,7 +17,7 @@ sudo rm /tmp/$myuser-install.sql #copy default conf sudo cp /var/www/freshrss/data/user.php.dist /var/www/freshrss/data/$myuser\_user.php #change email -user_email=$(ldapsearch -h localhost -b uid=$myuser,ou=users,dc=yunohost,dc=org -x objectClass=mailAccount mail | grep mail: | grep $myuser| sed 's/mail: //') +user_email=$(ldapsearch -h localhost -b uid=$myuser,ou=users,dc=yunohost,dc=org -x objectClass=mailAccount mail | grep mail: | head -n 1| sed 's/mail: //') sudo sed -i "s/ynoUserEmail/$user_email/g" /var/www/freshrss//data/$myuser\_user.php #change username sudo sed -i "s/YnoUser/$myuser/g" /var/www/freshrss/data/$myuser\_user.php diff --git a/scripts/install b/scripts/install index 37b2cc7..ffd01f6 100755 --- a/scripts/install +++ b/scripts/install @@ -51,7 +51,7 @@ do #copy default conf sudo cp ../conf/dist_user.conf $final_path/data/$myuser\_user.php #change email - user_email=$(ldapsearch -h localhost -b uid=$myuser,ou=users,dc=yunohost,dc=org -x objectClass=mailAccount mail | grep mail: | grep $myuser| sed 's/mail: //') + user_email=$(ldapsearch -h localhost -b uid=$myuser,ou=users,dc=yunohost,dc=org -x objectClass=mailAccount mail | grep mail: | head -n 1| sed 's/mail: //') sudo sed -i "s/ynoUserEmail/$user_email/g" $final_path/data/$myuser\_user.php #change username sudo sed -i "s/YnoUser/$myuser/g" $final_path/data/$myuser\_user.php