aboutsummaryrefslogtreecommitdiffstats
path: root/packages/torouter-web/tui/controllers/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/torouter-web/tui/controllers/main.py')
-rw-r--r--packages/torouter-web/tui/controllers/main.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/packages/torouter-web/tui/controllers/main.py b/packages/torouter-web/tui/controllers/main.py
index 2806467..7e1df50 100644
--- a/packages/torouter-web/tui/controllers/main.py
+++ b/packages/torouter-web/tui/controllers/main.py
@@ -1,14 +1,21 @@
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):
- return render.base(render.index())
+ if session.is_logged() > 0:
+ return render.base(render.index())
+ else:
+ return render.base(render.login())
def POST(self):
- return render.base(render.index())
+ if session.check_login(web.input()) == 0:
+ return render.base(render.index())
+ else:
+ return render.base(render.login())