Commit 2893473d authored by Daniel STAN's avatar Daniel STAN

portail_captif: lien spécial pour register une mac

parent 112f4304
......@@ -134,6 +134,25 @@ def get_page(ip, by_mac=False, accueil=False):
if accueil:
return deco['inscrit']
return None
def special(action, ip, environ, start_response):
mac = mac_from_ip(ip)
url = ""
if 'wifi' in action:
url += 'wifi/'
url += 'fil/'
if mac is not None:
url += mac + '/'
start_response("302 OK", [
("Content-Type", "text/html"),
("Cache-Control", "no-cache, must-revalidate"),
("Expires", "Thu, 01 Jan 1970 00:00:00 GMT"),
("Location", url),
("Content-Length", 0)
return ""
def app(environ, start_response):
if 'HTTP_K_REAL_IP' in environ.keys():
......@@ -142,6 +161,8 @@ def app(environ, start_response):
if environ.get('RAW_URI', '').startswith('/special'):
return special(environ.get('RAW_URI','')[9:], ip, environ, start_response)
if AddrInNet(ip, ''):
if environ.get('RAW_URI', '').startswith('/enable'):
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment