.

ChangepasswordConfirmationHandler Class Reference
[Usermanagement]

Confirm password change. More...

Inheritance diagram for ChangepasswordConfirmationHandler:
ConfirmationHandlerBase IConfirmationHandler

List of all members.

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 password change.

Author:
Gerd Riesselmann

Definition at line 8 of file changepassword.confirmationhandler.php.


Member Function Documentation

ChangepasswordConfirmationHandler::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 changepassword.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, 'confirmpassword', $confirmation->data);
00022                                 $ret = $cmd->execute();
00023                                 if ($ret->is_ok()) {
00024                                         return new Message(tr('Your password 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         }
ChangepasswordConfirmationHandler::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 changepassword.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 password', 'users'),
00055                                 $user->email,
00056                                 'users/mail/changepwd',
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: