getControlState('user'); } public function setUserToChange(DbUser $user) { if ($user->IsGuest) { throw new TInvalidDataValueException('Password change impossible for guest user'); } $this->setControlState('user', $user); } public function checkPassword($sender, $param) { $param->IsValid = DbUser::verifyPassword( $this->Password->Text, $this->UserToChange->DbRecord->Password ); } public function changePassword($sender, $param) { $this->SuccessMessage->Visible = FALSE; if ($this->Page->IsValid) { $this->UserToChange->DbRecord->Password = DbUser::generatePassword( $this->NewPassword->Text ); $this->UserToChange->DbRecord->save(); $this->SuccessMessage->Visible = TRUE; } } } ?>