From 03aa8b4f5b7b15a7eae484e75fc6010b6d66a9f8 Mon Sep 17 00:00:00 2001 From: Daniel STAN Date: Tue, 2 Oct 2012 02:28:52 +0200 Subject: [PATCH] [radius_auth] stop hardcoding Ignore-this: eb7b310fa8e8113a0e7c70e6d629610f darcs-hash:20121002002852-28565-5df5528158dec661ee3d76cbafadb7bef7c6d055.gz --- radius_auth.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/radius_auth.py b/radius_auth.py index 7554f4ea..66dabd23 100644 --- a/radius_auth.py +++ b/radius_auth.py @@ -6,7 +6,7 @@ from syslog import syslog, openlog sys.path.append('/usr/scripts/gestion') from ldap_crans import crans_ldap, AssociationCrans, Club -from config import ann_scol, dat, vlans +from config import ann_scol, dat, vlans, periode_transitoire from iptools import AddrInNet def chap_ok(password, challenge, clear_pass) : """ Test l'authentification chap fournie @@ -66,11 +66,9 @@ def do_auth(mac): # Paiment ok ? paid = max(proprio.paiement() + [0]) - if dat[1] in (8, 9): - # En septembre les anciennes adhésions sont OK - ann_scol -= 1 - elif dat[1] == 10 and dat[2] in (1,2,3): - # On laisse 3 jours ou les gens ont une page sur squid + if periode_transitoire: + # Si periode transitoire, on accepte les personnes n'ayant pas + # réadhéré ann_scol -= 1 if ann_scol > paid: return (0, "N'a pas payé", "accueil")