[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [torouter/master] Require login for tor status page



commit 817713dc33ae88217b61c73d4b9b0446a1a89855
Author: Arturo FilastoÌ? <hellais@xxxxxxxxxxxxxx>
Date:   Wed Aug 24 18:22:37 2011 +0200

    Require login for tor status page
---
 packages/torouter-web/src/tui/controllers/tor.py |   32 ++++++++++++++-------
 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:

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits