[tor-commits] [torouter/master] Fix XSRF

hellais at torproject.org hellais at torproject.org
Fri Aug 19 15:28:14 UTC 2011


commit 107256ba90d51bd5c981cf0b167f68c8f64d652c
Author: Arturo Filastò <hellais at torproject.org>
Date:   Fri Aug 19 16:03:50 2011 +0200

    Fix XSRF
---
 packages/torouter-web/src/tui/controllers/tor.py |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

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())
 
 





More information about the tor-commits mailing list