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) |
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. |
Utility class for the sandbox feature of Translate.
Definition at line 13 of file TranslateSandbox.php.
static TranslateSandbox::addUser | ( | $ | name, | |
$ | email, | |||
$ | password | |||
) | [static] |
Adds a new user without doing much validation.
string | $name User name. | |
string | $email Email address. | |
string | $password User provided password. |
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.
User | $user |
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.
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.
User | $user |
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.
static TranslateSandbox::onGetPreferences | ( | $ | user, | |
&$ | preferences | |||
) | [static] |
Hook: onGetPreferences.
Definition at line 162 of file TranslateSandbox.php.
static TranslateSandbox::promoteUser | ( | User $ | user | ) | [static] |
Removes the user from the sandbox.
User | $user |
MWException |
Definition at line 89 of file TranslateSandbox.php.
Referenced by ApiTranslateSandbox::doPromote(), TranslateSandboxTest::testDeleteUserPromoted(), TranslateSandboxTest::testGetUsersPromotion(), TranslateSandboxTest::testPermissions(), and TranslateSandboxTest::testPromoteUser().
static TranslateSandbox::sendReminder | ( | User $ | sender, | |
User $ | target, | |||
$ | subject, | |||
$ | body | |||
) | [static] |
Sends a reminder to the user.
User | $sender | |
User | $target | |
string | $subject Subject of the email. | |
string | $body Body of the email. |
MWException |
Definition at line 110 of file TranslateSandbox.php.
Referenced by ApiTranslateSandbox::doRemind().