aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArturo FilastoĢ€ <hellais@torproject.org>2011-08-24 18:22:37 +0200
committerArturo FilastoĢ€ <hellais@torproject.org>2011-08-24 18:22:37 +0200
commit817713dc33ae88217b61c73d4b9b0446a1a89855 (patch)
treea62a4e954020fdd00e7abe6503ff613b57756884
parentb0984f4e97cfd7a3274b1510c40e5d2bdf10b531 (diff)
downloadtorouter-817713dc33ae88217b61c73d4b9b0446a1a89855.tar.gz
torouter-817713dc33ae88217b61c73d4b9b0446a1a89855.zip
Require login for tor status page
-rw-r--r--packages/torouter-web/src/tui/controllers/tor.py32
1 files changed, 21 insertions, 11 deletions
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: