Changeset 10471 in hybrid for branches/releng-9.0/nanobsd/files/usr/local
- Timestamp:
- Apr 13, 2012, 4:32:48 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/releng-9.0/nanobsd/files/usr/local/www/wlportal/index.cgi
r10419 r10471 39 39 import urlparse 40 40 import yaml 41 42 from jinja2 import Template 41 43 42 44 # XXX: Make me dynamic for example put me in the conf file … … 55 57 'expire_time' : None, 56 58 'accessdb' : '/var/db/clients', 59 'net_status' : '/tmp/network.status', 57 60 } 58 61 … … 62 65 if os.path.isfile(cfg['config_file']): 63 66 cfg.update(yaml.load(open(cfg['config_file']))) 67 68 internet_up = True 69 if os.path.isfile(cfg['net_status']): 70 internet_up = 'internet=up' in open(cfg['net_status'], 'r').read().lower() 71 72 if not internet_up: 73 cfg['warning_msg'] = "<b>Internet Problemen</b>: De laatste 15 minuten zijn er problemen met de (internet) verbinding geconstateerd, de gebruikers ervaring kan dus niet optimaal zijn. Onze excuses voor het eventuele ongemak. Bij aanhoudende problemen kunt u contact opnemen met gebruikers@lijst.wirelessleiden.nl" 64 74 65 75 def log_registered_host(remote_mac, remote_host): … … 233 243 # Helpers for HTML 'templates' 234 244 content = cfg.copy() 235 content.update(extra_header='' ,tech_footer='',status_msg='')245 content.update(extra_header='') 236 246 237 247 # IP or MAC on the whitelist does not need to authenticate, used for devices … … 309 319 """ 310 320 311 print page % content321 print Template(page).render(content)
Note:
See TracChangeset
for help on using the changeset viewer.