summaryrefslogtreecommitdiffstats
path: root/module/web/pyload/views.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-08-12 19:42:46 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-08-12 19:42:46 +0200
commite655d860882fff63160098f063fc3e4c9b8c0ba5 (patch)
treee05cbf8628841a64952d294663bd263c19d2bbcd /module/web/pyload/views.py
parentmerge (diff)
downloadpyload-e655d860882fff63160098f063fc3e4c9b8c0ba5.tar.xz
web if acc settings
Diffstat (limited to 'module/web/pyload/views.py')
-rw-r--r--module/web/pyload/views.py25
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]))