From 107256ba90d51bd5c981cf0b167f68c8f64d652c Mon Sep 17 00:00:00 2001 From: Arturo FilastoĢ€ Date: Fri, 19 Aug 2011 16:03:50 +0200 Subject: Fix XSRF --- packages/torouter-web/src/tui/controllers/tor.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'packages/torouter-web') diff --git a/packages/torouter-web/src/tui/controllers/tor.py b/packages/torouter-web/src/tui/controllers/tor.py index bc66623..491c6b7 100644 --- a/packages/torouter-web/src/tui/controllers/tor.py +++ b/packages/torouter-web/src/tui/controllers/tor.py @@ -37,10 +37,13 @@ class torrc: return render.base(render.torconfig(output)) def POST(self): - self.update_config(web.input()) - 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: + self.update_config(web.input()) + 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()) -- cgit v1.2.3