MediaWiki  REL1_22
SpecialEmailUser Class Reference

A special page that allows users to send e-mails to other users. More...

Inheritance diagram for SpecialEmailUser:
Collaboration diagram for SpecialEmailUser:

List of all members.

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 ()
 getGroupName ()
 Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-group-*' for valid names This method defaults to group 'other'.
 userForm ($name)
 Form to ask for target user name.

Protected Attributes

 $mTarget
User string $mTargetObj
 $mTargetObj

Detailed Description

A special page that allows users to send e-mails to other users.

Definition at line 29 of file SpecialEmailuser.php.


Constructor & Destructor Documentation

Definition at line 36 of file SpecialEmailuser.php.


Member Function Documentation

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

Parameters:
$subPagestring|null

Reimplemented from SpecialPage.

Definition at line 99 of file SpecialEmailuser.php.

References $error, $form, $out, $params, $result, $ret, $title, array(), SpecialPage\getContext(), getFormFields(), SpecialPage\getOutput(), getPermissionsError(), SpecialPage\getRequest(), getTarget(), SpecialPage\getTitle(), SpecialPage\getUser(), list, 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 behavior. Messages can be added at run-time, see MessageCache.php.

Returns:
String

Reimplemented from SpecialPage.

Definition at line 40 of file SpecialEmailuser.php.

References getTarget(), SpecialPage\msg(), and text.

Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-group-*' for valid names This method defaults to group 'other'.

Returns:
string
Since:
1.21

Reimplemented from SpecialPage.

Definition at line 376 of file SpecialEmailuser.php.

static SpecialEmailUser::getPermissionsError ( user,
editToken 
) [static]

Check whether a user is allowed to send email.

Parameters:
$userUser object
string$editTokenedit token
Returns:
null on success or string on error

Definition at line 211 of file SpecialEmailuser.php.

Referenced by ApiEmailUser\execute(), and execute().

static SpecialEmailUser::getTarget ( target) [static]

Validate target User.

Parameters:
string$targettarget user name
Returns:
User object on success or a string on error

Definition at line 179 of file SpecialEmailuser.php.

Referenced by ApiEmailUser\execute(), execute(), and getDescription().

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.

Parameters:
array$data
IContextSource$context
Returns:
Mixed: Status object, or potentially a String on error or maybe even true on success if anything uses the EmailUser hook.

Definition at line 302 of file SpecialEmailuser.php.

Referenced by ApiEmailUser\execute().

static SpecialEmailUser::uiSubmit ( array data,
HTMLForm form 
) [static]

Submit callback for an HTMLForm object, will simply call submit().

Since:
1.20
Parameters:
$dataarray
$formHTMLForm object
Returns:
Status|string|bool

Definition at line 288 of file SpecialEmailuser.php.

SpecialEmailUser::userForm ( name) [protected]

Form to ask for target user name.

Parameters:
string$nameuser name submitted.
Returns:
String: form asking for user name.

Definition at line 256 of file SpecialEmailuser.php.

Referenced by execute().


Member Data Documentation

SpecialEmailUser::$mTarget [protected]

Definition at line 30 of file SpecialEmailuser.php.

User string SpecialEmailUser::$mTargetObj [protected]

$mTargetObj

Definition at line 34 of file SpecialEmailuser.php.


The documentation for this class was generated from the following file: