MediaWiki
REL1_19
|
Special page to allow managing user group membership. More...
Public Member Functions | |
__construct () | |
addLogEntry ($user, $oldGroups, $newGroups, $reason) | |
Add a rights log entry for an action. | |
changeableGroups () | |
Returns $this->getUser()->changeableGroups() | |
doSaveUserGroups ($user, $add, $remove, $reason= '') | |
Save user groups changes in the database. | |
editUserGroupsForm ($username) | |
Edit user groups membership. | |
execute ($par) | |
Manage forms to be shown according to posted data. | |
fetchUser ($username) | |
Normalize the input username, which may be local or remote, and return a user (or proxy) object for manipulating it. | |
getSuccessURL () | |
isRestricted () | |
Can be overridden by subclasses with more complicated permissions schemes. | |
makeGroupNameList ($ids) | |
makeGroupNameListForLog ($ids) | |
saveUserGroups ($username, $reason= '') | |
Save user groups changes in the database. | |
switchForm () | |
Output a form to allow searching for a user. | |
userCanChangeRights ($user, $checkIfSelf=true) | |
userCanExecute (User $user) | |
Checks if the given user (identified by an object) can execute this special page (as defined by $mRestriction). | |
Protected Member Functions | |
showEditUserGroupsForm ($user, $groups) | |
Show the form to edit group memberships. | |
showLogFragment ($user, $output) | |
Show a rights log fragment for the specified user. | |
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. | |
Static Protected Member Functions | |
static | getAllGroups () |
Returns an array of all groups that may be edited. | |
Protected Attributes | |
$isself = false | |
$mTarget | |
Private Member Functions | |
canAdd ($group) | |
canRemove ($group) | |
groupCheckboxes ($usergroups, $user) | |
Adds a table with checkboxes where you can select what groups to add/remove. | |
Static Private Member Functions | |
static | buildGroupLink ($group) |
Format a link to a group description page. |
Special page to allow managing user group membership.
Definition at line 29 of file SpecialUserrights.php.
Definition at line 36 of file SpecialUserrights.php.
UserrightsPage::addLogEntry | ( | $ | user, |
$ | oldGroups, | ||
$ | newGroups, | ||
$ | reason | ||
) |
Add a rights log entry for an action.
Definition at line 243 of file SpecialUserrights.php.
References $user, and makeGroupNameListForLog().
Referenced by doSaveUserGroups().
static UserrightsPage::buildGroupLink | ( | $ | group | ) | [static, private] |
Format a link to a group description page.
$group | string |
Definition at line 478 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 584 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 573 of file SpecialUserrights.php.
References changeableGroups().
Referenced by groupCheckboxes().
Returns $this->getUser()->changeableGroups()
Definition at line 594 of file SpecialUserrights.php.
References SpecialPage\getUser().
Referenced by canAdd(), canRemove(), doSaveUserGroups(), execute(), splitGroups(), and userCanChangeRights().
UserrightsPage::doSaveUserGroups | ( | $ | user, |
$ | add, | ||
$ | remove, | ||
$ | reason = '' |
||
) |
Save user groups changes in the database.
$user | User object |
$add | Array of groups to add |
$remove | Array of groups to remove |
$reason | String: reason for group change |
Definition at line 193 of file SpecialUserrights.php.
References $isself, $user, addLogEntry(), changeableGroups(), SpecialPage\getUser(), wfDebug(), and wfRunHooks().
Referenced by saveUserGroups().
UserrightsPage::editUserGroupsForm | ( | $ | username | ) |
Edit user groups membership.
$username | String: name of the user. |
Definition at line 260 of file SpecialUserrights.php.
References $user, fetchUser(), SpecialPage\getOutput(), 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 63 of file SpecialUserrights.php.
References $out, $user, changeableGroups(), SpecialPage\checkReadOnly(), editUserGroupsForm(), User\getCanonicalName(), SpecialPage\getOutput(), SpecialPage\getRequest(), getSuccessURL(), SpecialPage\getUser(), SpecialPage\outputHeader(), saveUserGroups(), SpecialPage\setHeaders(), switchForm(), and userCanChangeRights().
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 285 of file SpecialUserrights.php.
References $user, $wgUserrightsInterwikiDelimiter, User\getCanonicalName(), SpecialPage\getUser(), Status\newFatal(), UserRightsProxy\newFromName(), User\newFromName(), Status\newGood(), UserRightsProxy\validDatabase(), wfWikiID(), UserRightsProxy\whoIs(), and User\whoIs().
Referenced by editUserGroupsForm(), ApiQueryUsers\execute(), ApiUserrights\getUrUser(), and saveUserGroups().
static UserrightsPage::getAllGroups | ( | ) | [static, protected] |
Returns an array of all groups that may be edited.
Definition at line 489 of file SpecialUserrights.php.
Referenced by groupCheckboxes(), and saveUserGroups().
Definition at line 144 of file SpecialUserrights.php.
References SpecialPage\getTitle().
Referenced by execute().
UserrightsPage::groupCheckboxes | ( | $ | usergroups, |
$ | user | ||
) | [private] |
Adds a table with checkboxes where you can select what groups to add/remove.
$usergroups | Array: groups the user belongs to |
$user | User a user object |
Definition at line 501 of file SpecialUserrights.php.
References $columns, $user, canAdd(), canRemove(), Xml\checkLabel(), Xml\closeElement(), Xml\element(), getAllGroups(), User\getGroupMember(), Xml\openElement(), Xml\tags(), and wfMessage().
Referenced by showEditUserGroupsForm().
Can be overridden by subclasses with more complicated permissions schemes.
Reimplemented from SpecialPage.
Definition at line 40 of file SpecialUserrights.php.
UserrightsPage::makeGroupNameList | ( | $ | ids | ) |
Definition at line 346 of file SpecialUserrights.php.
References wfMsgForContent().
Referenced by makeGroupNameListForLog().
Definition at line 354 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 156 of file SpecialUserrights.php.
References $user, doSaveUserGroups(), fetchUser(), getAllGroups(), SpecialPage\getOutput(), and SpecialPage\getRequest().
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 407 of file SpecialUserrights.php.
References $count, $user, buildGroupLink(), Xml\closeElement(), Xml\element(), Autopromote\getAutopromoteGroups(), SpecialPage\getLanguage(), SpecialPage\getOutput(), SpecialPage\getRequest(), SpecialPage\getTitle(), SpecialPage\getUser(), groupCheckboxes(), Html\hidden(), Xml\input(), Xml\label(), Xml\openElement(), Xml\submitButton(), Xml\tags(), Linker\TOOL_LINKS_EMAIL, Linker\tooltipAndAccesskeyAttribs(), Linker\userToolLinks(), wfEscapeWikiText(), wfMessage(), and wfMsg().
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 604 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 386 of file SpecialUserrights.php.
References changeableGroups().
Output a form to allow searching for a user.
Definition at line 365 of file SpecialUserrights.php.
References $wgScript, Html\closeElement(), Xml\fieldset(), SpecialPage\getOutput(), SpecialPage\getTitle(), Html\hidden(), Xml\inputLabel(), Html\openElement(), Xml\submitButton(), and wfMsg().
Referenced by execute().
UserrightsPage::userCanChangeRights | ( | $ | user, |
$ | checkIfSelf = true |
||
) |
Definition at line 48 of file SpecialUserrights.php.
References changeableGroups().
Referenced by execute(), and userCanExecute().
UserrightsPage::userCanExecute | ( | User $ | 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 44 of file SpecialUserrights.php.
References userCanChangeRights().
UserrightsPage::$isself = false [protected] |
Definition at line 34 of file SpecialUserrights.php.
Referenced by doSaveUserGroups().
UserrightsPage::$mTarget [protected] |
Definition at line 33 of file SpecialUserrights.php.