INNER CODE UNIT · Python
Index
ab77/netflix-proxy · auth/auth.py:323
class Index:
def GET(self):
ipaddr = get_client_public_ip()
is_ipv4 = web.net.validipaddr(ipaddr)
is_ipv6 = web.net.validip6addr(ipaddr)
if AUTO_AUTH:
if ipaddr:
web.debug('AUTO_AUTH: %s' % ipaddr)
if is_ipv4: result = run_ipt_cmd(ipaddr, 'I')
if is_ipv6: result = run_ipt6_cmd(ipaddr, 'I')
web.debug('iptables_update: %s' % [result])
if result[0] == 0:
flash('success', 'automatically authorized %s' % ipaddr)
return render.redirect(get_redirect_page())
else:
flash('error', 'unable to automatically authorize %s' % ipaddr)