Plus d'invits.
darcs-hash:20060323150946-68412-e53639e21442ce0cd6006e8eff8cb521344eb9a8.gz
This commit is contained in:
parent
bfed30d32a
commit
1c7207577b
7 changed files with 11 additions and 42 deletions
|
@ -304,7 +304,7 @@ Message cr
|
|||
# à cause de leur firewall et de leur patte wifi.
|
||||
NETs = { 'wifi' : [ '138.231.149.0/24', '138.231.150.0/24' ],
|
||||
'wifi-ens' : [ '138.231.151.0/25' ],
|
||||
'wifi-invite' : [ '138.231.151.128/25'],
|
||||
'wifi-invite' : [ '138.231.151.128/25'], # inutilisé
|
||||
'b' : [ '138.231.137.0/24' ],
|
||||
'm' : [ '138.231.138.0/24' ],
|
||||
'c' : [ '138.231.139.0/24' ],
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
#! /usr/bin/env python
|
||||
# -*- coding: iso-8859-15 -*-
|
||||
|
||||
import sys
|
||||
sys.path.append('/usr/scripts/gestion')
|
||||
|
||||
from ldap_crans import Invite, crans_ldap
|
||||
|
||||
machines = crans_ldap().search('host=invite-ens-*.wifi.crans.org','w')['machine']
|
||||
|
||||
for m in machines :
|
||||
if m.proprietaire().__class__ == Invite :
|
||||
m.delete('Machine invitée de l\'ens - détruite par cron')
|
|
@ -28,7 +28,7 @@ sys.path.append('/usr/scripts/gestion')
|
|||
import syslog
|
||||
import pwd
|
||||
from lock import *
|
||||
from ldap_crans import crans_ldap, ann_scol, crans, Invite, hostname
|
||||
from ldap_crans import crans_ldap, ann_scol, crans, hostname
|
||||
from ldap_crans import Machine, MachineWifi
|
||||
from affich_tools import *
|
||||
from commands import getstatusoutput
|
||||
|
@ -287,10 +287,9 @@ class firewall_crans :
|
|||
# Mise à jour de la machine
|
||||
if AddrInNet(ip,self.zone_serveur) :
|
||||
serveur_maj = True
|
||||
# Il faut avoir payé ou être une machine du crans ou un invite
|
||||
# Il faut avoir payé ou être une machine du crans
|
||||
if db.search('paiement=ok&ip=%s'% ip)['machine'] or \
|
||||
machine[0].proprietaire().__class__ == crans or \
|
||||
machine[0].proprietaire().__class__ == Invite :
|
||||
machine[0].proprietaire().__class__ == crans:
|
||||
mac_ip_maj[ip] = machine[0]
|
||||
else :
|
||||
mac_ip_maj[ip] = None
|
||||
|
|
|
@ -6,7 +6,7 @@ from gen_confs import gen_config, ERREUR, OK, anim
|
|||
|
||||
import sys, os, shutil
|
||||
sys.path.append('/usr/scripts/gestion')
|
||||
from ldap_crans import crans_ldap, Invite, BorneWifi
|
||||
from ldap_crans import crans_ldap, BorneWifi
|
||||
|
||||
class conf_wifi_ng(gen_config) :
|
||||
""" Génération de la configuration de isakmpd dans ISAKMPD_CONF
|
||||
|
@ -46,8 +46,7 @@ class conf_wifi_ng(gen_config) :
|
|||
|
||||
def _gen(self):
|
||||
self.anim=anim('\r\tRecherche base LDAP')
|
||||
clients = self.db.search('host=*.wifi.crans.org&paiement=ok')['machineWifi'] + \
|
||||
Invite().machines()
|
||||
clients = self.db.search('host=*.wifi.crans.org&paiement=ok')['machineWifi']
|
||||
bornes = self.db.search('host=*.wifi.crans.org&canal=*')['borneWifi']
|
||||
|
||||
print OK
|
||||
|
|
|
@ -804,8 +804,6 @@ class crans_ldap:
|
|||
if graphic: cprint('Lecture base LDAP', 'gras')
|
||||
# Machines de l'assoce
|
||||
self.__machines = crans(self.conn).machines()
|
||||
# Machines des invités
|
||||
self.__machines += Invite(self.conn).machines()
|
||||
# Machines des adhérents et clubs de l'année en cours
|
||||
base = self.search('paiement=ok')
|
||||
base = base['adherent'] + base['club']
|
||||
|
@ -2198,7 +2196,7 @@ class Machine(base_classes_crans):
|
|||
# Propriéraire inconnu mais ce n'est pas grave
|
||||
self.__proprietaire = None
|
||||
|
||||
elif t in [ adherent, club, crans, Invite ] and typ in [ 'fixe' , 'wifi' , 'borne' ]:
|
||||
elif t in [ adherent, club, crans ] and typ in [ 'fixe' , 'wifi' , 'borne' ]:
|
||||
# Machine vide
|
||||
self.__proprietaire = parent_or_tuple
|
||||
self.dn = parent_or_tuple.dn
|
||||
|
@ -2407,9 +2405,7 @@ class Machine(base_classes_crans):
|
|||
|
||||
# Dans quel réseau la machine doit-elle être placée ?
|
||||
if self.__typ == 'wifi':
|
||||
if self.proprietaire().__class__ == Invite:
|
||||
net = config.NETs['wifi-invite']
|
||||
elif self.proprietaire().etudes(0) == "ENS" and self.proprietaire().etudes(1) == "Pers":
|
||||
if self.proprietaire().etudes(0) == "ENS" and self.proprietaire().etudes(1) == "Pers":
|
||||
# Personnel ENS
|
||||
net = config.NETs['wifi-ens']
|
||||
else:
|
||||
|
@ -2516,7 +2512,7 @@ class Machine(base_classes_crans):
|
|||
|
||||
def proprietaire(self):
|
||||
"""
|
||||
retroune le propriétaire de la machine (classe adherent, club ou crans ou Invite)
|
||||
retroune le propriétaire de la machine (classe adherent, club ou crans)
|
||||
"""
|
||||
if not self.__proprietaire:
|
||||
res = self.conn.search_s(','.join(self.dn.split(',')[1:]), 0)
|
||||
|
@ -2524,8 +2520,6 @@ class Machine(base_classes_crans):
|
|||
self.__proprietaire = adherent(res[0], self._modifiable, self.conn)
|
||||
elif 'club' in res[0][1]['objectClass']:
|
||||
self.__proprietaire = club(res[0], self._modifiable, self.conn)
|
||||
elif 'invite' in res[0][0]:
|
||||
self.__proprietaire = Invite(self.conn)
|
||||
else:
|
||||
self.__proprietaire = crans(self.conn)
|
||||
|
||||
|
@ -2923,16 +2917,6 @@ class crans(_FakeProprio):
|
|||
def chbre(self):
|
||||
return u"CRA"
|
||||
|
||||
class Invite(_FakeProprio):
|
||||
""" Propriétaire des machines invitées """
|
||||
def __init__(self, conn=None):
|
||||
_FakeProprio.__init__(self, conn)
|
||||
self.dn = "ou=invites," + self.base_dn
|
||||
def Nom(self):
|
||||
return u"Invité"
|
||||
def chbre(self):
|
||||
return u"N/A"
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ from pyPgSQL import PgSQL
|
|||
sys.path.append('/usr/scripts/gestion')
|
||||
from config import upload, virus, p2p, NETs
|
||||
import smtplib
|
||||
from ldap_crans import crans_ldap, crans, invite, base_classes_crans
|
||||
from ldap_crans import crans_ldap, crans, base_classes_crans
|
||||
from ldap_crans import MachineWifi
|
||||
from time import *
|
||||
import locale
|
||||
|
|
|
@ -7,7 +7,7 @@ from session import session
|
|||
from utilisateurs import users
|
||||
|
||||
sys.path.append('/usr/scripts/gestion')
|
||||
from ldap_crans import crans_ldap, invite
|
||||
from ldap_crans import crans_ldap
|
||||
db = crans_ldap()
|
||||
|
||||
######################################################
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue