* Oracle: maintenance/ora/user.sql script for creating DB user on oracle with
appropriate privileges. Creating this user with web-install page requires
oci8.privileged_connect set to On in php.ini.
+* Removed UserrightsChangeableGroups hook introduced in 1.14
=== New features in 1.16 ===
* DISPLAYTITLE now accepts a limited amount of wiki markup (the single-quote items)
* Special:Search now could search terms in all variant-forms. ONLY apply on
wikis with LanguageConverter
-* Add hook 'UserrightsGetCheckboxes' to give extensions the ability to modify
- the arrangement of checkboxes on the Special:UserRights form
-* Add hook 'UserrightsSaveUserGroups' to give extensions the ability to modify
- the groups being added and removed last-minute.
* Add autopromote condition APCOND_BLOCKED to autopromote blocked users to various
user groups.
* Add $wgRevokePermissions as a means of restricting a group's rights. The syntax is
$add : Array of strings corresponding to groups added
$remove: Array of strings corresponding to groups removed
-'UserrightsChangeableGroups': allows modification of the groups a user
-may add or remove via Special:UserRights
-$userrights : UserrightsPage object
-$user : User object of the current user
-$addergroups : Array of groups that the user is in
-&$groups : Array of groups that can be added or removed. In format of
- array(
- 'add' => array( addablegroups ),
- 'remove' => array( removablegroups ),
- 'add-self' => array( addablegroups to self ),
- 'remove-self' => array( removable groups from self )
- )
-
-'UserrightsGroupCheckboxes': allows modification of the display of
-checkboxes in the Special:UserRights interface.
-$usergroups : Array of groups that the target user belongs to
-&$columns : Array of checkboxes, in the form of
- $columns['column name']['group name'] = array(
- 'set' => is this checkbox checked by default?
- 'disabled' => is this checkbox disabled?
- 'irreversible' => can this action not be reversed?
- );
-
-'UserrightsSaveUserGroups': allow extensions to modify the added/removed groups
-&$user : User object of the user being altered
-$oldGroups : Array of groups that the user is currently in
-&$add : Array of groups to add
-&$remove : Array of groups to remove
-$reason : Summary provided by user on the form
-
'UserRetrieveNewTalks': called when retrieving "You have new messages!"
message(s)
$user: user retrieving new talks messages
static function getGroupPermissions( $groups ) {
global $wgGroupPermissions, $wgRevokePermissions;
$rights = array();
+ // grant every granted permission first
foreach( $groups as $group ) {
if( isset( $wgGroupPermissions[$group] ) ) {
$rights = array_merge( $rights,
// array_filter removes empty items
array_keys( array_filter( $wgGroupPermissions[$group] ) ) );
}
+ }
+ // now revoke the revoked permissions
+ foreach( $groups as $group ) {
if( isset( $wgRevokePermissions[$group] ) ) {
$rights = array_diff( $rights,
array_keys( array_filter( $wgRevokePermissions[$group] ) ) );
global $wgLang;
$r = array();
foreach( $permissions as $permission => $granted ) {
- if( $granted ) {
+ //show as granted only if it isn't revoked to prevent duplicate display of permissions
+ if( $granted && ( !isset( $revoke[$permission] ) || !$revoke[$permission] ) ) {
$description = wfMsgExt( 'listgrouprights-right-display', array( 'parseinline' ),
User::getRightDescription( $permission ),
$permission
}
foreach( $revoke as $permission => $revoked ) {
if( $revoked ) {
- $description = wfMsgExt( 'lisgrouprights-right-revoked', array( 'parseinline' ),
+ $description = wfMsgExt( 'listgrouprights-right-revoked', array( 'parseinline' ),
User::getRightDescription( $permission ),
$permission
);
$oldGroups = $user->getGroups();
$newGroups = $oldGroups;
- // Run a hook beforehand to allow extensions to modify the added/removed groups
- wfRunHooks( 'UserrightsSaveUserGroups', array( &$user, $oldGroups, &$add, &$remove, $reason ) );
-
// remove then add groups
if( $remove ) {
$newGroups = array_diff($newGroups, $remove);
}
}
- # Run a hook to allow extensions to modify the column listing
- wfRunHooks( 'UserrightsGroupCheckboxes', array( $usergroups, &$columns ) );
-
# Build the HTML table
$ret .= Xml::openElement( 'table', array( 'border' => '0', 'class' => 'mw-userrights-groups' ) ) .
"<tr>\n";
*/
function changeableGroups() {
global $wgUser;
- $groups = $wgUser->changeableGroups();
- // Run a hook because we can
- wfRunHooks( 'UserrightsChangeableGroups', array( $this,
- $wgUser, $wgUser->getEffectiveGroups(), &$groups ) );
- return $groups;
+ return $wgUser->changeableGroups();
}
/**