src/wcmf/application/controller/UserController.php
public function changePassword() {
    $this->requireTransaction();
    $session = $this->getSession();
    $permissionManager = $this->getPermissionManager();
    $request = $this->getRequest();
    $response = $this->getResponse();

    // load model
    $authUser = $this->principalFactory->getUser($session->getAuthUser());
    if ($authUser) {
      // add permissions for this operation
      $oidStr = $authUser->getOID()->__toString();
      $this->tempPermissions[] = $permissionManager->addTempPermission($oidStr, '', PersistenceAction::READ);
      $this->tempPermissions[] = $permissionManager->addTempPermission($oidStr.'.password', '', PersistenceAction::UPDATE);

      $this->changePasswordImpl($authUser, $request->getValue('oldpassword'),
          $request->getValue('newpassword1'), $request->getValue('newpassword2'));
    }
    // success
    $response->setAction('ok');
  }
public function changePassword() {
    $this->requireTransaction();
    $session = $this->getSession();
    $permissionManager = $this->getPermissionManager();
    $request = $this->getRequest();
    $response = $this->getResponse();

    // load model
    $authUser = $this->principalFactory->getUser($session->getAuthUser());
    if ($authUser) {
      // add permissions for this operation
      $oidStr = $authUser->getOID()->__toString();
      $this->tempPermissions[] = $permissionManager->addTempPermission($oidStr, '', PersistenceAction::READ);
      $this->tempPermissions[] = $permissionManager->addTempPermission($oidStr.'.password', '', PersistenceAction::UPDATE);

      $this->changePasswordImpl($authUser, $request->getValue('oldpassword'),
          $request->getValue('newpassword1'), $request->getValue('newpassword2'));
    }
    // success
    $response->setAction('ok');
  }
public function changePassword ( ) { $ this -> requireTransaction ( ) ; $ session = $ this -> getSession ( ) ; $ permissionManager = $ this -> getPermissionManager ( ) ; $ request = $ this -> getRequest ( ) ; $ response = $ this -> getResponse ( ) ; // load model $ authUser = $ this -> principalFactory -> getUser ( $ session -> getAuthUser ( ) ) ; if ( $ authUser ) { // add permissions for this operation $ oidStr = $ authUser -> getOID ( ) -> __toString ( ) ; $ this -> tempPermissions [ ] = $ permissionManager -> addTempPermission ( $ oidStr , '' , PersistenceAction :: READ ) ; $ this -> tempPermissions [ ] = $ permissionManager -> addTempPermission ( $ oidStr . '.password' , '' , PersistenceAction :: UPDATE ) ; $ this -> changePasswordImpl ( $ authUser , $ request -> getValue ( 'oldpassword' ) , $ request -> getValue ( 'newpassword1' ) , $ request -> getValue ( 'newpassword2' ) ) ; } // success $ response -> setAction ( 'ok' ) ; }
Change the user's password

| Parameter           | Description
|---------------------|----------------------
| _in_ `oldpassword`  | The old password
| _in_ `newpassword1` | The new password
| _in_ `newpassword2` | The new password
Change the user s password