Sends an email to user allowing them to confirm their password.
518194
def send_confirm_password_email(person):
    """"""
    url = '%s/profile/login/%s/' % (
        settings.REGISTRATION_BASE_URL, person.username)

    context = CONTEXT.copy()
    context.update({
        'url': url,
        'receiver': person,
    })

    to_email = person.email
    subject, body = render_email('confirm_password', context)

    send_mail(subject, body, settings.ACCOUNTS_EMAIL, [to_email])
519283
def confirm_email_view(self, token):
        
        # Verify token
        data_items = self.token_manager.verify_token(
            token,
            self.USER_CONFIRM_EMAIL_EXPIRATION)

        # Retrieve user, user_email by ID
        user = None
        user_email = None
        if data_items:
            user, user_email = self.db_manager.get_user_and_user_email_by_id(data_items[0])

        if not user or not user_email:
            flash(_('Invalid confirmation token.'), 'error')
            return redirect(url_for('user.login'))

        # Set UserEmail.email_confirmed_at
        user_email.email_confirmed_at=datetime.utcnow()
        self.db_manager.save_user_and_user_email(user, user_email)
        self.db_manager.commit()

        # Send confirmed_email signal
        signals.user_confirmed_email.send(current_app._get_current_object(), user=user)

        # Flash a system message
        flash(_('Your email has been confirmed.'), 'success')

        # Auto-login after confirm or redirect to login page
        safe_next_url = self._get_safe_next_url('next', self.USER_AFTER_CONFIRM_ENDPOINT)
        if self.USER_AUTO_LOGIN_AFTER_CONFIRM:
            return self._do_login_user(user, safe_next_url)  # auto-login
        else:
            return redirect(url_for('user.login') + '?next=' + quote(safe_next_url))
379963
def send_activation_email(self, user):
        
        activation_key = self.get_activation_key(user)
        context = self.get_email_context(activation_key)
        context['user'] = user
        subject = render_to_string(
            template_name=self.email_subject_template,
            context=context,
            request=self.request
        )
        # Force subject to a single line to avoid header-injection
        # issues.
        subject = ''.join(subject.splitlines())
        message = render_to_string(
            template_name=self.email_body_template,
            context=context,
            request=self.request
        )
        user.email_user(subject, message, settings.DEFAULT_FROM_EMAIL)
1324011
function(email) {
      var user = this.getUser();
      if (user) {
        return this._q.when(user.updateEmail(email));
      } else {
        return this._q.reject("Cannot update email since there is no logged in user.");
      }
    }
1059781
public function sendEmail($email)
    {
        $user = $this->users->where('email', $email)->first();

        if (! is_null($user)) {
            $user->generatePasswordResetToken();
        }
    }
313114
def check_auth(email, password):
    
    try:
        user = User.get(User.email == email)
    except User.DoesNotExist:
        return False
    return password == user.password
101093
def send_verification_email(self):
        
        url = (self._imgur._base_url + "/3/account/{0}"
               "/verifyemail".format(self.name))
        self._imgur._send_request(url, needs_auth=True, method='POST')
252594
def check_or_set_password

    if self.password.blank?
      self.password =
        ::Milia::Password.generate(
          8, Password::ONE_DIGIT | Password::ONE_CASE
        )

        self.password_confirmation = self.password
    else
      # if a password is being supplied, then ok to skip
      # setting up a password upon confirm
      self.skip_confirm_change_password = true if ::Milia.use_invite_member
    end

  end
22653
def generate_confirmation_token(self, user):
        
        data = [str(user.id), self.hash_data(user.email)]
        return self.security.confirm_serializer.dumps(data)
786684
def send_email(self, user, subject, msg):
        """"""
        print('To:', user)
        print('Subject:', subject)
        print(msg)
750857
def a_send_password(password, ctx):
    
    if password:
        ctx.ctrl.send_command(password, password=True)
        return True
    else:
        ctx.ctrl.disconnect()
        raise ConnectionAuthenticationError("Password not provided", ctx.ctrl.hostname)
475948
public function confirmEmailChangePasswordAction()
    {
      $token = $this->params()->fromRoute('id');
      try {
        $entityManager = $this->getEntityManager();
        if($token !== '' && $user = $entityManager->getRepository('CsnUser\Entity\User')->findOneBy(array('registrationToken' => $token))) {
          $user->setRegistrationToken(md5(uniqid(mt_rand(), true)));
          $password = $this->generatePassword();
          $user->setPassword(UserCredentialsService::encryptPassword($password));
          $email = $user->getEmail();
          $fullLink = $this->getBaseUrl() . $this->url()->fromRoute('user-index', array( 'action' => 'login'));
          $this->sendEmail(
              $user->getEmail(),
              'Your password has been changed!',
              sprintf($this->getTranslatorHelper()->translate('Hello again %s. Your new password is: %s. Please, follow this link %s to log in with your new password.'), $user->getUsername(), $password, $fullLink)
              
          );          
          $entityManager->persist($user);
          $entityManager->flush();
    
          $viewModel = new ViewModel(array(
              'email' => $email,
              'navMenu' => $this->getOptions()->getNavMenu()
          ));
          return $viewModel;
        } else {
          return $this->redirect()->toRoute('user-index');
        }
      } catch (\Exception $e) {
        return $this->getServiceLocator()->get('csnuser_error_view')->createErrorView(
            $this->getTranslatorHelper()->translate('An error occured during the confirmation of your password change! Please, try again later.'),
            $e,
            $this->getOptions()->getDisplayExceptions(),
            $this->getOptions()->getNavMenu()
        );
      }
    }
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,
        )
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))
938601
def send_confirmation_email(self):
        
        form = self._get_form('SECURITY_SEND_CONFIRMATION_FORM')
        if form.validate_on_submit():
            self.security_service.send_email_confirmation_instructions(form.user)
            self.flash(_('flask_unchained.bundles.security:flash.confirmation_request',
                         email=form.user.email), category='info')
            if request.is_json:
                return '', HTTPStatus.NO_CONTENT

        elif form.errors and request.is_json:
            return self.errors(form.errors)

        return self.render('send_confirmation_email',
                           send_confirmation_form=form,
                           **self.security.run_ctx_processor('send_confirmation_email'))
916267
def send_reset_password_email(person):
    """"""
    uid = urlsafe_base64_encode(force_bytes(person.pk)).decode("ascii")
    token = default_token_generator.make_token(person)
    url = '%s/persons/reset/%s/%s/' % (
        settings.REGISTRATION_BASE_URL, uid, token)

    context = CONTEXT.copy()
    context.update({
        'url': url,
        'receiver': person,
    })

    to_email = person.email
    subject, body = render_email('reset_password', context)

    send_mail(subject, body, settings.ACCOUNTS_EMAIL, [to_email])
760181
def create_user(email, password, active, confirmed_at, send_email):
    
    if confirmed_at == 'now':
        confirmed_at = security.datetime_factory()
    user = user_manager.create(email=email, password=password, active=active,
                               confirmed_at=confirmed_at)
    if click.confirm(f'Are you sure you want to create {user!r}?'):
        security_service.register_user(user, allow_login=False, send_email=send_email)
        user_manager.save(user, commit=True)
        click.echo(f'Successfully created {user!r}')
    else:
        click.echo('Cancelled.')