diff options
Diffstat (limited to 'module/web/ajax')
-rw-r--r-- | module/web/ajax/urls.py | 1 | ||||
-rw-r--r-- | module/web/ajax/views.py | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/module/web/ajax/urls.py b/module/web/ajax/urls.py index a88e3aea5..f661b2b6a 100644 --- a/module/web/ajax/urls.py +++ b/module/web/ajax/urls.py @@ -30,4 +30,5 @@ urlpatterns = patterns('ajax', (r'^set_captcha$', 'views.set_captcha'), (r'^package_order/([0-9|]+)$', 'views.package_order'), (r'^link_order/([0-9|]+)$', 'views.link_order'), + (r'edit_package$', 'views.edit_package'), )
\ No newline at end of file diff --git a/module/web/ajax/views.py b/module/web/ajax/views.py index f96b93b70..5a6fc7b69 100644 --- a/module/web/ajax/views.py +++ b/module/web/ajax/views.py @@ -278,6 +278,20 @@ def move_package(request, dest, id): return HttpResponseServerError() @permission('pyload.can_add_dl') +def edit_package(request): + try: + id = int(request.POST.get("pack_id")) + data = {"name": request.POST.get("pack_name"), + "folder": request.POST.get("pack_folder"), + "priority": request.POST.get("pack_prio"), + "password": request.POST.get("pack_pws")} + + settings.PYLOAD.set_package_data(id, data) + + except: + return HttpResponseServerError() + +@permission('pyload.can_add_dl') def set_captcha(request): if request.META['REQUEST_METHOD'] == "POST": try: |