MediaWiki
REL1_22
|
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) | |
Make a list of group names to be stored as parameter for log entries. | |
saveUserGroups ($username, $reason, $user) | |
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 | |
getGroupName () | |
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-group-*' for valid names This method defaults to group 'other'. | |
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. | |
static | buildGroupMemberLink ($group) |
Format a link to a group member 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 272 of file SpecialUserrights.php.
References $user, array(), and SpecialPage\getUser().
Referenced by doSaveUserGroups().
static UserrightsPage::buildGroupLink | ( | $ | group | ) | [static, private] |
Format a link to a group description page.
$group | string |
Definition at line 532 of file SpecialUserrights.php.
References User\getGroupName().
Referenced by showEditUserGroupsForm().
static UserrightsPage::buildGroupMemberLink | ( | $ | group | ) | [static, private] |
Format a link to a group member description page.
$group | string |
Definition at line 542 of file SpecialUserrights.php.
References User\getGroupMember().
Referenced by showEditUserGroupsForm().
UserrightsPage::canAdd | ( | $ | group | ) | [private] |
string | $group | the name of the group to check |
Definition at line 647 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 637 of file SpecialUserrights.php.
References changeableGroups().
Referenced by groupCheckboxes().
Returns $this->getUser()->changeableGroups()
Definition at line 657 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 | |
array | $add | of groups to add |
array | $remove | of groups to remove |
string | $reason | reason for group change |
Definition at line 218 of file SpecialUserrights.php.
References $isself, $user, addLogEntry(), array(), as, changeableGroups(), SpecialPage\getUser(), global, wfDebug(), and wfRunHooks().
Referenced by saveUserGroups().
UserrightsPage::editUserGroupsForm | ( | $ | username | ) |
Edit user groups membership.
string | $username | name of the user. |
Definition at line 289 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 |
UserBlockedError|PermissionsError |
Reimplemented from SpecialPage.
Definition at line 72 of file SpecialUserrights.php.
References $out, $user, array(), changeableGroups(), SpecialPage\checkReadOnly(), editUserGroupsForm(), fetchUser(), 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
string | $username |
Definition at line 315 of file SpecialUserrights.php.
References $name, $user, User\getCanonicalName(), SpecialPage\getUser(), global, list, Status\newFatal(), UserRightsProxy\newFromName(), User\newFromName(), Status\newGood(), UserRightsProxy\validDatabase(), wfWikiID(), UserRightsProxy\whoIs(), and User\whoIs().
Referenced by editUserGroupsForm(), and execute().
static UserrightsPage::getAllGroups | ( | ) | [static, protected] |
Returns an array of all groups that may be edited.
Definition at line 550 of file SpecialUserrights.php.
Referenced by groupCheckboxes(), and saveUserGroups().
UserrightsPage::getGroupName | ( | ) | [protected] |
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-group-*' for valid names This method defaults to group 'other'.
Reimplemented from SpecialPage.
Definition at line 673 of file SpecialUserrights.php.
Definition at line 176 of file SpecialUserrights.php.
References array(), and SpecialPage\getTitle().
Referenced by execute().
UserrightsPage::groupCheckboxes | ( | $ | usergroups, |
$ | user | ||
) | [private] |
Adds a table with checkboxes where you can select what groups to add/remove.
array | $usergroups | groups the user belongs to |
$user | User a user object |
Definition at line 562 of file SpecialUserrights.php.
References $columns, $name, $ret, $user, array(), as, canAdd(), canRemove(), Xml\checkLabel(), Xml\closeElement(), Xml\element(), getAllGroups(), User\getGroupMember(), SpecialPage\msg(), Xml\openElement(), tags(), and text.
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 376 of file SpecialUserrights.php.
References empty, and SpecialPage\msg().
Referenced by makeGroupNameListForLog().
Make a list of group names to be stored as parameter for log entries.
$ids | array |
Definition at line 391 of file SpecialUserrights.php.
References empty, makeGroupNameList(), and wfDeprecated().
UserrightsPage::saveUserGroups | ( | $ | username, |
$ | reason, | ||
$ | user | ||
) |
Save user groups changes in the database.
Data comes from the editUserGroupsForm() form function
string | $username | username to apply changes to. |
string | $reason | reason for group change |
User | UserRightsProxy | $user | Target user object. |
Definition at line 189 of file SpecialUserrights.php.
References $user, array(), as, doSaveUserGroups(), getAllGroups(), 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 446 of file SpecialUserrights.php.
References $count, $user, array(), as, buildGroupLink(), buildGroupMemberLink(), Xml\closeElement(), Xml\element(), Autopromote\getAutopromoteGroups(), SpecialPage\getLanguage(), SpecialPage\getOutput(), SpecialPage\getRequest(), SpecialPage\getTitle(), SpecialPage\getUser(), groupCheckboxes(), Html\hidden(), Xml\input(), label, SpecialPage\msg(), Xml\openElement(), Xml\submitButton(), tags(), text, Linker\TOOL_LINKS_EMAIL, Linker\tooltipAndAccesskeyAttribs(), Linker\userToolLinks(), and wfEscapeWikiText().
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 667 of file SpecialUserrights.php.
References $output, $user, Xml\element(), 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.
array | $groups | list of groups the given user is in |
Definition at line 425 of file SpecialUserrights.php.
References array(), changeableGroups(), and list.
Output a form to allow searching for a user.
Definition at line 404 of file SpecialUserrights.php.
References array(), Html\closeElement(), Xml\fieldset(), SpecialPage\getOutput(), SpecialPage\getTitle(), global, Html\hidden(), Xml\inputLabel(), SpecialPage\msg(), Html\openElement(), Xml\submitButton(), and text.
Referenced by execute().
UserrightsPage::userCanChangeRights | ( | $ | user, |
$ | checkIfSelf = true |
||
) |
User | $user | |
bool | $checkIfSelf |
Definition at line 53 of file SpecialUserrights.php.
References $user, changeableGroups(), and empty.
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.