aboutsummaryrefslogtreecommitdiffstats
path: root/packages/torouter-web/src/tui/controllers/main.py
diff options
context:
space:
mode:
authorJacob Appelbaum <jacob@appelbaum.net>2011-08-17 18:03:43 +0200
committerJacob Appelbaum <jacob@appelbaum.net>2011-08-17 18:03:43 +0200
commitbb4a0df747092bdc0fac0baa0658bf1d314a9de8 (patch)
tree7c41a9eb66549ad17c0e7e4c06cae19c1ac54916 /packages/torouter-web/src/tui/controllers/main.py
parent24b92ab9b034d6c957631a034a717ba41809a335 (diff)
downloadtorouter-bb4a0df747092bdc0fac0baa0658bf1d314a9de8.tar.gz
torouter-bb4a0df747092bdc0fac0baa0658bf1d314a9de8.zip
Move source into src dir
Diffstat (limited to 'packages/torouter-web/src/tui/controllers/main.py')
-rw-r--r--packages/torouter-web/src/tui/controllers/main.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/packages/torouter-web/src/tui/controllers/main.py b/packages/torouter-web/src/tui/controllers/main.py
new file mode 100644
index 0000000..060caa6
--- /dev/null
+++ b/packages/torouter-web/src/tui/controllers/main.py
@@ -0,0 +1,26 @@
+import web
+import view, config
+from view import render
+from tui.utils import session
+
+"""
+The main page for network configuration
+"""
+class index:
+ def GET(self):
+ if session.is_logged() > 0:
+ return render.base(render.index())
+ else:
+ return render.base(render.login())
+
+ def POST(self):
+ if session.check_login(web.input()) == 0:
+ return render.base(render.index())
+ else:
+ return render.base(render.login())
+
+class logout:
+ def GET(self):
+ session.logout()
+ return render.base(render.logout())
+