Change password for given `username`.

    Args:
        username (str): User's name.
        new_password (str): User's new password.
540000
def change_password(username, new_password):
    
    assert username in passwd_reader.load_users(),\
           "Username '%s' not found!" % username

    sh.ftpasswd(
        "--change-password",
        passwd=True,        # passwd file, not group file
        name=username,
        stdin=True,         # tell ftpasswd to read password from stdin
        file=settings.LOGIN_FILE,
        _in=new_password
    )

    reload_configuration()
1069710
def setPassword(self, userId, password):
    '''
    
    '''
    self._setHeaders('setPassword')
    return self._sforce.service.setPassword(userId, password)
659542
def updatePassword(self,
                       user,
                       currentPassword,
                       newPassword):
        """"""
        return self.__post('/api/updatePassword',
                           data={
                               'user': user,
                               'currentPassword': currentPassword,
                               'newPassword': newPassword
                           })
78100
public static function changePasswordByCodeWithUsername($username, $code, $newPassword, $login)
    {
        return static::changePasswordByCode(static::getEmailByUsername($username), $code, $newPassword, $login);
    }
574190
def update_user_password(new_pwd_user_id, new_password,**kwargs):
    
    #check_perm(kwargs.get('user_id'), 'edit_user')
    try:
        user_i = db.DBSession.query(User).filter(User.id==new_pwd_user_id).one()
        user_i.password = bcrypt.hashpw(str(new_password).encode('utf-8'), bcrypt.gensalt())
        return user_i
    except NoResultFound:
        raise ResourceNotFoundError("User (id=%s) not found"%(new_pwd_user_id))
547397
def alter_database_user(self, username, password=None, permissions=None):
        
        url = "db/{0}/users/{1}".format(self._database, username)

        if not password and not permissions:
            raise ValueError("Nothing to alter for user {0}.".format(username))

        data = {}

        if password:
            data['password'] = password

        if permissions:
            try:
                data['readFrom'], data['writeTo'] = permissions
            except (ValueError, TypeError):
                raise TypeError(
                    "'permissions' must be (readFrom, writeTo) tuple"
                )

        self.request(
            url=url,
            method='POST',
            data=data,
            expected_response_code=200
        )

        if username == self._username:
            self._password = password

        return True
1326322
def change_user_password(self, ID, data):
        """"""
        # http://teampasswordmanager.com/docs/api-users/#change_password
        log.info('Change user %s password' % ID)
        self.put('users/%s/change_password.json' % ID, data)
1267006
def configure(username, password):
    # type: (str, str) -> None
    
    from peltak.extra.pypi import logic
    logic.gen_pypirc(username, password)
714949
def set_username(self, username = None):
        
        
        if username is None or type(username) is not str:
            raise KPError("Need a new image number")
        else:
            self.username = username
            self.last_mod = datetime.now().replace(microsecond=0)
            return True
167817
public function actionChangePassword()
    {
        $username = $this->prompt('Username:', ['required' => true]);
        $user = $this->findModel($username);
        $user->setPassword($this->prompt('New password:', [
            'required' => true,
            'pattern' => '#^.{6,255}$#i',
            'error' => 'More than 6 symbols',
        ]));
        $this->log($this->repository->save($user));
    }
1225633
def update_user(self, instance, user, name=None, password=None, host=None):
        
        return instance.update_user(user, name=name, password=password,
                host=host)
713027
def reset_password(self):
        

        def cb():
            password = get_random_password()
            self.change_password(password)
            return password

        return signals.user_update(self, ACTIONS["PASSWORD"], cb)
1266799
def change_username(self, username):
        

        def cb():

            if self.login_method == "username" and "@" in username:
                raise exceptions.AuthError(_("Username can't be an email"))
            elif self.login_method == "email" and "@" not in username:
                raise exceptions.AuthError(_("Invalid email login"))
            if "@" in username:
                if not utils.is_email_valid(username):
                    raise exceptions.AuthError("Email address invalid")
            elif not utils.is_username_valid(username):
                raise exceptions.AuthError("Username invalid")

            # Change both email and
            if self.login_method == "email":
                if not models.AuthUser.get_by_username(username) \
                        and not models.AuthUser.get_by_email(username):
                    self.user.change_username(username)
                    self.user.change_email(username)
            else:
                self.user.change_username(username)
            return username

        return signals.user_update(self, ACTIONS["USERNAME"], cb)
557978
public function changePassword($username, $password)
    {
        $user = $this->findUserByUsernameOrThrowException($username);
        $user->setPlainPassword($password);
        $this->userManager->updateUser($user);

        $event = new UserEvent($user, $this->getRequest());
        $this->dispatcher->dispatch(Events::USER_PASSWORD_CHANGED, $event);
    }
1032329
def set_account_username(self, account, old_username, new_username):
        
        luser = self._get_account(old_username)
        rename(luser, database=self._database, uid=new_username)
853256
public function changePassword($username, $newPass)
    {
        $password = $this->hasher->HashPassword($newPass);
        return $this
            ->conn
            ->prepare(sprintf("UPDATE %s SET user_pass=:newPass WHERE user_name = :username", $this->table))
            ->execute(['newPass' => $password, 'username' => $username]);
    }
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;
		}
	}