[ldap_crans, gest_crans] redirection mail à l'inscription

darcs-hash:20100901131100-ffbb2-8e57b251130f3a7d1c257c24dc87614710e66fbb.gz
This commit is contained in:
Nicolas Dandrimont 2010-09-01 15:11:00 +02:00
parent b3dd9a4ce2
commit 99c7d8561d
2 changed files with 27 additions and 2 deletions

View file

@ -104,7 +104,11 @@ class home:
for args in self.args:
anim('\t' + args)
try:
home, uid, login = args.split(',')
try:
home, uid, login, mail_redirect = args.split(',')
except ValueError:
home, uid, login = args.split(',')
mail_redirect = None
if home.startswith('/home/') and hostname == "fx":
home = "/home-adh/" + home[6:]
### Home
@ -135,6 +139,11 @@ class home:
os.mkdir('/home-adh/mail/' + login, 0770)
os.chown('/home-adh/mail/' + login, int(uid), 8)
### Redirection
if mail_redirect:
file(home + '/.forward', 'w').write(mail_redirect + '\n')
os.chown(home + '/.forward', int(uid), config.gid)
except:
print ERREUR
if self.debug: