ChangeemailConfirmationHandler Class Reference
[Usermanagement]
Confirm email change. More...
Inheritance diagram for
ChangeemailConfirmationHandler:
Protected Member Functions |
|
do_confirm ($confirmation, $success) | |
Template method to be overloaded by
subclasses to do what should be done on successfull confirmation.
|
|
do_created ($confirmation) | |
Template method to be overloaded by
subclasses to do what should be done on creation. |
Detailed Description
Confirm email change.
Definition at line 8 of file changeemail.confirmationhandler.php.
Member Function Documentation
ChangeemailConfirmationHandler::do_confirm | ( | $ | confirmation, | |
$ | success | |||
) | [protected] |
Template method to be overloaded by subclasses to do what should be done on successfull confirmation.
- Parameters:
-
DAOConfirmations Data of confirmation, not necessarily up to date, depending on status enum Indicates success or failure
Reimplemented from ConfirmationHandlerBase.
Definition at line 17 of file changeemail.confirmationhandler.php.
00017 { 00018 if ($success == self::SUCCESS) { 00019 $user = Users::get($confirmation->id_item); 00020 if ($user && $user->is_active()) { 00021 $cmd = CommandsFactory::create_command($user, 'confirmemail', $confirmation->data); 00022 $ret = $cmd->execute(); 00023 if ($ret->is_ok()) { 00024 return new Message(tr('Your e-mail address has been changed', 'users')); 00025 } else { 00026 return $ret; 00027 } 00028 } 00029 else { 00030 return new Status(tr('No matching user account was found', 'users')); 00031 } 00032 } 00033 else { 00034 return parent::do_confirm($confirmation, $success); 00035 } 00036 }
ChangeemailConfirmationHandler::do_created | ( | $ | confirmation | ) | [protected] |
Template method to be overloaded by subclasses to do what should be done on creation.
- Parameters:
-
DAOConfirmations Data of confirmation
- Returns:
- Status
Reimplemented from ConfirmationHandlerBase.
Definition at line 47 of file changeemail.confirmationhandler.php.
00047 { 00048 $ret = new Status(); 00049 00050 $user = Users::get($confirmation->id_item); 00051 if ($user) { 00052 Load::commands('generics/mail'); 00053 $cmd = new MailCommand( 00054 tr('Confirm new e-mail address', 'users'), 00055 $confirmation->data, 00056 'users/mail/changeemail', 00057 array('confirmation' => $confirmation) 00058 ); 00059 $ret->merge($cmd->execute()); 00060 } 00061 else { 00062 $ret->append(tr('Unkown User set on email change confirmation', 'users')); 00063 } 00064 00065 return $ret; 00066 }
The documentation for this class was generated from the following file:
- contributions/usermanagement/behaviour/confirmationhandlers/changeemail.confirmationhandler.php