diff options
Diffstat (limited to 'pyload/webui/App/json.py')
-rw-r--r-- | pyload/webui/App/json.py | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/pyload/webui/App/json.py b/pyload/webui/App/json.py index 98eb8c4f2..f75ad7517 100644 --- a/pyload/webui/App/json.py +++ b/pyload/webui/App/json.py @@ -153,14 +153,14 @@ def link_order(ids): @bottle.route('/json/add_package', method='POST') @login_required('ADD') def add_package(): - name = request.forms.get("add_name", "New Package").strip() - queue = int(request.forms['add_dest']) - links = decode(request.forms['add_links']) + name = bottle.request.forms.get("add_name", "New Package").strip() + queue = int(bottle.request.forms['add_dest']) + links = decode(bottle.request.forms['add_links']) links = links.split("\n") - pw = request.forms.get("add_password", "").strip("\n\r") + pw = bottle.request.forms.get("add_password", "").strip("\n\r") try: - f = request.files['add_file'] + f = bottle.request.files['add_file'] if not name or name == "New Package": name = f.name @@ -198,10 +198,10 @@ def move_package(dest, id): @login_required('MODIFY') def edit_package(): try: - id = int(request.forms.get("pack_id")) - data = {"name": request.forms.get("pack_name").decode("utf8", "ignore"), - "folder": request.forms.get("pack_folder").decode("utf8", "ignore"), - "password": request.forms.get("pack_pws").decode("utf8", "ignore")} + id = int(bottle.request.forms.get("pack_id")) + data = {"name": bottle.request.forms.get("pack_name").decode("utf8", "ignore"), + "folder": bottle.request.forms.get("pack_folder").decode("utf8", "ignore"), + "password": bottle.request.forms.get("pack_pws").decode("utf8", "ignore")} PYLOAD.setPackageData(id, data) return {"response": "success"} @@ -214,9 +214,9 @@ def edit_package(): @bottle.route('/json/set_captcha', method='POST') @login_required('ADD') def set_captcha(): - if request.environ.get('REQUEST_METHOD', "GET") == "POST": + if bottle.request.environ.get('REQUEST_METHOD', "GET") == "POST": try: - PYLOAD.setCaptchaResult(request.forms['cap_id'], request.forms['cap_result']) + PYLOAD.setCaptchaResult(bottle.request.forms['cap_id'], bottle.request.forms['cap_result']) except Exception: pass @@ -255,7 +255,7 @@ def load_config(category, section): @bottle.route('/json/save_config/<category>', method='POST') @login_required("SETTINGS") def save_config(category): - for key, value in request.POST.iteritems(): + for key, value in bottle.request.POST.iteritems(): try: section, option = key.split("|") except Exception: @@ -269,9 +269,9 @@ def save_config(category): @bottle.route('/json/add_account', method='POST') @login_required("ACCOUNTS") def add_account(): - login = request.POST['account_login'] - password = request.POST['account_password'] - type = request.POST['account_type'] + login = bottle.request.POST['account_login'] + password = bottle.request.POST['account_password'] + type = bottle.request.POST['account_type'] PYLOAD.updateAccount(type, login, password) @@ -281,7 +281,7 @@ def add_account(): def update_accounts(): deleted = [] #: dont update deleted accs or they will be created again - for name, value in request.POST.iteritems(): + for name, value in bottle.request.POST.iteritems(): value = value.strip() if not value: continue @@ -305,9 +305,9 @@ def update_accounts(): @bottle.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'] + user = bottle.request.POST['user_login'] + oldpw = bottle.request.POST['login_current_password'] + newpw = bottle.request.POST['login_new_password'] if not PYLOAD.changePassword(user, oldpw, newpw): print "Wrong password" |