CKEditor Plugin angelegt, aber nicht eingebunden.
Organigramm sichtbar/nicht sichtbar bei User eingestellt Bereichspriorisierung eingestellt und im Main-Organigramm übernommen Rechtschreibfehler bei Mail geklärt Passwort-Reset-Mail
This commit is contained in:
parent
590d207429
commit
184e1b6a54
Binary file not shown.
Binary file not shown.
|
|
@ -49,6 +49,7 @@
|
|||
</legend>
|
||||
<!-- FORMS LADEN -->
|
||||
{{ profileform_form|crispy }}
|
||||
<button type="button" id="" onclick="javascript:sendPassMail({{prof_user.pk}})" class="btn btn-success">E-Mail mit Link zur Passworterstellung senden</button> <span class="alert alert-success" id="mailsend" role="alert" style="display: none;"> E-Mail gesendet!</span>
|
||||
</fieldset>
|
||||
Übergeordneter Mitarbeiter: <span id="ps_act">{{prof_user.profile.parent.first_name}} {{prof_user.profile.parent.last_name}}</span>
|
||||
<div class="input-group mb-3">
|
||||
|
|
@ -73,6 +74,25 @@
|
|||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
//Call Function in view to send e-mail with pass-reset-data
|
||||
function sendPassMail(id){
|
||||
$.ajax(
|
||||
{
|
||||
type: "GET",
|
||||
url: "/dashboard/sendpassmail",
|
||||
data:{
|
||||
userid : {{prof_user.pk}}
|
||||
},
|
||||
success: function( data )
|
||||
{
|
||||
if(data["message"] == 0){
|
||||
$("#mailsend").fadeIn().delay(4000).fadeOut();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
tempid = null;
|
||||
function clearSearchfield(){
|
||||
$("#puser").val("");
|
||||
|
|
|
|||
|
|
@ -31,7 +31,9 @@ urlpatterns = [
|
|||
path('globalsearch/', views.GlobalSearch, name="globalsearch"),
|
||||
path('standardrout/', views.searchStandardRouter, name="standardrouter"),
|
||||
path('support/', views.support, name="supportda"),
|
||||
path('setuserparent/', views.setuserparent, name="users-setuserparent")
|
||||
path('setuserparent/', views.setuserparent, name="users-setuserparent"),
|
||||
path('sendpassmail/', views.sendpassmail, name="users-sendpassmail")
|
||||
|
||||
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -5,11 +5,10 @@ from django.conf import settings
|
|||
from .usersforms import UsersAddNewUser, UsersAddProfileForm, UsersChangeProfil, AgencyUpdateForm, UsersPermForm, UserAreaTaskForm, SupportForm
|
||||
from django.views.generic import CreateView, ListView, UpdateView, DetailView, DeleteView, View
|
||||
from django.contrib import messages
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.auth.models import User, Permission
|
||||
from django.db import models
|
||||
from .models import Profile, Agency
|
||||
from django.core.mail import send_mail
|
||||
from django.contrib.auth.models import Permission
|
||||
from django.http import HttpResponseRedirect,HttpResponse, JsonResponse
|
||||
from areas.models import Areas
|
||||
from tasks.models import Tasks
|
||||
|
|
@ -22,6 +21,7 @@ import requests
|
|||
import json
|
||||
from PIL import Image
|
||||
from django.template.loader import render_to_string
|
||||
from django.contrib.auth.forms import PasswordResetForm
|
||||
'''
|
||||
|
||||
DASHBOARD-View
|
||||
|
|
@ -548,3 +548,19 @@ def support(request):
|
|||
else:
|
||||
|
||||
return render(request, 'users/support.html', context)
|
||||
|
||||
'''
|
||||
|
||||
Schickt eine E-Mail an den User inkl. Passwortlink zum zurücksetzen.
|
||||
|
||||
'''
|
||||
def sendpassmail(request):
|
||||
if(request.method == 'GET'):
|
||||
userid = request.GET['userid']
|
||||
tempuser = User.objects.get(pk=userid)
|
||||
form = PasswordResetForm({'email': tempuser.email})
|
||||
if form.is_valid():
|
||||
request.META['SERVER_NAME'] = 'digitale-agentur.com'
|
||||
request.META['SERVER_PORT'] = '443'
|
||||
form.save(request= request,use_https=True,from_email="support@digitale-agentur.com",email_template_name='users/password_reset_mail.html')
|
||||
return JsonResponse({'message' : 0})
|
||||
|
|
|
|||
Loading…
Reference in New Issue