MediaWiki
REL1_20
|
A special page that allows users to send e-mails to other users. More...
Public Member Functions | |
__construct () | |
execute ($par) | |
Default execute method Checks user permissions, calls the function given in mFunction. | |
getDescription () | |
Returns the name that goes in the <h1> in the special page itself, and also the name that will be listed in Special:Specialpages. | |
Static Public Member Functions | |
static | getPermissionsError ($user, $editToken) |
Check whether a user is allowed to send email. | |
static | getTarget ($target) |
Validate target User. | |
static | submit (array $data, IContextSource $context) |
Really send a mail. | |
static | uiSubmit (array $data, HTMLForm $form) |
Submit callback for an HTMLForm object, will simply call submit(). | |
Protected Member Functions | |
getFormFields () | |
userForm ($name) | |
Form to ask for target user name. | |
Protected Attributes | |
$mTarget |
A special page that allows users to send e-mails to other users.
Definition at line 29 of file SpecialEmailuser.php.
Definition at line 32 of file SpecialEmailuser.php.
SpecialEmailUser::execute | ( | $ | subPage | ) |
Default execute method Checks user permissions, calls the function given in mFunction.
This must be overridden by subclasses; it will be made abstract in a future version
$subPage | string|null |
Reimplemented from SpecialPage.
Definition at line 95 of file SpecialEmailuser.php.
References $out, $params, $result, $title, SpecialPage\getContext(), getFormFields(), SpecialPage\getOutput(), getPermissionsError(), SpecialPage\getRequest(), getTarget(), SpecialPage\getTitle(), SpecialPage\getUser(), SpecialPage\msg(), SpecialPage\outputHeader(), SpecialPage\setHeaders(), userForm(), and wfRunHooks().
Returns the name that goes in the <h1> in the special page itself, and also the name that will be listed in Special:Specialpages.
Derived classes can override this, but usually it is easier to keep the default behaviour. Messages can be added at run-time, see MessageCache.php.
Reimplemented from SpecialPage.
Definition at line 36 of file SpecialEmailuser.php.
References getTarget(), and SpecialPage\msg().
SpecialEmailUser::getFormFields | ( | ) | [protected] |
Definition at line 45 of file SpecialEmailuser.php.
References SpecialPage\getName(), SpecialPage\getUser(), Linker\link(), and SpecialPage\msg().
Referenced by execute().
static SpecialEmailUser::getPermissionsError | ( | $ | user, |
$ | editToken | ||
) | [static] |
Check whether a user is allowed to send email.
$user | User object |
$editToken | String: edit token |
Definition at line 196 of file SpecialEmailuser.php.
References $user, wfDebug(), and wfRunHooks().
Referenced by ApiEmailUser\execute(), and execute().
static SpecialEmailUser::getTarget | ( | $ | target | ) | [static] |
Validate target User.
$target | String: target user name |
Definition at line 168 of file SpecialEmailuser.php.
References User\getId(), User\newFromName(), and wfDebug().
Referenced by ApiEmailUser\execute(), execute(), getDescription(), and submit().
static SpecialEmailUser::submit | ( | array $ | data, |
IContextSource $ | context | ||
) | [static] |
Really send a mail.
Permissions should have been checked using getPermissionsError(). It is probably also a good idea to check the edit token and ping limiter in advance.
Definition at line 269 of file SpecialEmailuser.php.
References getTarget(), IContextSource\getUser(), IContextSource\msg(), UserMailer\send(), and wfRunHooks().
Referenced by ApiEmailUser\execute(), and uiSubmit().
static SpecialEmailUser::uiSubmit | ( | array $ | data, |
HTMLForm $ | form | ||
) | [static] |
Submit callback for an HTMLForm object, will simply call submit().
$data | array |
$form | HTMLForm object |
Definition at line 257 of file SpecialEmailuser.php.
References ContextSource\getContext(), and submit().
SpecialEmailUser::userForm | ( | $ | name | ) | [protected] |
Form to ask for target user name.
$name | String: user name submitted. |
Definition at line 236 of file SpecialEmailuser.php.
References Xml\closeElement(), SpecialPage\getTitle(), Html\hidden(), Xml\inputLabel(), SpecialPage\msg(), Xml\openElement(), Html\rawElement(), and Xml\submitButton().
Referenced by execute().
SpecialEmailUser::$mTarget [protected] |
Definition at line 30 of file SpecialEmailuser.php.