From 817713dc33ae88217b61c73d4b9b0446a1a89855 Mon Sep 17 00:00:00 2001 From: Arturo FilastoĢ€ Date: Wed, 24 Aug 2011 18:22:37 +0200 Subject: Require login for tor status page --- packages/torouter-web/src/tui/controllers/tor.py | 32 ++++++++++++++++-------- 1 file changed, 21 insertions(+), 11 deletions(-) (limited to 'packages/torouter-web/src') diff --git a/packages/torouter-web/src/tui/controllers/tor.py b/packages/torouter-web/src/tui/controllers/tor.py index 491c6b7..e671d80 100644 --- a/packages/torouter-web/src/tui/controllers/tor.py +++ b/packages/torouter-web/src/tui/controllers/tor.py @@ -9,16 +9,23 @@ The main Tor status page """ class status: def GET(self): - trc = parsing.torrc(config.torrc_file) - trc.parse() - output = trc.html_output() - return render.base(render.torstatus(output,config.torrc_file)) + if session.is_logged() > 0: + trc = parsing.torrc(config.torrc_file) + trc.parse() + output = trc.html_output() + return render.base(render.torstatus(output,config.torrc_file)) + else: + return render.base(render.login()) + def POST(self): - trc = parsing.torrc(config.torrc_file) - trc.parse() - output = trc.html_output() - return render.base(render.torstatus(output,config.torrc_file)) + if session.is_logged() > 0: + trc = parsing.torrc(config.torrc_file) + trc.parse() + output = trc.html_output() + return render.base(render.torstatus(output,config.torrc_file)) + else: + return render.base(render.login()) """ Tor configuration page @@ -32,9 +39,12 @@ class torrc: return True def GET(self): - trc = parsing.torrc(config.torrc_file) - output = trc.output() - return render.base(render.torconfig(output)) + if session.is_logged() > 0: + trc = parsing.torrc(config.torrc_file) + output = trc.output() + return render.base(render.torconfig(output)) + else: + return render.base(render.login()) def POST(self): if session.is_logged() > 0: -- cgit v1.2.3