Action to change the password for the given User.

@return \luya\admin\models\UserChangePassword
342959
public function actionChangePassword()
    {
        $model = new UserChangePassword();
        $model->setUser(Yii::$app->adminuser->identity);
        $model->attributes = Yii::$app->request->bodyParams;
        
        if ($this->module->strongPasswordPolicy) {
            $model->validators->append(StrengthValidator::createValidator(StrengthValidator::class, $model, ['newpass']));
        }
        
        if ($model->validate()) {
            $model->checkAndStore();
        }
        
        return $model;
    }
1134125
async def change_user_password(self, username, password):
        
        user_facade = client.UserManagerFacade.from_connection(
            self.connection())
        entity = client.EntityPassword(password, tag.user(username))
        return await user_facade.SetPassword([entity])
979810
public function changePassword()
    {
        $this->setPassword($this->password);
        $this->generateAuthKey();
        $this->removePasswordResetToken();
        return $this->save();
    }
670327
public function change_password($old_password, $new_password, $username = null)
	{
		try
		{
			return (bool) $this->update_user(array('old_password' => $old_password, 'password' => $new_password), $username);
		}
		// Only catch the wrong password exception
		catch (SimpleUserWrongPassword $e)
		{
			return false;
		}
	}
521399
public function update(ChangePasswordRequest $request, Guard $auth)
    {
        try {
            $this->dispatch(new ChangePassword($auth->user()->id, $request->get('current_password'), $request->get('new_password')));
            return redirect()->route('authentication::profile.show');
        } catch (ValidationException $e) {
            return redirect()->back()->withErrors($e->errors());
        }
    }
1249440
public function resetPassword(User $user)
    {
        $newPassword = uniqid(time(), true);
        $user->setPassword($newPassword);
        $this->save($user);

        return $newPassword;
    }
1017608
public function changePasswordAction(Request $request, $id)
    {
        /** @var TranslatorInterface $translator */
        $translator = $this->container->get('translator');
        $translationDomain = $this->container->getParameter('symfonyid.admin.translation_domain');

        /** @var \FOS\UserBundle\Model\UserManager $userManager */
        $userManager = $this->container->get('fos_user.user_manager');
        $user = $userManager->findUserBy(array('id' => $id));
        $this->isGrantedOr403Error($user);

        /** @var ConfiguratorFactory $configuratorFactory */
        $configuratorFactory = $this->getConfiguratorFactory($this->getClassName());
        /** @var CrudConfigurator $crudConfigurator */
        $crudConfigurator = $configuratorFactory->getConfigurator(CrudConfigurator::class);

        $driver = $this->get('symfonyid.admin.manager.driver_finder')->findDriverForClass($crudConfigurator->getCrud()->getModelClass());

        $form = $this->container->get('form.factory')->create(AdminChangePasswordType::class);
        $form->setData($user);
        $form->handleRequest($request);

        /** @var \SymfonyId\AdminBundle\View\View $view */
        $view = $this->getView($translator, $translationDomain);
        $view->setParam('form', $form->createView());

        $this->handleRequest($request, $user, $driver, $view, $form, $translator, $translationDomain);

        return $this->render($this->container->getParameter('symfonyid.admin.themes.change_password'), $view->getParams());
    }
235741
public function actionChangeEmail()
    {
        $token = Yii::$app->request->getBodyParam('token');
        $user = Yii::$app->adminuser->identity;
        
        if (!empty($token) && sha1($token) == $user->email_verification_token && $this->hasOpenEmailValidation($user)) {
            $newEmail = $user->setting->get(User::USER_SETTING_NEWUSEREMAIL);
            
            $user->email = $newEmail;
            if ($user->update(true, ['email'])) {
                $user->resetEmailVerification();
                $newEmail = $user->setting->remove(User::USER_SETTING_NEWUSEREMAIL);
                return ['success' => true];
            } else {
                return $this->sendModelError($user);
            }
        }
        
        return $this->sendArrayError(['email' => Module::t('account_changeemail_wrongtokenorempty')]);
    }
861745
public function changeAccountPassword($account, $password)
    {
        return $this->api->changeAccountPassword($this->getAccountId($account), $password);
    }
864307
public function changePasswordAction(Request $request, User $userToEdit)
    {

        /** @var $formFactory \FOS\UserBundle\Form\Factory\FactoryInterface */
        $formFactory = $this->get('fos_user.change_password.form.factory');

        $form = $formFactory->createForm();
        $form->setData($userToEdit);
        $form->remove('current_password');

        $form->handleRequest($request);

        if ($form->isValid()) {
            /** @var $userManager \FOS\UserBundle\Model\UserManagerInterface */
            $userManager = $this->get('fos_user.user_manager');
            $userManager->updateUser($userToEdit);

            $this->addFlash(
                'success',
                'The password for '.$userToEdit->getNameAndUsername().' was successfully changed!'
            );

            return $this->redirectToRoute('campaignchain_core_user');
        }

        return $this->render('CampaignChainCoreBundle:User:changePassword.html.twig', array(
            'form' => $form->createView(),
            'page_title' => 'Change Password for '.$userToEdit->getNameAndUsername(),
        ));
    }
391182
protected function askForNewPassword()
    {
        $this->password = $this->ask('What would you like to set the password to?');

        $q = $this->ask('Confirm the password as "' . $this->password . '" [y/n]');

        if (strtolower($q) != 'y') {
            return $this->askForNewPassword();
        }
    }
637951
def change_password(self, user, password):
        
        if not self.__contains__(user):
            raise UserNotExists
        self.new_users[user] = self._encrypt_password(password) + "\n"
56279
def change_password(self, password):
        
        self.update(password_hash=self.encrypt_password(password),
                    require_password_change=False)

        # Whenever the password is changed, reset the secret key to invalidate
        # any tokens in the wild
        self.reset_secret_key()
1073043
protected function redirectToChangePassword()
    {
        $cp = ChangePasswordForm::create($this, 'ChangePasswordForm');
        $cp->sessionMessage(
            _t('SilverStripe\\Security\\Member.PASSWORDEXPIRED', 'Your password has expired. Please choose a new one.'),
            'good'
        );
        $changedPasswordLink = Security::singleton()->Link('changepassword');

        return $this->redirect($this->addBackURLParam($changedPasswordLink));
    }
10488
public function changePassword(Request $request)
    {
        $this->validate(
            $request,
            [
                'old_password' => 'required',
                'new_password' => 'required|min:8',
            ]
        );

        if (!Hash::check($request->input('old_password'), Auth::user()->password)) {
            return redirect()->back()->withErrors([
                'old_password' => trans('mustard::account.password_incorrect'),
            ]);
        }

        if ($request->input('old_password') == $request->input('new_password')) {
            return redirect()->back()->withErrors([
                'new_password' => trans('mustard::account.password_same'),
            ]);
        }

        Auth::user()->password = Hash::make($request->input('new_password'));

        Auth::user()->save();

        Auth::user()->sendEmail(
            trans('mustard::account.password_changed'),
            'mustard::emails.account.password-changed'
        );

        return redirect()->back()->withStatus(trans('mustard::account.password_changed'));
    }
838488
public function changeUserPassword($user, $password)
    {
        $params = [
            'name' => $user,
            'password' => $password,
        ];

        $body = $this->request(self::URI_AUTH_USER_CHANGE_PASSWORD, $params);

        return $body;
    }
1023659
public function changePassword()
    {
        if ($this->validate() && $this->new_password == $this->new_password_confirm && $this->new_password) {
            $this->user->setPassword($this->new_password);
            return $this->user->save(false);
        } else {
            return false;
        }
    }