Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
TranslateSandbox Class Reference

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

Static Public Member Functions

static addUser ( $name, $email, $password)
 Adds a new user without doing much validation.
 
static deleteUser (User $user, $force='')
 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 sendEmail (User $sender, User $target, $type)
 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)
 Inclusion listing for certain API modules.
 

Detailed Description

Utility class for the sandbox feature of Translate.

Do not try this yourself. This code makes a lot of assumptions about what happens to the user account.

Definition at line 22 of file TranslateSandbox.php.

Member Function Documentation

◆ addUser()

static TranslateSandbox::addUser ( $name,
$email,
$password )
static

Adds a new user without doing much validation.

Parameters
string$nameUser name.
string$emailEmail address.
string$passwordUser provided password.
Returns
User
Exceptions
MWException

Definition at line 32 of file TranslateSandbox.php.

◆ deleteUser()

static TranslateSandbox::deleteUser ( User $user,
$force = '' )
static

Deletes a sandboxed user without doing much validation.

Parameters
User$user
string$forceIf set to 'force' will skip the little validation we have.
Exceptions
MWException

Definition at line 94 of file TranslateSandbox.php.

◆ enforcePermissions()

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

Hook: UserGetRights.

Parameters
User$user
array&$rights
Returns
true

Definition at line 263 of file TranslateSandbox.php.

◆ getUsers()

static TranslateSandbox::getUsers ( )
static

Get all sandboxed users.

Returns
UserArray List of users.

Definition at line 131 of file TranslateSandbox.php.

◆ isSandboxed()

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 252 of file TranslateSandbox.php.

◆ onApiCheckCanExecute()

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

Inclusion listing for certain API modules.

See also enforcePermissions. Hook: ApiCheckCanExecute

Parameters
ApiBase$module
User$user
string&$message
Returns
bool

Definition at line 305 of file TranslateSandbox.php.

◆ onGetPreferences()

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

Hook: onGetPreferences.

Definition at line 290 of file TranslateSandbox.php.

◆ promoteUser()

static TranslateSandbox::promoteUser ( User $user)
static

Removes the user from the sandbox.

Parameters
User$user
Exceptions
MWException

Definition at line 153 of file TranslateSandbox.php.

◆ sendEmail()

static TranslateSandbox::sendEmail ( User $sender,
User $target,
$type )
static

Sends a reminder to the user.

Parameters
User$sender
User$target
string$type'reminder' or 'promotion'
Exceptions
MWException
Since
2013.12

Definition at line 182 of file TranslateSandbox.php.


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