Possibilit de changer le shell d'un utilisateur.
darcs-hash:20040910174155-41617-2acf4708eaac3b35800cd31433d98040a8a0681b.gz
This commit is contained in:
parent
01a4e8377f
commit
d512b263ae
2 changed files with 23 additions and 1 deletions
|
@ -1003,6 +1003,7 @@ def modif_adher(adher) :
|
|||
arg+= u'"Remarque" "Ajouter ou modifer un commentaire" '
|
||||
if isadm :
|
||||
arg+= u'"Droits" "Modifier les droits alloués à cet adhérent" '
|
||||
arg+= u'"Shell" "Changer le shell de cet utilisateur" '
|
||||
if isdeconnecteur :
|
||||
arg+= u'"Blackliste" "Modifier la blackliste de cet adhérent" '
|
||||
annul, res = dialog(arg)
|
||||
|
@ -1095,6 +1096,21 @@ def modif_adher(adher) :
|
|||
elif res[0]=='Alias' :
|
||||
__prompt_input_menu(adher.alias,'Alias mail', "Entrez ou modifier un alias mail.\nPour ajouter un alias modifier le dernier de la liste.")
|
||||
|
||||
elif res[0]=='Shell' :
|
||||
while 1 :
|
||||
arg = u'--title "Nouveau shell pour %s" ' % adher.Nom()
|
||||
arg+= u'--inputbox "Shell : " 0 0 "%s" ' % adher.chsh()
|
||||
annul,res = dialog(arg)
|
||||
if annul : return 1
|
||||
|
||||
try :
|
||||
adher.chsh(res[0])
|
||||
break
|
||||
except ValueError, c :
|
||||
arg = u'--title "Changement du shell de %s" ' % adher.Nom()
|
||||
arg+= u'--msgbox "%s\n\n\n" 0 0' % c.args[0]
|
||||
dialog(arg)
|
||||
|
||||
if adher.modifs :
|
||||
return confirm(adher)
|
||||
|
||||
|
|
|
@ -1365,7 +1365,13 @@ class adherent(base_proprietaire) :
|
|||
|
||||
def chsh(self,new=None) :
|
||||
""" Retourne ou change le shell de l'adhérent """
|
||||
pass
|
||||
if new == None :
|
||||
try : return decode(self._data.get('loginShell',[''])[0])
|
||||
except : return ''
|
||||
else :
|
||||
new = preattr(new)[1]
|
||||
self._set('loginShell',[new])
|
||||
return new
|
||||
|
||||
def cannonical_alias(self,new=None) :
|
||||
""" Retourne ou défini l'alias canonique"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue