def index(): uinfo = list() ip = open("ip.txt", "a") ip.write(request.remote_addr + '\n') ip.close() s = request.environ.get('beaker.session') email = s.get('email', None) if not email: return redirect('/Login') else: redirect('/Main/index')
def MainIndex(db): s = request.environ.get('beaker.session') email = s.get('email', None) if not email: return redirect('/Login') total_webshell = getTotalShell(db) return template('App/View/Main/index.tpl', total_webshell=total_webshell)
def Shelladd(db): try: s = request.environ.get('beaker.session') email = s.get('email', None) if not email: return redirect('/Login') url = request.POST['url'] password = request.POST['password'] category = request.POST['category'] return addOneShell(db, url, password, category) except Exception as e: logging.error(e) return {'type': "error", "info": e}
def Shelldel(db): try: s = request.environ.get('beaker.session') email = s.get('email', None) if not email: return redirect('/Login') url = request.POST['url'] return delOneShell(db, url) except Exception as e: logging.error(e) return {'type': 'error', 'info': e}
def MainWebsite(db): s=request.environ.get('beaker.session') email=s.get('email',None) if not email: return redirect('/Login') total_webshell=getTotalShell(db) num=showShellconfig() pages=divmod(int(total_webshell),num) if pages[1]==0: total_page=pages[0] else: total_page=pages[0]+1 return template('App/View/Main/website.tpl',total_webshell=total_webshell,total_page=total_page)