a fait 6 mois qu'on surveille les logs de connexion ; dornavant, on
utilise la date d'inscription par dfaut pour ceux qui ne se sont jamais connects. darcs-hash:20060924211837-68412-80588b1599b08f17d341240274efb6e86e879bf5.gz
This commit is contained in:
parent
1b89af3b52
commit
4916f0ab99
1 changed files with 16 additions and 18 deletions
|
@ -28,9 +28,6 @@ mail_sender = u"Comptes inactifs <disconnect@crans.org>"
|
||||||
template_path = '/usr/scripts/templates/comptes_inactifs.%d.txt'
|
template_path = '/usr/scripts/templates/comptes_inactifs.%d.txt'
|
||||||
actions = ('log', 'dump', 'summary', 'spam')
|
actions = ('log', 'dump', 'summary', 'spam')
|
||||||
|
|
||||||
# Date de début d'analyse des logs : 19/03/2006 05:27 GMT
|
|
||||||
oldest_log = 1142746043
|
|
||||||
|
|
||||||
sys.path.append('/usr/scripts/gestion')
|
sys.path.append('/usr/scripts/gestion')
|
||||||
from affich_tools import tableau, cprint
|
from affich_tools import tableau, cprint
|
||||||
from email_tools import send_email, parse_mail_template
|
from email_tools import send_email, parse_mail_template
|
||||||
|
@ -171,7 +168,11 @@ class ComptesInactifs:
|
||||||
pour être sûr).
|
pour être sûr).
|
||||||
"""
|
"""
|
||||||
limit = int(time()) - since
|
limit = int(time()) - since
|
||||||
return self.search('|(!(derniereConnexion=*))(derniereConnexion<=%d)' % limit)
|
liste = self.search("derniereConnexion<=%d" % limit)
|
||||||
|
for x in self.search("!(derniereConnexion=*)"):
|
||||||
|
if x.dateInscription() <= limit:
|
||||||
|
liste.append(x)
|
||||||
|
return liste
|
||||||
|
|
||||||
def do_summary(self):
|
def do_summary(self):
|
||||||
"""
|
"""
|
||||||
|
@ -192,8 +193,6 @@ L
|
||||||
- F : existence d'un .forward
|
- F : existence d'un .forward
|
||||||
- M : existence de mails non lus
|
- M : existence de mails non lus
|
||||||
|
|
||||||
L'analyse des logs remonte au %(oldest)s.
|
|
||||||
|
|
||||||
--
|
--
|
||||||
comptes_inactifs.py
|
comptes_inactifs.py
|
||||||
"""
|
"""
|
||||||
|
@ -228,7 +227,6 @@ comptes_inactifs.py
|
||||||
inscrits = tableau(inscrits, titres, largeurs, alignements)
|
inscrits = tableau(inscrits, titres, largeurs, alignements)
|
||||||
anciens_total = len(anciens)
|
anciens_total = len(anciens)
|
||||||
anciens = tableau(anciens, titres, largeurs, alignements)
|
anciens = tableau(anciens, titres, largeurs, alignements)
|
||||||
oldest = strftime(u'%d/%m/%Y %H:%M', localtime(oldest_log))
|
|
||||||
|
|
||||||
send_email(mail_sender,
|
send_email(mail_sender,
|
||||||
mail_report,
|
mail_report,
|
||||||
|
@ -255,7 +253,7 @@ comptes_inactifs.py
|
||||||
login = a.compte()
|
login = a.compte()
|
||||||
mail = nb_mails_non_lus(login)
|
mail = nb_mails_non_lus(login)
|
||||||
nom = a.Nom()
|
nom = a.Nom()
|
||||||
date = a.derniereConnexion() or oldest_log
|
date = a.derniereConnexion() or a.dateInscription()
|
||||||
date = strftime(u'%d/%m/%Y %H:%M', localtime(date))
|
date = strftime(u'%d/%m/%Y %H:%M', localtime(date))
|
||||||
i = 0
|
i = 0
|
||||||
# est-ce un membre inscrit ?
|
# est-ce un membre inscrit ?
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue