Inherits SpecialPage.
Public Member Functions | |
__construct () | |
isRestricted () | |
Can be overridden by subclasses with more complicated permissions schemes. | |
userCanExecute ($user) | |
Checks if the given user (identified by an object) can execute this special page (as defined by $mRestriction). | |
userCanChangeRights ($user, $checkIfSelf=true) | |
execute ($par) | |
Manage forms to be shown according to posted data. | |
getSuccessURL () | |
saveUserGroups ($username, $reason= '') | |
Save user groups changes in the database. | |
addLogEntry ($user, $oldGroups, $newGroups) | |
Add a rights log entry for an action. | |
editUserGroupsForm ($username) | |
Edit user groups membership. | |
fetchUser ($username) | |
Normalize the input username, which may be local or remote, and return a user (or proxy) object for manipulating it. | |
makeGroupNameList ($ids) | |
makeGroupNameListForLog ($ids) | |
switchForm () | |
Output a form to allow searching for a user. | |
changeableGroups () | |
Returns an array of the groups that the user can add/remove. | |
Protected Member Functions | |
splitGroups ($groups) | |
Go through used and available groups and return the ones that this form will be able to manipulate based on the current user's system permissions. | |
showEditUserGroupsForm ($user, $groups) | |
Show the form to edit group memberships. | |
showLogFragment ($user, $output) | |
Show a rights log fragment for the specified user. | |
Static Protected Member Functions | |
static | getAllGroups () |
Returns an array of all groups that may be edited. | |
Protected Attributes | |
$mTarget | |
$isself = false | |
Private Member Functions | |
groupCheckboxes ($usergroups) | |
Adds a table with checkboxes where you can select what groups to add/remove. | |
canRemove ($group) | |
canAdd ($group) | |
changeableByGroup ($group) | |
Returns an array of the groups that a particular group can add/remove. | |
Static Private Member Functions | |
static | buildGroupLink ($group) |
Format a link to a group description page. |
Definition at line 13 of file SpecialUserrights.php.
UserrightsPage::__construct | ( | ) |
Definition at line 20 of file SpecialUserrights.php.
UserrightsPage::addLogEntry | ( | $ | user, | |
$ | oldGroups, | |||
$ | newGroups | |||
) |
Add a rights log entry for an action.
Definition at line 202 of file SpecialUserrights.php.
References $user, $wgRequest, and makeGroupNameListForLog().
Referenced by saveUserGroups().
static UserrightsPage::buildGroupLink | ( | $ | group | ) | [static, private] |
Format a link to a group description page.
$group | string |
Definition at line 409 of file SpecialUserrights.php.
References User::getGroupName().
Referenced by showEditUserGroupsForm().
UserrightsPage::canAdd | ( | $ | group | ) | [private] |
$group | string: the name of the group to check |
Definition at line 512 of file SpecialUserrights.php.
References changeableGroups().
Referenced by groupCheckboxes().
UserrightsPage::canRemove | ( | $ | group | ) | [private] |
$group | String: the name of the group to check |
Definition at line 501 of file SpecialUserrights.php.
References changeableGroups().
Referenced by groupCheckboxes().
UserrightsPage::changeableByGroup | ( | $ | group | ) | [private] |
Returns an array of the groups that a particular group can add/remove.
$group | String: the group to check for whether it can add/remove |
Definition at line 569 of file SpecialUserrights.php.
References $key, $wgAddGroups, $wgGroupsAddToSelf, $wgGroupsRemoveFromSelf, $wgRemoveGroups, and getAllGroups().
Referenced by changeableGroups().
UserrightsPage::changeableGroups | ( | ) |
Returns an array of the groups that the user can add/remove.
Definition at line 522 of file SpecialUserrights.php.
References $wgUser, changeableByGroup(), User::getAllGroups(), and wfRunHooks().
Referenced by canAdd(), canRemove(), execute(), saveUserGroups(), splitGroups(), and userCanChangeRights().
UserrightsPage::editUserGroupsForm | ( | $ | username | ) |
Edit user groups membership.
$username | String: name of the user. |
Definition at line 220 of file SpecialUserrights.php.
References $user, $username, $wgOut, fetchUser(), showEditUserGroupsForm(), and showLogFragment().
Referenced by execute().
UserrightsPage::execute | ( | $ | par | ) |
Manage forms to be shown according to posted data.
Depending on the submit button used, call a form or a save function.
$par | Mixed: string if any subpage provided, else null |
Reimplemented from SpecialPage.
Definition at line 47 of file SpecialUserrights.php.
References $reason, $url, $wgOut, $wgRequest, $wgUser, changeableGroups(), editUserGroupsForm(), getSuccessURL(), SpecialPage::outputHeader(), saveUserGroups(), SpecialPage::setHeaders(), switchForm(), userCanChangeRights(), and wfReadOnly().
UserrightsPage::fetchUser | ( | $ | username | ) |
Normalize the input username, which may be local or remote, and return a user (or proxy) object for manipulating it.
Side effects: error output for invalid access
Definition at line 244 of file SpecialUserrights.php.
References $database, $name, $user, $username, $wgOut, $wgUser, $wgUserrightsInterwikiDelimiter, UserRightsProxy::newFromName(), User::newFromName(), UserRightsProxy::validDatabase(), UserRightsProxy::whoIs(), and User::whoIs().
Referenced by editUserGroupsForm(), and saveUserGroups().
static UserrightsPage::getAllGroups | ( | ) | [static, protected] |
Returns an array of all groups that may be edited.
Definition at line 420 of file SpecialUserrights.php.
Referenced by changeableByGroup(), groupCheckboxes(), and saveUserGroups().
UserrightsPage::getSuccessURL | ( | ) |
Definition at line 121 of file SpecialUserrights.php.
References SpecialPage::getTitle().
Referenced by execute().
UserrightsPage::groupCheckboxes | ( | $ | usergroups | ) | [private] |
Adds a table with checkboxes where you can select what groups to add/remove.
$usergroups | Array: groups the user belongs to |
Definition at line 430 of file SpecialUserrights.php.
References $text, canAdd(), canRemove(), Xml::checkLabel(), Xml::closeElement(), getAllGroups(), User::getGroupMember(), Xml::openElement(), Xml::tags(), wfMsg(), and wfMsgHtml().
Referenced by showEditUserGroupsForm().
UserrightsPage::isRestricted | ( | ) |
Can be overridden by subclasses with more complicated permissions schemes.
Reimplemented from SpecialPage.
Definition at line 24 of file SpecialUserrights.php.
UserrightsPage::makeGroupNameList | ( | $ | ids | ) |
Definition at line 300 of file SpecialUserrights.php.
References wfMsgForContent().
Referenced by makeGroupNameListForLog().
UserrightsPage::makeGroupNameListForLog | ( | $ | ids | ) |
Definition at line 308 of file SpecialUserrights.php.
References makeGroupNameList().
Referenced by addLogEntry().
UserrightsPage::saveUserGroups | ( | $ | username, | |
$ | reason = '' | |||
) |
Save user groups changes in the database.
Data comes from the editUserGroupsForm() form function
$username | String: username to apply changes to. | |
$reason | String: reason for group change |
Definition at line 133 of file SpecialUserrights.php.
References $user, $username, $wgGroupsAddToSelf, $wgGroupsRemoveFromSelf, $wgRequest, $wgUser, addLogEntry(), changeableGroups(), fetchUser(), getAllGroups(), wfDebug(), and wfRunHooks().
Referenced by execute().
UserrightsPage::showEditUserGroupsForm | ( | $ | user, | |
$ | groups | |||
) | [protected] |
Show the form to edit group memberships.
$user | User or UserRightsProxy you're editing | |
$groups | Array: Array of groups the user is in |
Definition at line 360 of file SpecialUserrights.php.
References $user, $wgLang, $wgOut, $wgUser, buildGroupLink(), Xml::closeElement(), Xml::element(), SpecialPage::getTitle(), groupCheckboxes(), Xml::hidden(), Xml::input(), Xml::label(), Xml::openElement(), Xml::submitButton(), Xml::tags(), wfEscapeWikiText(), wfMsg(), wfMsgExt(), and wfMsgHtml().
Referenced by editUserGroupsForm().
UserrightsPage::showLogFragment | ( | $ | user, | |
$ | output | |||
) | [protected] |
Show a rights log fragment for the specified user.
$user | User to show log for | |
$output | OutputPage to use |
Definition at line 632 of file SpecialUserrights.php.
References $output, $user, Xml::element(), LogPage::logName(), and LogEventsList::showLogExtract().
Referenced by editUserGroupsForm().
UserrightsPage::splitGroups | ( | $ | groups | ) | [protected] |
Go through used and available groups and return the ones that this form will be able to manipulate based on the current user's system permissions.
$groups | Array: list of groups the given user is in |
Definition at line 341 of file SpecialUserrights.php.
References changeableGroups().
UserrightsPage::switchForm | ( | ) |
Output a form to allow searching for a user.
Definition at line 319 of file SpecialUserrights.php.
References $wgOut, $wgScript, Xml::closeElement(), Xml::element(), SpecialPage::getTitle(), Xml::hidden(), Xml::inputLabel(), Xml::openElement(), Xml::submitButton(), and wfMsg().
Referenced by execute().
UserrightsPage::userCanChangeRights | ( | $ | user, | |
$ | checkIfSelf = true | |||
) |
Definition at line 32 of file SpecialUserrights.php.
References changeableGroups().
Referenced by execute(), and userCanExecute().
UserrightsPage::userCanExecute | ( | $ | user | ) |
Checks if the given user (identified by an object) can execute this special page (as defined by $mRestriction).
Can be overridden by sub- classes with more complicated permissions schemes.
User | $user The user to check |
Reimplemented from SpecialPage.
Definition at line 28 of file SpecialUserrights.php.
References $user, and userCanChangeRights().
UserrightsPage::$isself = false [protected] |
Definition at line 18 of file SpecialUserrights.php.
UserrightsPage::$mTarget [protected] |
Definition at line 17 of file SpecialUserrights.php.