MediaWiki  REL1_19
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.

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 ($data)
 Really send a mail.

Protected Member Functions

 getFormFields ()
 userForm ($name)
 Form to ask for target user name.

Protected Attributes

 $mTarget

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 32 of file SpecialEmailuser.php.


Member Function Documentation

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:
$parString subpage string, if one was specified

Reimplemented from SpecialPage.

Definition at line 85 of file SpecialEmailuser.php.

References $out, $result, $title, SpecialPage\getContext(), getFormFields(), SpecialPage\getOutput(), getPermissionsError(), SpecialPage\getRequest(), getTarget(), SpecialPage\getTitle(), SpecialPage\getUser(), SpecialPage\msg(), SpecialPage\outputHeader(), SpecialPage\setHeaders(), userForm(), wfMsg(), wfMsgExt(), and wfRunHooks().

Here is the call graph for this function:

Definition at line 36 of file SpecialEmailuser.php.

References SpecialPage\getName(), SpecialPage\getUser(), Linker\link(), and wfMsgExt().

Referenced by execute().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Check whether a user is allowed to send email.

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

Definition at line 182 of file SpecialEmailuser.php.

References $user, $wgEnableEmail, $wgEnableUserEmail, wfDebug(), and wfRunHooks().

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

Here is the call graph for this function:

Here is the caller graph for this function:

static SpecialEmailUser::getTarget ( target) [static]

Validate target User.

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

Definition at line 154 of file SpecialEmailuser.php.

References User\getId(), User\newFromName(), and wfDebug().

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

Here is the call graph for this function:

Here is the caller graph for this function:

static SpecialEmailUser::submit ( data) [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.

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 243 of file SpecialEmailuser.php.

References $wgPasswordSender, $wgPasswordSenderName, $wgUser, $wgUserEmailUseReplyTo, getTarget(), UserMailer\send(), wfMsg(), wfMsgExt(), and wfRunHooks().

Referenced by ApiEmailUser\execute().

Here is the call graph for this function:

Here is the caller graph for this function:

SpecialEmailUser::userForm ( name) [protected]

Form to ask for target user name.

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

Definition at line 222 of file SpecialEmailuser.php.

References $wgScript, Xml\closeElement(), SpecialPage\getTitle(), Html\hidden(), Xml\inputLabel(), Xml\openElement(), Html\rawElement(), Xml\submitButton(), and wfMessage().

Referenced by execute().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

SpecialEmailUser::$mTarget [protected]

Definition at line 30 of file SpecialEmailuser.php.


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