Sets the new password.<p>

@param newPwd the new password to set
178404
public void setNewPwd(String newPwd) {

        // leave password unchanged, if the new password is empty
        if (CmsStringUtil.isEmpty(newPwd)) {
            return;
        }
        try {
            OpenCms.getPasswordHandler().validatePassword(newPwd);
        } catch (CmsSecurityException e) {
            throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_INVALID_NEWPWD_0), e);
        }
        m_newPwd = newPwd;
    }
1077493
public void setPasswordHandler(I_CmsPasswordHandler passwordHandler) {

        m_passwordHandler = passwordHandler;
        if (CmsLog.INIT.isInfoEnabled()) {
            CmsLog.INIT.info(
                Messages.get().getBundle().key(
                    Messages.INIT_PWD_HANDLER_SUCCESS_1,
                    passwordHandler.getClass().getName()));
        }
    }
1060172
public Status setPassword(final String _newPasswd)
        throws EFapsException
    {
        final Type type = CIAdminUser.Person.getType();
        if (_newPasswd.length() == 0) {
            throw new EFapsException(getClass(), "PassWordLength", 1, _newPasswd.length());
        }
        final Update update = new Update(type, "" + getId());
        final Status status = update.add(CIAdminUser.Person.Password, _newPasswd);
        if (status.isOk()) {
            update.execute();
            update.close();
        } else {
            Person.LOG.error("Password could not be set by the Update, due to restrictions " + "e.g. length???");
            throw new EFapsException(getClass(), "TODO");
        }
        return status;
    }
762809
public static boolean changePassword(String userName, String newPassword) {
        LOGGER.entering(userName, newPassword.replaceAll(".", "*"));
        boolean changeSucceeded = false;
        File authFile = new File(AUTH_FILE_LOCATION);
        try {
            authFile.delete();
            authFile.createNewFile();
            createAuthFile(authFile, userName, newPassword);
            changeSucceeded = true;
        } catch (Exception e) {
            changeSucceeded = false;
        }
        LOGGER.exiting(changeSucceeded);
        return changeSucceeded;
    }
1329094
public void actionChangePassword() throws JspException {

        // save initialized instance of this class in request attribute for included sub-elements
        getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS, this);
        String newPwd = getParamNewPassword();
        String oldPwd = getParamOldPassword();
        // set the action parameter, reset the password parameters
        setAction(ACTION_DEFAULT);
        setParamOldPassword(null);
        setParamNewPassword(null);

        try {
            CmsPasswordInfo pwdInfo = new CmsPasswordInfo(getCms());
            pwdInfo.setCurrentPwd(oldPwd);
            pwdInfo.setNewPwd(newPwd);
            pwdInfo.setConfirmation(newPwd);
            pwdInfo.applyChanges();
        } catch (Throwable e) {
            // failed setting the new password, show error dialog
            setAction(ACTION_ERROR);
            includeErrorpage(this, e);
        }
    }
178098
public ApiResponse changePassword(String username, String oldPassword,
            String newPassword) {

        Map<String, Object> data = new HashMap<String, Object>();
        data.put("newpassword", newPassword);
        data.put("oldpassword", oldPassword);

        return apiRequest(HttpMethod.POST, null, data, organizationId,  applicationId, "users",
                username, "password");

    }
666426
def set_password(self, password):
        
        self.password = Security.hash(password)
        self.save()
807022
def setpassword(self, password):
        
        self._password = password
        if self._file_parser:
            if self._file_parser.has_header_encryption():
                self._file_parser = None
        if not self._file_parser:
            self._parse()
        else:
            self._file_parser.setpassword(self._password)
636170
public void setCredentials(Element el, String username, String password, Credentials c) {
	if (c == null) return;
	if (c.getUsername() != null) el.setAttribute(username, c.getUsername());
	if (c.getPassword() != null) el.setAttribute(password, c.getPassword());
    }
1080092
@Nonnull
  public EChange setUserPassword (@Nullable final String sUserID, @Nonnull final String sNewPlainTextPassword)
  {
    // Resolve user
    final User aUser = getOfID (sUserID);
    if (aUser == null)
    {
      AuditHelper.onAuditModifyFailure (User.OT, sUserID, "no-such-user-id", "password");
      return EChange.UNCHANGED;
    }

    // Create a new password salt upon password change
    final PasswordHash aPasswordHash = GlobalPasswordSettings.createUserDefaultPasswordHash (new PasswordSalt (),
                                                                                             sNewPlainTextPassword);
    m_aRWLock.writeLock ().lock ();
    try
    {
      final EChange eChange = aUser.setPasswordHash (aPasswordHash);
      if (eChange.isUnchanged ())
        return EChange.UNCHANGED;

      BusinessObjectHelper.setLastModificationNow (aUser);
      internalUpdateItem (aUser);
    }
    finally
    {
      m_aRWLock.writeLock ().unlock ();
    }
    AuditHelper.onAuditModifySuccess (User.OT, "password", sUserID);

    // Execute callback as the very last action
    m_aCallbacks.forEach (aCB -> aCB.onUserPasswordChanged (aUser));

    return EChange.CHANGED;
  }
269272
public void setUserPassword(String userPassword) {

        m_userPassword = new String(Base64.decodeBase64(userPassword.trim().getBytes()));
    }
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))
725752
public void setPassword(String username, String oldPassword, String newPassword) throws CmsException {

        m_securityManager.resetPassword(m_context, username, oldPassword, newPassword);
    }
755688
protected boolean isPasswordValid() {

        if ((m_pw.getPassword1() == null) | (m_pw.getPassword2() == null)) {
            return false;
        }
        try {
            CmsPasswordInfo pwdInfo = new CmsPasswordInfo();
            pwdInfo.setNewPwd(m_pw.getPassword1());
            pwdInfo.setConfirmation(m_pw.getPassword2());

            pwdInfo.validate();
            return true;
        } catch (CmsIllegalArgumentException | CmsIllegalStateException e) {
            LOG.error("New password is not ok", e);
            return false;
        }
    }
793355
public void setCurrentPasswordHashPassword(String newPassword) {
        this.passwordSalt = UUID.randomUUID().toString();

        try {
            this.currentPasswordHash = pwm.makePassword(new SecureUTF8String(newPassword),
                    masterPwdHashAccount, getPasswordSalt());
        } catch (Exception ignored) {}
        setStorePasswordHash(true);
    }
159533
public function setPassword(string $newPassword, string $oldPassword = null): void
	{
		if ($oldPassword != null) {
			if (!Passwords::verify($oldPassword, $this->password)) {
				throw new AuthenticationException('The password is incorrect.');
			}
		}
		$this->password = Passwords::hash($newPassword);
	}
1136257
public void setPassword(String username, String newPassword) throws CmsException {

        m_securityManager.setPassword(m_context, username, newPassword);
    }