From 57d8ba1121790f3445f07c073dcd8b3ef823b763 Mon Sep 17 00:00:00 2001 From: "holger.trampe" Date: Fri, 30 Jul 2021 14:42:58 +0200 Subject: [PATCH] Links angepasst --- .../templates/dasettings/groups_content.html | 2 +- dasettings/views.py | 2 +- standards/views.py | 18 +++++++++++++++++- users/templates/users/login.html | 2 +- users/templates/users/password_reset.html | 2 +- users/templates/users/register.html | 2 +- users/templates/users/registercomplete.html | 2 +- 7 files changed, 23 insertions(+), 7 deletions(-) diff --git a/dasettings/templates/dasettings/groups_content.html b/dasettings/templates/dasettings/groups_content.html index 4a78727..c03f0f9 100644 --- a/dasettings/templates/dasettings/groups_content.html +++ b/dasettings/templates/dasettings/groups_content.html @@ -388,7 +388,7 @@ function updateGroupName(){ success: function( data ) { if(data['success']){ - //window.location.href = window.location.href + "?showtoast=true"; + window.location.href = window.location.href + "?showtoast=true"; $("#newGroup").modal("toggle"); } else{ diff --git a/dasettings/views.py b/dasettings/views.py index 28c711a..14426b6 100644 --- a/dasettings/views.py +++ b/dasettings/views.py @@ -780,7 +780,7 @@ def SettingsAjaxRouter(request): data = {"userid" : usertoremove.pk, "groupid" : aggroup.pk, "user_fname" : usertoremove.first_name, "user_lname" : usertoremove.last_name} # User add - # NC ADD USER TO GROUP + # NC REMOVE USER FROM GROUP # first_name and last_name CHANGE - Update in NC as DisplayName headers = { 'Accept' : 'application/json', diff --git a/standards/views.py b/standards/views.py index 9394383..f839da2 100644 --- a/standards/views.py +++ b/standards/views.py @@ -109,6 +109,10 @@ def checkUserDirRights(request, startdir, userid): canview = False return canview +# NEW FOR NC +import requests +from django.conf import settings +from digitaleagentur.utils import * @login_required def StandardAdd(request, id=False): @@ -240,9 +244,21 @@ def StandardAdd(request, id=False): else: normalForm = StandardAddStandard(instance=request.user) editorForm = StandardAddStandardEditor(instance=request.user) - + + possibleFilesByVisible = [] + # NC FILE + # Data for the new User + if(request.user.is_authenticated and getNCLoggedUserBySession(request.COOKIES['nc_session_id'])): + + data_nc = { + "Depth" : 0 + } + + nc_login_headers = {'Authorization' : 'Bearer ' + request.COOKIES['nc_session_id']} + r = requests.request("PROPFIND", settings.NEXTCLOUD_URL + "remote.php/dav/files/" + request.user.username + "/Agenturdaten_1/", headers=nc_login_headers, data=data_nc) + print(r.text) allfiles = DataFile.objects.filter(agency=request.user.profile.agency) diff --git a/users/templates/users/login.html b/users/templates/users/login.html index a28d167..fed304a 100644 --- a/users/templates/users/login.html +++ b/users/templates/users/login.html @@ -2,7 +2,7 @@ \ No newline at end of file diff --git a/users/templates/users/password_reset.html b/users/templates/users/password_reset.html index a28d167..73965aa 100644 --- a/users/templates/users/password_reset.html +++ b/users/templates/users/password_reset.html @@ -2,7 +2,7 @@ \ No newline at end of file diff --git a/users/templates/users/register.html b/users/templates/users/register.html index a28d167..73965aa 100644 --- a/users/templates/users/register.html +++ b/users/templates/users/register.html @@ -2,7 +2,7 @@ \ No newline at end of file diff --git a/users/templates/users/registercomplete.html b/users/templates/users/registercomplete.html index a28d167..73965aa 100644 --- a/users/templates/users/registercomplete.html +++ b/users/templates/users/registercomplete.html @@ -2,7 +2,7 @@ \ No newline at end of file