Modification de getlogin en pwd.getpwuid(os.getuid())[0]

darcs-hash:20040910132908-d1718-61b89fc455a3a225abac8562e81724538a3a57f2.gz
This commit is contained in:
bernat 2004-09-10 15:29:08 +02:00
parent d0c09e1953
commit a1b52e559d
4 changed files with 50 additions and 9 deletions

View file

@ -22,7 +22,7 @@ smtpserv = "localhost"
# TODO :
# Interdire la modif des comptes nounou
import smtplib, sre, os, random, string, time, sys
import smtplib, sre, os, random, string, time, sys, pwd
import ldap, ldap.modlist
import config, annuaires, iptools, chgpass, user_tests
@ -698,7 +698,7 @@ class base_classes_crans(crans_ldap) :
else :
modif=', '.join(self.modifs)
hist = "%s, %s" % ( time.strftime(date_format), os.getlogin() )
hist = "%s, %s" % ( time.strftime(date_format), pwd.getpwuid(os.getuid())[0] )
# Suffit-t-il d'ajouter un item au dernier élément de l'historique ?
try:
@ -786,7 +786,7 @@ class base_classes_crans(crans_ldap) :
""" Sauvegarde puis destruction du dn (et des sous-dn) fourni """
if not self.conn : self.connect()
data = self.conn.search_s(dn,2)
txt = "%s # Destruction le %s par %s" % (data, time.strftime(date_format), os.getlogin())
txt = "%s # Destruction le %s par %s" % (data, time.strftime(date_format), pwd.getpwuid(os.getuid())[0])
if comment :
txt += ' (%s)' % comment
txt += '\n'