]>
gitweb.pimeys.fr Git - scripts-20-100.git/blob - bde/old/big_brother.py
4 # vieilles version de big_brother, la version propre et à jour est dans /usr/script/gestion
6 from commands
import getstatusoutput
as ex
9 # liste des supremes connus
10 known
= "(2430,1767,2821,2221,2863,2882,3019,1230,2969,2804,1206,250,2837,2832,2850)"
12 message
= "\nDroits supreme :\n"
13 supremes
=ex("psql bde -c 'SELECT numcbde,prenom,nom,pseudo FROM adherents WHERE supreme=true AND NOT numcbde IN %s;'"%(known))[1]
15 i
=supremes
.split()[-2]
17 message
+="(Seulement des gens connus)\n"
19 message
+="!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"+supremes
22 message
+= "\n\nDroits invités :\n"
23 droits_invites
=ex('psql bde -c"SELECT numcbde,prenom,nom,pseudo FROM adherents WHERE droits&128!=0 AND supreme=false AND numcbde!=0;"')[1]
24 i
=droits_invites
.split()[-2]
26 message
+="(Personne à part les supreme)"
28 message
+="!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"+droits_invites
31 header
= "From: note-bigbrother@bde.crans.org\nTo: root\n"
32 header
+= "Subject: Résumé des droits\n"
33 mailer
=os
.popen("/usr/sbin/sendmail -t", "w")
34 mailer
.write(header
+message
+'\n.')