main_sys_shutdown.py 782 B

12345678910111213141516171819202122232425
  1. from .tool.func import *
  2. def main_sys_shutdown():
  3. with get_db_connect() as conn:
  4. if admin_check() != 1:
  5. return re_error('/error/3')
  6. if flask.request.method == 'POST':
  7. admin_check(None, 'shutdown')
  8. conn.commit()
  9. print('Shutdown')
  10. os._exit(0)
  11. else:
  12. return easy_minify(flask.render_template(skin_check(),
  13. imp = [load_lang('wiki_shutdown'), wiki_set(), wiki_custom(), wiki_css([0, 0])],
  14. data = '''
  15. <form method="post">
  16. <button type="submit">''' + load_lang('shutdown') + '''</button>
  17. </form>
  18. ''',
  19. menu = [['manager', load_lang('return')]]
  20. ))