From 823d71ced9b4947b1a5a5ade7245d521ed490061 Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 7 Jun 2016 15:17:49 +0200 Subject: * renaming php directory --- app/frontend/controls/PasswordChange.php | 44 ++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 app/frontend/controls/PasswordChange.php (limited to 'app/frontend/controls/PasswordChange.php') diff --git a/app/frontend/controls/PasswordChange.php b/app/frontend/controls/PasswordChange.php new file mode 100644 index 0000000..45ce656 --- /dev/null +++ b/app/frontend/controls/PasswordChange.php @@ -0,0 +1,44 @@ +getControlState('user'); + } + + public function setUserToChange(DbUser $user) { + if ($user->IsGuest && !$this->Page->IsCallBack) { + throw new TInvalidDataValueException( + Prado::localize( + 'Password change impossible for guest user' + ) + ); + } + $this->setControlState('user', $user); + } + + public function checkPassword($sender, $param) { + $param->IsValid = $this->getFacade()->verifyUserPassword( + $this->Password->Text, $this->UserToChange + ); + } + + public function changePassword($sender, $param) { + $this->SuccessMessage->Visible = FALSE; + if ($this->Page->IsValid) { + $this->getFacade()->changePassword( + $this->UserToChange, + $this->NewPassword->Text + ); + $this->SuccessMessage->Visible = TRUE; + } + } + +} + +?> -- cgit v1.2.3