diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-12 19:42:46 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-12 19:42:46 +0200 |
commit | e655d860882fff63160098f063fc3e4c9b8c0ba5 (patch) | |
tree | e05cbf8628841a64952d294663bd263c19d2bbcd /module/web/pyload | |
parent | merge (diff) | |
download | pyload-e655d860882fff63160098f063fc3e4c9b8c0ba5.tar.xz |
web if acc settings
Diffstat (limited to 'module/web/pyload')
-rw-r--r-- | module/web/pyload/views.py | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index b8cbacf30..880ec7843 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -300,6 +300,7 @@ def collector(request): def config(request): conf = settings.PYLOAD.get_config() plugin = settings.PYLOAD.get_plugin_config() + accs = settings.PYLOAD.get_accounts() messages = [] for section in chain(conf.itervalues(), plugin.itervalues()): @@ -343,6 +344,26 @@ def config(request): continue else: continue + + elif sec == "Accounts": + if ";" in okey: + action, name = okey.split(";") + + if action == "delete": + settings.PYLOAD.remove_account(skey, name) + elif action == "password": + + for acc in accs[skey]: + if acc["login"] == name and acc["password"] != value: + settings.PYLOAD.update_account(skey, name, value) + + elif okey == "newacc" and value: + # add account + + pw = request.POST.get("Accounts|%s|newpw" % skey) + + settings.PYLOAD.update_account(skey, value, pw) + if errors: messages.append(_("Error occured when setting the following options:")) @@ -351,4 +372,6 @@ def config(request): else: messages.append(_("All options were set correctly.")) - return render_to_response(join(settings.TEMPLATE, 'settings.html'), RequestContext(request, {'conf': {'Plugin':plugin, 'General':conf}, 'errors': messages}, [status_proc])) + accs = settings.PYLOAD.get_accounts() + + return render_to_response(join(settings.TEMPLATE, 'settings.html'), RequestContext(request, {'conf': {'Plugin':plugin, 'General':conf, 'Accounts': accs}, 'errors': messages}, [status_proc])) |