Extension:GlobalUserGroups

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual - list
Crystal Clear action run.png
GlobalUserGroups

Release status: stable

Implementation User rights, Special page
Description Allows the use of defined local user groups as global groups
Author(s) Tim Weyer (SVGtalk)
Latest version 1.0.1
MediaWiki 1.6 – 1.20+
License GPL
Download
Example AMERIV.de, FFXIV Wiki
Hooks used
UserRights

Translate the GlobalUserGroups extension if possible

Check usage and version matrix; code metrics

This extension provides the use of defined local user groups as global user groups. The management of global groups is the same as the management of local groups on Special:UserRights.

The extension can distinguish whether a global or a local group is selected (with $wgGlobalUserGroups, see below). If a global group is selected, the rights will be added to all databases that are defined in $wgLocalDatabases into user_groups tables. So the rights are strictly local in every wiki, but all with one click and only one log entry in which wiki the rights were given. The same applies if the rights are removed.

The global rights of users will be shown on Special:ListUsers. Description of the global user rights will be shown on Special:ListGroupRights.











Installation[edit | edit source]

The installation is simple. For use of global user groups, you must have a shared database.

Note: A group name can not be longer than 16 characters. This has nothing to do with the extension, but with MediaWiki, which only allows a maximum of 16 characters in user_groups table. The translations can be of any length because just the system name is entered in table(s).

To install this extension, add the following to LocalSettings.php:

require_once( "$IP/extensions/GlobalUserGroups/GlobalUserGroups.php" );
// use extra translations for various user group names and similars
$wgGlobalUserGroupsUseEMWT = true;
// the following groups are defined as global, and intend to award on Special:UserRights listed in all the databases in $wgLocalDatabases are entered into the table 'user_groups' for each user
// for example:
$wgGlobalUserGroups = array(
    'bot-global',
    'rollback-global',
    'sysadmin',
    'sysop-global',
);
 
// databases of the wiki family [indispensable] (if you haven't already set this adjustment)
$wgLocalDatabases = array(
    'mainwiki',
    'dewiki',
    'enwiki',
);
 
// shared database settings (if you haven't already set this adjustment)
$wgSharedDB = 'yourshareddatabase';
// using a global users list
$wgSharedTables[] = 'user'; // users
$wgSharedTables[] = 'user_properties'; // user's preferences
$wgEnableMWSuggest = true; // show the wiki's database in browsers source code (available but not required)


This could be also added to your LocalSettings.php, GlobalSettings.php or similar

// permissions for global groups
// for example:
$wgGroupPermissions['sysop-global'] = $wgGroupPermissions['sysop']; // copy the local sysop permissions to the global sysop group
$wgGroupPermissions['bot-global'] = $wgGroupPermissions['bot']; // copy the local bot permissions to the global bot group
 
$wgGroupPermissions['rollback-global']['rollback']         = true; // allows to revert edits by an user with one click
$wgGroupPermissions['rollback-global']['suppressredirect'] = true; // global rollbackers can moving a page without automatically creating a redirect
 
$wgGroupPermissions['sysadmin']['siteadmin']               = true; // system administrators can lock and unlock a database local
$wgGroupPermissions['sysadmin']['userrights']              = true; // system administrators can edit all user rights (global and local memberships)
 
// bureaucrats can't give global group memberships and a bureaucrat cannot demote another bureaucrat but a bureaucrat can remove the own bureaucrat flag
$wgGroupPermissions['bureaucrat']['userrights'] = false;
$wgAddGroups['bureaucrat'][] = 'bot';
$wgAddGroups['bureaucrat'][] = 'sysop';
$wgAddGroups['bureaucrat'][] = 'bureaucrat';
$wgRemoveGroups['bureaucrat'][] = 'bot';
$wgRemoveGroups['bureaucrat'][] = 'sysop';
$wgGroupsRemoveFromSelf['bureaucrat'][] = 'bureaucrat'; // can remove own bureaucrat flag

Extras[edit | edit source]

The extension provides translations into English and German available for various global groups. This translations can be activated if you set $wgGlobalUserGroupsUseEMWT to true (activated by default). Currently available translations can be found in GlobalUserGroups.i18n.groups.php. If there are any translations for particular groups are missing, please just report on the talk page.

Contact[edit | edit source]

User talk:SVG
Skype: svg.int
wikimedia@svg.name

Language: English  • Deutsch