StatusAnyUsersCommand Class Reference
[Usermanagement]
Command to set status. More...
Inheritance diagram for
StatusAnyUsersCommand:
Protected Member Functions |
|
do_can_execute_status ($user, IStatusHolder $inst, $new_status) | |
Check if command can be executed. |
|
do_execute () | |
Change status. |
Detailed Description
Command to set status.
Notifies user of change by sending a mail
Definition at line 12 of file status.any.cmd.php.
Member Function Documentation
StatusAnyUsersCommand::do_can_execute_status | ( | $ | user, | |
IStatusHolder $ | inst, | |||
$ | new_status | |||
) | [protected] |
Check if command can be executed.
- Parameters:
-
mixed $user IStatusHolder $inst mixed $new_status
- Returns:
- bool
Reimplemented from StatusAnyCommand.
Definition at line 21 of file status.any.cmd.php.
00021 { 00022 return $new_status != Users::STATUS_UNCONFIRMED; 00023 }
StatusAnyUsersCommand::do_execute | ( | ) | [protected] |
Change status.
- Returns:
- Status
Reimplemented from StatusAnyCommand.
Definition at line 30 of file status.any.cmd.php.
00030 { 00031 $ret = new Status(); 00032 $ret->merge(parent::do_execute()); 00033 if ($ret->is_ok()) { 00034 $user = $this->get_instance(); 00035 $new_status = tr($this->get_params(), 'users'); 00036 //Cas: ist das hier korrekt? 00037 if (Config::has_feature(ConfigUsermanagement::MAIL_STATUSCHANGE)) { 00038 Load::commands('generics/mail'); 00039 $cmd = new MailCommand( 00040 tr('Your account was set to "%status%"', 'users', array('%status%' => $new_status)), 00041 $user->email, 00042 'users/mail/statuschange', 00043 array('new_status' => $new_status) 00044 ); 00045 $this->append($cmd); 00046 } 00047 } 00048 return $ret; 00049 }
The documentation for this class was generated from the following file:
- contributions/usermanagement/behaviour/commands/users/status.any.cmd.php