protected function createComponentPasswordForm()
 {
     $form = $this->passwordChangeFormFactory->create($this->user);
     $this->passwordChangeFormFactory->onBeforeChange[] = [$this, 'onBeforeChange'];
     $this->passwordChangeFormFactory->onSuccess[] = [$this, 'onSuccess'];
     $this->passwordChangeFormFactory->onError[] = [$this, 'onError'];
     return $form;
 }
 /**
  * @Actions change
  */
 protected function createComponentPasswordChangeForm()
 {
     $form = $this->passwordChangeFactory->create($this->userEntity);
     unset($form['currentPassword']);
     $form->addText('username', 'Uživatel:')->setRequired()->getControlPrototype()->readonly = 'readonly';
     $form->addText('email', 'E-mail:')->setRequired()->getControlPrototype()->readonly = 'readonly';
     $this->passwordChangeFactory->onBeforeChange[] = [$this, 'onBeforeChange'];
     $this->passwordChangeFactory->onSuccess[] = [$this, 'onSuccess'];
     $this->passwordChangeFactory->onError = [$this, 'onError'];
     return $form;
 }