def userPanel(): global username, password sql = SQL_Server() sql.getTableList() sql.getAttributeList() tableList = sql.tableList attributeList = sql.attributeList return render_template('user.html', user=username, tableList=tableList, attributeList=attributeList, tableLen=len(tableList))
def developerPanel(): """detect developer's password""" # if (username password) not correct global username, password sql = SQL_Server() sql.getTableList() sql.getAttributeList() tableList = sql.tableList attributeList = sql.attributeList # else login succeed return render_template('developer.html', user=username, tableList=tableList, attributeList=attributeList, tableLen=len(tableList))
def role(): """developer or user""" global username, password username = request.form['username'] password = request.form['password'] sql = SQL_Server() if not sql.loginDetect(username, password): return redirect('/login') if not sql.ifManager(username, password): sql = SQL_Server() sql.getTableList() sql.getAttributeList() tableList = sql.tableList attributeList = sql.attributeList return render_template('user.html', user=username, tableList=tableList, attributeList=attributeList, tableLen=len(tableList)) return render_template('role.html', user=username)