Ejemplo n.º 1
0
def send_reset_password_success_mail(request, user):
    subject = _('Reset password success')
    recipient_list = [user.email]
    message = _("""
    
    Hi %(name)s:
    <br>
    
    
    <br>
    Your JumpServer password has just been successfully updated.
    <br>
    
    <br>
    If the password update was not initiated by you, your account may have security issues. 
    It is recommended that you log on to the JumpServer immediately and change your password.
    <br>
    
    <br>
    If you have any questions, you can contact the administrator.
    <br>
    <br>
    ---
    <br>
    <br>
    IP Address: %(ip_address)s
    <br>
    <br>
    Browser: %(browser)s
    <br>
    
    """) % {
        'name': user.name,
        'ip_address': get_request_ip_or_data(request),
        'browser': get_request_user_agent(request),
    }
    if settings.DEBUG:
        logger.debug(message)

    send_mail_async.delay(subject,
                          message,
                          recipient_list,
                          html_message=message)
Ejemplo n.º 2
0
 def __init__(self, user, request):
     super().__init__(user)
     self.ip_address = get_request_ip_or_data(request)
     self.browser = get_request_user_agent(request)