Commits

Andi Miller committed 42a8983 Merge

Merged in sakacoco/pizza-auth/feature/force-update-user-admin (pull request #18)

Allow admin to force update user

Comments (0)

Files changed (2)

pizza_auth/main.py

 	flash("Successful delete for %s" % user, "success")
 	return redirect("/admin")
 
+@app.route("/admin/updateuser", methods=["POST"])
+@login_required
+@group_required("admin")
+def updateuser():
+	user = request.form["userid"]
+	update_characters([user])
+	flash("Successful update for %s" % user, "success")
+	return redirect("/admin")
+
 @app.route("/groups/admin")
 @login_required
 @groups_required(lambda x:x.startswith("admin"))

pizza_auth/templates/admintools.html

 			</div>
 		</div>
 	</div>
+	<div class="col-md-4">
+		<div class="panel panel-primary">
+			<div class="panel-heading"><h3 class="panel-title">Force update User</h3></div>
+			<div class="panel-body">
+				<form action="/admin/updateuser" method="post">
+					<label for="userid">User ID</label><br /><input class="form-control" rows=6 style="width:100%" type="text" name="userid"></input>
+					<div class="controls">
+						<br>
+						<button type="submit" class="btn btn-warning" value="submit" />Update</button>
+					</div>
+				</form>
+			</div>
+		</div>
+	</div>
 {% endblock %}