aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-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: