mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
First boot hijacks root if needed
This commit is contained in:
parent
d1a4d8ec9f
commit
a8c3a73013
@ -53,9 +53,13 @@ def error_page_500(status, message, traceback, version):
|
|||||||
class Root(plugin_mount.PagePlugin):
|
class Root(plugin_mount.PagePlugin):
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
def index(self):
|
def index(self):
|
||||||
|
## TODO: firstboot hijacking root should probably be in the firstboot module with a hook in plinth.py
|
||||||
with sqlite_db(cfg.store_file, table="firstboot") as db:
|
with sqlite_db(cfg.store_file, table="firstboot") as db:
|
||||||
if not 'state' in db:
|
if not 'state' in db:
|
||||||
raise cherrypy.InternalRedirect('/firstboot')
|
raise cherrypy.InternalRedirect('/firstboot')
|
||||||
|
elif db['state'] < 5:
|
||||||
|
cfg.log("First Boot state = %d" % db['state'])
|
||||||
|
raise cherrypy.InternalRedirect('/firstboot/state%d' % db['state'])
|
||||||
if cherrypy.session.get(cfg.session_key, None):
|
if cherrypy.session.get(cfg.session_key, None):
|
||||||
raise cherrypy.InternalRedirect('/router')
|
raise cherrypy.InternalRedirect('/router')
|
||||||
else:
|
else:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user