From 3254a85595dd27a96862d8d7b932c03ade166f95 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Fri, 27 May 2011 22:52:24 +0200 Subject: change password in webif --- module/web/json_app.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'module/web/json_app.py') diff --git a/module/web/json_app.py b/module/web/json_app.py index 738f5ac63..39cd81f5f 100644 --- a/module/web/json_app.py +++ b/module/web/json_app.py @@ -415,6 +415,16 @@ def update_accounts(): deleted.append((plugin,user)) PYLOAD.remove_account(plugin, user) +@route("/json/change_password", method="POST") +def change_password(): + + user = request.POST["user_login"] + oldpw = request.POST["login_current_password"] + newpw = request.POST["login_new_password"] + + if not PYLOAD.change_password(user, oldpw, newpw): + print "Wrong password" + return HTTPError() @route("/json/filemanager/rename", method="POST") @login_required('filemanager') -- cgit v1.2.3