@app.route("/")
def index():
try:
- if((ret:=problem())!="go"):
- return ret
+ #if((ret:=problem())!="go"):
+ # return ret
cursor=get_db().cursor()
(ok, mc)=multicenter.read(cursor, session["mid"])
if(not ok):
@app.get("/admin")
def admin(msg=None):
+ if((ret:=problem())!="go"):
+ return ret
cursor=get_db().cursor()
(ok, mc)=multicenter.list(cursor)
if(not ok):
@app.post("/newuser")
def newuser():
+ if((ret:=problem())!="go"):
+ return ret
try:
cursor=get_db().cursor()
if(auth.new(cursor, request.form["user"], request.form["pwd"], request.form["auth"])):
@app.post("/changepass")
def changepass():
+ if((ret:=problem())!="go"):
+ return ret
try:
cursor=get_db().cursor()
if("user" in request.form.keys()):
- if(auth.change(cursor, request.form["user"], request.form["new"])):
+ if(auth.changePass(cursor, request.form["user"], request.form["new"])):
return admin(msg="Password changed")
else:
return admin(msg="Incorrect Password")
elif(request.form["new"]==request.form["check"]):
user=request.form.get("user", session["user"])
- if(auth.change(cursor, user, request.form["new"], request.form["old"])):
+ if(auth.changePass(cursor, user, request.form["new"], request.form["old"])):
return admin(msg="Password changed")
else:
return admin(msg="Incorrect Password")
@app.post("/changeauth")
def changeauth():
+ if((ret:=problem())!="go"):
+ return ret
try:
cursor=get_db().cursor()
if(g.auth==auth.auth.ALL and "user" in request.form.keys() and "auth" in request.form.keys()):
@app.post("/deluser")
def deluser():
+ if((ret:=problem())!="go"):
+ return ret
try:
cursor=get_db().cursor()
if("user" in request.form.keys()):
if(auth.access()==auth.auth.ALL):
return "go"
else:
- return redirect("/login")
+ return render_template("error.html", data="Access denied")
@app.template_filter("format_date")
def format_date(date):