Send the 'password has changed' notification email.
508363
def send_password_changed_email(self, user):
        """"""

        # Verify config settings
        if not self.user_manager.USER_ENABLE_EMAIL: return
        if not self.user_manager.USER_SEND_PASSWORD_CHANGED_EMAIL: return

        # Notification emails are sent to the user's primary email address
        user_or_user_email_object = self.user_manager.db_manager.get_primary_user_email_object(user)
        email = user_or_user_email_object.email

        # Render email from templates and send it via the configured EmailAdapter
        self._render_and_send_email(
            email,
            user,
            self.user_manager.USER_PASSWORD_CHANGED_EMAIL_TEMPLATE,
        )
941510
def change_password_view(self):
        

        # Initialize form
        form = self.ChangePasswordFormClass(request.form)

        # Process valid POST
        if request.method == 'POST' and form.validate():
            # Hash password
            new_password = form.new_password.data
            password_hash = self.hash_password(new_password)

            # Update user.password
            current_user.password = password_hash
            self.db_manager.save_object(current_user)
            self.db_manager.commit()

            # Send password_changed email
            if self.USER_ENABLE_EMAIL and self.USER_SEND_PASSWORD_CHANGED_EMAIL:
                self.email_manager.send_password_changed_email(current_user)

            # Send changed_password signal
            signals.user_changed_password.send(current_app._get_current_object(), user=current_user)

            # Flash a system message
            flash(_('Your password has been changed successfully.'), 'success')

            # Redirect to 'next' URL
            safe_next_url = self._get_safe_next_url('next', self.USER_AFTER_CHANGE_PASSWORD_ENDPOINT)
            return redirect(safe_next_url)

        # Render form
        self.prepare_domain_translations()
        return render_template(self.USER_CHANGE_PASSWORD_TEMPLATE, form=form)
605862
function() {
        firebaseui.auth.widget.handler.common.sendEmailLinkForSignIn(
            app,
            component,
            email,
            onCancelClick,
            function(error) {
              // The email provided could be an invalid one or some other error
              // could occur.
              var errorMessage =
                  firebaseui.auth.widget.handler.common.getErrorMessage(error);
              component.showInfoBar(errorMessage);
            },
            opt_pendingCredential);
      }
990409
def change_password(self, previous_password, proposed_password):
        
        self.check_token()
        response = self.client.change_password(
            PreviousPassword=previous_password,
            ProposedPassword=proposed_password,
            AccessToken=self.access_token
        )
        self._set_attributes(response, {'password': proposed_password})
244128
def _Notify(username, notification_type, message, object_reference):
  """"""

  # Do not try to notify system users (e.g. Cron).
  if username in aff4_users.GRRUser.SYSTEM_USERS:
    return

  if object_reference:
    uc = object_reference.UnionCast()
    if hasattr(uc, "client_id"):
      message = _HostPrefix(uc.client_id) + message

  n = rdf_objects.UserNotification(
      username=username,
      notification_type=notification_type,
      state=rdf_objects.UserNotification.State.STATE_PENDING,
      message=message,
      reference=object_reference)
  data_store.REL_DB.WriteUserNotification(n)
569841
function onSendSignInLinkToEmail() {
  var email = $('#sign-in-with-email-link-email').val();
  auth.sendSignInLinkToEmail(email, getActionCodeSettings()).then(function() {
    alertSuccess('Email sent!');
  }, onAuthError);
}
994619
def request_password_change_mail(self, password):
        
        message = Msg(EMsg.ClientRequestChangeMail, extended=True)
        message.body.password = password

        resp = self.send_job_and_wait(message, timeout=10)

        if resp is None:
            return EResult.Timeout
        else:
            return EResult(resp.eresult)
1221724
def update_info(self, _action=None, **kwargs):
        

        def cb():
            kwargs.pop("email", None)
            kwargs.pop("username", None)
            kwargs.pop("password_hash", None)
            kwargs.pop("require_password_change", None)
            self.user.update(**kwargs)
            return kwargs

        _action = ACTIONS["UPDATE"] if _action is None else _action
        return signals.user_update(self, _action, cb, data=self.to_dict())
264471
def cancel_email_change(self):
        
        if not self.email_new:
            return

        self.email_new = None
        self.email_confirmed = True
        self.email_link = None
        self.email_new = None
        self.email_link_expires = None
449187
def update_password(user, password):
    
    user.password = hash_password(password)
    _datastore.put(user)
    send_password_reset_notice(user)
    password_reset.send(app._get_current_object(), user=user)
1002836
def change_email(self, email, as_username=False):
        
        email = email.lower()
        data = {"email": email}
        if self.email != email:
            if self.get_by_email(email):
                raise exceptions.AuthError("Email exists already")
            if as_username:
                if self.username != email:
                    if self.get_by_username(email):
                        raise exceptions.AuthError("Username exists already")
                data["username"] = email

            self.update(**data)
1292275
def send_username_changed_email(self, user):
        """"""

        # Verify config settings
        if not self.user_manager.USER_ENABLE_EMAIL: return
        if not self.user_manager.USER_SEND_USERNAME_CHANGED_EMAIL: return

        # Notification emails are sent to the user's primary email address
        user_or_user_email_object = self.user_manager.db_manager.get_primary_user_email_object(user)
        email = user_or_user_email_object.email

        # Render email from templates and send it via the configured EmailAdapter
        self._render_and_send_email(
            email,
            user,
            self.user_manager.USER_USERNAME_CHANGED_EMAIL_TEMPLATE,
        )
1304488
def email_alerts(action,
                 host=None,
                 admin_username=None,
                 admin_password=None):
    '''
    
    '''

    if action:
        return __execute_cmd('config -g cfgEmailAlert -o '
                             'cfgEmailAlertEnable -i 1 1', host=host,
                             admin_username=admin_username,
                             admin_password=admin_password)
    else:
        return __execute_cmd('config -g cfgEmailAlert -o '
                             'cfgEmailAlertEnable -i 1 0')
974370
def send(self, confirmation_email, send_date="immediately"):
        """"""
        body = {
            "ConfirmationEmail": confirmation_email,
            "SendDate": send_date}
        response = self._post(self.uri_for("send"), json.dumps(body))
776173
def update_email(strategy, details, user=None, *args, **kwargs):
    """"""
    if user:
        email = details.get('email')

        if email and user.email != email:
            user.email = email
            strategy.storage.user.changed(user)
1180122
async def SetPassword(self, changes):
        '''
        
        '''
        # map input types to rpc msg
        _params = dict()
        msg = dict(type='UserManager',
                   request='SetPassword',
                   version=1,
                   params=_params)
        _params['changes'] = changes
        reply = await self.rpc(msg)
        return reply
524990
def change_password(self, password):
        
        self.make_request(
            ModificationFailed,
            method='update',
            resource='change_password',
            params={'password': password})