aboutsummaryrefslogtreecommitdiffstats
path: root/packages/torouter-web/tui/controllers/main.py
blob: 060caa642089a2dba0820a13abf00e8b3c44e50f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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())