Anmeldebug neue User fix Weiterleitungsseite und Nachname weg

This commit is contained in:
Holger Trampe 2021-10-18 09:16:38 +02:00
parent 401fd60ca4
commit f8b10b9ec8
3 changed files with 52 additions and 14 deletions

View File

@ -176,17 +176,20 @@ def getNCLoggedUserBySession(sid):
nc_login_headers = {'Authorization' : 'Bearer ' + sid}
r = requests.get(settings.NEXTCLOUD_URL + "ocs/v2.php/apps/user_status/api/v1/user_status", headers=nc_login_headers)
xpars = xmltodict.parse(r.text)
js = json.dumps(xpars)
final_json = json.loads(js)
# New user login - set initial status
if(final_json['ocs']['meta']['status'] == 'failure'):
nc_login_headers = {'Authorization' : 'Bearer ' + sid, 'OCS-APIREQUEST' : 'true'}
r = requests.get(settings.NEXTCLOUD_URL + "ocs/v2.php/apps/user_status/api/v1/user_status/status", headers=nc_login_headers, data={'statusType' : 'dnd'})
r = requests.get(settings.NEXTCLOUD_URL + "ocs/v2.php/apps/user_status/api/v1/user_status", headers=nc_login_headers)
xpars = xmltodict.parse(r.text)
js = json.dumps(xpars)
final_json = json.loads(js)
return final_json['ocs']['data']['userId']
#except:
# return redirect('users-dashboard')

View File

@ -3,7 +3,7 @@
{% block content %}
<div class="content-section col-12">
{% gettimemessage as timemessage %}
<h3>{{timemessage}}, {{request.user.first_name}} {{request.user.last_name}}!</h3>
<h3>{{timemessage}}, {{request.user.first_name}}!</h3>
<small>Letzter Login: {{ request.user.last_login }}
{% getlocalweather request.user as weatherdata %}
{% if request.user.profile.agency.city|length > 0 and weatherdata.0 != None %}

View File

@ -1,8 +1,43 @@
{% load static %}
<html>
<body>
<h4>Sie werden gleich zur neuen Login-Seite der Digitalen Agentur weitergeleitet. Sollte dies nicht gehen, klicken Sie auf folgenden Link:</h4>
<a href="https://cloud.digitale-agentur.com/">https://cloud.digitale-agentur.com/</a>
<style>
.loader {
position: relative;
border: 7px solid #d3d3d3;
border-radius: 50%;
border-top: 7px solid red;
width: 70px;
height: 70px;
left:50%;
top:35%;
-webkit-animation: spin 1s linear infinite; /* Safari */
animation: spin 1s linear infinite;
}
#overlay{
position: absolute;
top:0px;
left:0px;
width: 100%;
height: 100%;
background: black;
opacity: .4;
}
/* Safari */
@-webkit-keyframes spin {
0% { -webkit-transform: rotate(0deg); }
100% { -webkit-transform: rotate(360deg); }
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
</style>
<div id="overlay">
<div class="loader"></div>
</div>
</body>
</html>
<script src="{%static 'users/js/jquery.js' %}" type="text/javascript"></script>