TranslateSandbox Class Reference

Utility class for the sandbox feature of Translate. More...

List of all members.

Static Public Member Functions

static addUser ($name, $email, $password)
 Adds a new user without doing much validation.
static deleteUser (User $user)
 Deletes a sandboxed user without doing much validation.
static getUsers ()
 Get all sandboxed users.
static promoteUser (User $user)
 Removes the user from the sandbox.
static sendReminder (User $sender, User $target, $subject, $body)
 Sends a reminder to the user.
static isSandboxed (User $user)
 Shortcut for checking if given user is in the sandbox.
static enforcePermissions (User $user, array &$rights)
 Hook: UserGetRights.
static onGetPreferences ($user, &$preferences)
 Hook: onGetPreferences.
static onApiCheckCanExecute (ApiBase $module, User $user, &$message)
 Whitelisting for certain API modules.

Detailed Description

Utility class for the sandbox feature of Translate.

Definition at line 13 of file TranslateSandbox.php.


Member Function Documentation

static TranslateSandbox::addUser ( name,
email,
password 
) [static]

Adds a new user without doing much validation.

Parameters:
string $name User name.
string $email Email address.
string $password User provided password.
Returns:
User
Exceptions:
MWException 

Definition at line 22 of file TranslateSandbox.php.

Referenced by ApiTranslateSandbox::doCreate(), TranslateSandboxTest::testAddUser(), TranslateSandboxTest::testDeleteUser(), TranslateSandboxTest::testDeleteUserPromoted(), TranslateSandboxTest::testGetUsers(), TranslateSandboxTest::testGetUsersPromotion(), TranslateSandboxTest::testPermissions(), and TranslateSandboxTest::testPromoteUser().

static TranslateSandbox::deleteUser ( User $  user  )  [static]

Deletes a sandboxed user without doing much validation.

Parameters:
User $user
Exceptions:
MWException 

Definition at line 48 of file TranslateSandbox.php.

Referenced by ApiTranslateSandbox::doDelete(), TranslateSandboxTest::testDeleteUser(), TranslateSandboxTest::testDeleteUserPromoted(), and TranslateSandboxTest::testGetUsers().

static TranslateSandbox::enforcePermissions ( User $  user,
array &$  rights 
) [static]

Hook: UserGetRights.

Definition at line 144 of file TranslateSandbox.php.

static TranslateSandbox::getUsers (  )  [static]

Get all sandboxed users.

Returns:
UserArray List of users.

Definition at line 70 of file TranslateSandbox.php.

Referenced by SpecialTranslateSandbox::makeList(), TranslateSandboxTest::testGetUsers(), and TranslateSandboxTest::testGetUsersPromotion().

static TranslateSandbox::isSandboxed ( User $  user  )  [static]

Shortcut for checking if given user is in the sandbox.

Parameters:
User $user
Returns:
bool
Since:
2013.06

Definition at line 135 of file TranslateSandbox.php.

Referenced by SpecialTranslationStash::hasPermissionToUse(), and onApiCheckCanExecute().

static TranslateSandbox::onApiCheckCanExecute ( ApiBase $  module,
User $  user,
&$  message 
) [static]

Whitelisting for certain API modules.

See also enforcePermissions. Hook: ApiCheckCanExecute

Definition at line 173 of file TranslateSandbox.php.

Here is the call graph for this function:

static TranslateSandbox::onGetPreferences ( user,
&$  preferences 
) [static]

Hook: onGetPreferences.

Definition at line 162 of file TranslateSandbox.php.

static TranslateSandbox::promoteUser ( User $  user  )  [static]
static TranslateSandbox::sendReminder ( User $  sender,
User $  target,
subject,
body 
) [static]

Sends a reminder to the user.

Parameters:
User $sender
User $target
string $subject Subject of the email.
string $body Body of the email.
Exceptions:
MWException 

Definition at line 110 of file TranslateSandbox.php.

Referenced by ApiTranslateSandbox::doRemind().

Here is the call graph for this function:


The documentation for this class was generated from the following file:
Generated on Tue Oct 29 00:00:55 2013 for MediaWiki Translate Extension by  doxygen 1.6.3