File modules/cms/action/profile/ProfileConfirmmailAction.class.php

Last commit: Fri Feb 26 01:06:01 2021 +0100	Jan Dankert	Refactoring accessing the request parameter values.
1 <?php 2 namespace cms\action\profile; 3 use cms\action\Method; 4 use cms\action\ProfileAction; 5 use language\Messages; 6 use util\exception\ValidationException; 7 use util\Session; 8 9 class ProfileConfirmmailAction extends ProfileAction implements Method { 10 public function view() { 11 } 12 public function post() { 13 $sessionCode = Session::get( Session::KEY_MAIL_CHANGE_CODE ); 14 $newMail = Session::get( Session::KEY_MAIL_CHANGE_MAIL ); 15 $inputRegisterCode = $this->request->getText('code'); 16 17 if ( $sessionCode == $inputRegisterCode ) 18 { 19 // Best�tigungscode stimmt �berein. 20 // E-Mail-Adresse �ndern. 21 $this->user->mail = $newMail; 22 $this->user->persist(); 23 24 $this->addNoticeFor( $this->user,Messages::SAVED ); 25 } 26 else 27 { 28 // Validation code does not match 29 throw new ValidationException('code',Messages::CODE_NOT_MATCH ); 30 } 31 32 } 33 }
Download modules/cms/action/profile/ProfileConfirmmailAction.class.php
History Fri, 26 Feb 2021 01:06:01 +0100 Jan Dankert Refactoring accessing the request parameter values. Wed, 18 Nov 2020 01:46:36 +0100 Jan Dankert Refactoring of model classes: New method persist() and some other cleanups. Tue, 17 Nov 2020 23:51:00 +0100 Jan Dankert Refactoring: Every Actionmethod has now its own class.