Change password

@param $admin
970375
private function changePassword($admin): void
    {
        $this->getPassword();

        $admin->password = bcrypt($this->password);
        $admin->save();

        $this->info('Password has been updated!');
        exit;
    }
278505
public function setPassword($password)
    {
        $this->definition->setPassword($this, $password);
        $this->setPasswordResetRequired(false);
        $this->refresh();   // force refresh
        return $this;
    }
76163
public function setPassword( $value )
	{
		if( (string) $value !== $this->getPassword() )
		{
			if( $this->helper !== null ) {
				$value = $this->helper->encode( $value, $this->getSalt() );
			}

			$this->values['customer.password'] = (string) $value;
			$this->setModified();
		}

		return $this;
	}
328491
private function checkIfAdminExists()
    {
        $adminExists = HCUsers::where('email', $this->email)->first();

        if( ! is_null($adminExists) ) {

            $this->checkIfHaveSuperAdminRole($adminExists);

            $this->info('Admin account already exists!');

            if( $this->confirm('Do you want to change its password? [y|N]') ) {
                $this->changePassword($adminExists);
            }

            exit;
        }
    }
643632
public function resetPassword($password)
    {
        // Remove the activation token.
        $this->getPasswordResetToken()->delete();

        // Update the user table with the needed details.
        $this->password = $password;
        $this->trackTime('password_updated_at');
        $this->save();
    }
524990
def change_password(self, password):
        
        self.make_request(
            ModificationFailed,
            method='update',
            resource='change_password',
            params={'password': password})
647784
def change_db_user_password(username, password):
    """"""

    sql = "ALTER USER %s WITH PASSWORD '%s'" % (username, password)
    excute_query(sql, use_sudo=True)
524487
public function setPassword($password = null)
    {
        if (empty($password)) {
            $passwordHash = '';
        } else {
            $passwordHash = $this->hashPassword($password);
        }

        $this->oxuser__oxpassword = new \OxidEsales\Eshop\Core\Field($passwordHash, \OxidEsales\Eshop\Core\Field::T_RAW);
        $this->oxuser__oxpasssalt = new \OxidEsales\Eshop\Core\Field('');
    }
326669
protected function resetPassword($user, $password)
    {
        $user->password = (new Hasher())->make($password);

        Person::save($user);
        auth()->login($user);
    }
1027404
public function resetPassword($password)
    {
        try {
            return (bool)$this->updateAttributes(['password_hash' => PasswordHelper::hash($password)]);
        } catch (Exception $e) {
            return false;
        }
    }
373397
public function setPassword($password)
    {
        if (preg_match(self::PATTERN_MATCH_PASSWORD, $password) !== 1) {
            throw new \InvalidArgumentException('The specified password is not valid as part of a URI.', 1184071239);
        }

        $this->password = $password;
    }
277799
protected function createAdminUser($admin, $output)
    {
        try {
            $this->reloadConfig();

            $userStore = Factory::getStore('User');
            $userService = new UserService($userStore);
            $userService->createUser($admin['name'], $admin['mail'], $admin['pass'], 1);

            $output->writeln('<info>'.Lang::get('user_created').'</info>');
        } catch (\Exception $ex) {
            $output->writeln('<error>'.Lang::get('failed_to_create').'</error>');
            $output->writeln('<error>' . $ex->getMessage() . '</error>');
        }
    }
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})
637951
def change_password(self, user, password):
        
        if not self.__contains__(user):
            raise UserNotExists
        self.new_users[user] = self._encrypt_password(password) + "\n"
358355
public static function changePassword($username , $new_password)
	{
		self::setUser( $username , $new_password );
		self::log( 'changepwd' , $username );
		self::save();

		return true;
	}
689888
protected function createAdmin(string $password): Admin
    {
        $admin = [
            'is_active' => true,
            'username' => 'Admin',
            'given_name' => 'Admin',
            'family_name' => 'User',
            'email' => 'admin@example.com',
        ];

        return tap(app('cortex.auth.admin')->firstOrNew($admin)->fill([
            'remember_token' => str_random(10),
            'email_verified_at' => now(),
            'password' => $password,
        ]), function ($instance) {
            $instance->save();
        });
    }
397343
def change_password(ctx):
    """"""

    username, passhash = _get_credentials(ctx.obj['username'],
                                          ctx.obj['password'],
                                          ctx.obj['db'])

    change_user = ctx.obj['db'].objectmodels['user'].find_one({
        'name': username
    })
    if change_user is None:
        log('No such user', lvl=warn)
        return

    change_user.passhash = passhash
    change_user.save()

    log("Done")