From efee017fb2b3a4cac09233cd01d816d9100a5db5 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Wed, 25 May 2011 20:37:32 +0200 Subject: rehost plugin, fixed some account management issues --- module/web/json_app.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'module/web/json_app.py') diff --git a/module/web/json_app.py b/module/web/json_app.py index 36ecf22aa..9e9536a40 100644 --- a/module/web/json_app.py +++ b/module/web/json_app.py @@ -392,17 +392,25 @@ def add_account(): @route("/json/update_accounts", method="POST") @login_required("settings") def update_accounts(): + deleted = [] #dont update deleted accs or they will be created again + for name, value in request.POST.iteritems(): + value = value.strip() + if not value: continue + tmp, user = name.split(";") plugin, action = tmp.split("|") - if action == "password" and value: + if (plugin, user) in deleted: continue + + if action == "password": PYLOAD.update_account(plugin, user, value) - elif action == "time" and value and "-" in value: + elif action == "time" and "-" in value: PYLOAD.update_account(plugin, user, options={"time": [value]}) - elif action == "limitdl" and value and value.isdigit(): + elif action == "limitdl" and value.isdigit(): PYLOAD.update_account(plugin, user, options={"limitDL": [value]}) - elif action == "delete" and value: + elif action == "delete": + deleted.append((plugin,user)) PYLOAD.remove_account(plugin, user) -- cgit v1.2.3