Index: branches/REL1_17/extensions/GlobalUserGroups/GlobalUserGroups.i18n.php |
— | — | @@ -27,4 +27,3 @@ |
28 | 28 | $messages['de'] = array( |
29 | 29 | 'globalusergroups-desc' => 'Ermöglicht das Nutzen von definierten lokalen Benutzergruppen als globale Gruppen', |
30 | 30 | ); |
31 | | - |
Property changes on: branches/REL1_17/extensions/GlobalUserGroups/GlobalUserGroups.i18n.php |
___________________________________________________________________ |
Added: svn:eol-style |
32 | 31 | + native |
Index: branches/REL1_17/extensions/GlobalUserGroups/GlobalUserGroups.php |
— | — | @@ -1,104 +1,103 @@ |
2 | | -<?php
|
3 | | -/**
|
4 | | - * GlobalUserGroups - adds specified user groups as to all 'user_groups' tables in a wiki family ($wgLocalDatabases)
|
5 | | - *
|
6 | | - * @package MediaWiki
|
7 | | - * @subpackage Extensions
|
8 | | - *
|
9 | | - * @author Tim Weyer (SVG) <svg@tim-weyer.org>
|
10 | | - *
|
11 | | - * @copyright Copyright (C) 2011 by Tim Weyer
|
12 | | - * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
|
13 | | - */
|
14 | | -
|
15 | | -if (!defined('MEDIAWIKI')){
|
16 | | - echo ('THIS IS NOT VALID ENTRY POINT.'); exit (1);
|
17 | | -}
|
18 | | -
|
19 | | -$wgExtensionFunctions[] = 'efGlobalUserGroupsEMWT';
|
20 | | -
|
21 | | -$wgExtensionCredits['specialpage'][] = array(
|
22 | | - 'name' => 'GlobalUserGroups',
|
23 | | - 'url' => 'http://www.mediawiki.org/wiki/Extension:GlobalUserGroups',
|
24 | | - 'author' => 'Tim Weyer',
|
25 | | - 'descriptionmsg' => 'globalusergroups-desc',
|
26 | | - 'version' => '1.0.1',
|
27 | | -);
|
28 | | -
|
29 | | -// Use extra translations for various user group names and similars
|
30 | | -$wgGlobalUserGroupsUseEMWT = true;
|
31 | | -
|
32 | | -// Translations
|
33 | | -$dir = dirname( __FILE__ ) . '/';
|
34 | | -$wgExtensionMessagesFiles['GlobalUserGroups'] = $dir . 'GlobalUserGroups.i18n.php';
|
35 | | -
|
36 | | -// Hooks
|
37 | | -$wgHooks['UserRights'][] = 'efManageGlobalUserGroups';
|
38 | | -
|
39 | | -function efManageGlobalUserGroups($user, $addgroup, $removegroup) {
|
40 | | - global $wgGlobalUserGroups, $wgLocalDatabases;
|
41 | | -
|
42 | | - # Remove groups in all local databases if there is anything to remove
|
43 | | - if (!empty($removegroup)) {
|
44 | | - $global_removeable = array_intersect($removegroup, $wgGlobalUserGroups);
|
45 | | -
|
46 | | - if (!empty($global_removeable)) {
|
47 | | -
|
48 | | - foreach ( $wgLocalDatabases as $wikiID ) {
|
49 | | - $db = wfGetDB( DB_MASTER, array(), $wikiID );
|
50 | | -
|
51 | | -
|
52 | | - foreach ( $global_removeable as $group ) {
|
53 | | -
|
54 | | - # delete from all local databases
|
55 | | - $db->delete('user_groups', array(
|
56 | | - 'ug_user' => $user->getId(),
|
57 | | - 'ug_group' => $group),
|
58 | | - 'GlobalUserGroups::removeGroup'
|
59 | | - );
|
60 | | -
|
61 | | - }
|
62 | | - }
|
63 | | - }
|
64 | | - }
|
65 | | -
|
66 | | - # Add groups in all local databases if there is anything to add
|
67 | | - if (!empty($addgroup)) {
|
68 | | - $global_addable = array_intersect($addgroup, $wgGlobalUserGroups);
|
69 | | -
|
70 | | - if (!empty($global_addable)) {
|
71 | | -
|
72 | | - foreach ( $wgLocalDatabases as $wikiID ) {
|
73 | | - $db = wfGetDB( DB_MASTER, array(), $wikiID );
|
74 | | -
|
75 | | - foreach ( $global_addable as $group ) {
|
76 | | -
|
77 | | - # insert into all local databases
|
78 | | - $db->insert('user_groups', array(
|
79 | | - 'ug_user' => $user->getId(),
|
80 | | - 'ug_group' => $group),
|
81 | | - 'GlobalUserGroups::addGroup',
|
82 | | - 'IGNORE'
|
83 | | - );
|
84 | | -
|
85 | | - }
|
86 | | - }
|
87 | | - }
|
88 | | - }
|
89 | | -
|
90 | | - return true;
|
91 | | -}
|
92 | | -
|
93 | | -
|
94 | | -
|
95 | | -function efGlobalUserGroupsEMWT() {
|
96 | | - global $wgGlobalUserGroupsUseEMWT;
|
97 | | - global $wgExtensionMessagesFiles;
|
98 | | -
|
99 | | - $dir = dirname( __FILE__ ) . '/';
|
100 | | -
|
101 | | - if ( $wgGlobalUserGroupsUseEMWT ) {
|
102 | | - $wgExtensionMessagesFiles['GlobalUserGroupsExtras'] = $dir . 'GlobalUserGroups.i18n.extras.php';
|
103 | | - }
|
104 | | -}
|
105 | | -
|
| 2 | +<?php |
| 3 | +/** |
| 4 | + * GlobalUserGroups - adds specified user groups as to all 'user_groups' tables in a wiki family ($wgLocalDatabases) |
| 5 | + * |
| 6 | + * @package MediaWiki |
| 7 | + * @subpackage Extensions |
| 8 | + * |
| 9 | + * @author Tim Weyer (SVG) <svg@tim-weyer.org> |
| 10 | + * |
| 11 | + * @copyright Copyright (C) 2011 by Tim Weyer |
| 12 | + * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
| 13 | + */ |
| 14 | + |
| 15 | +if (!defined('MEDIAWIKI')){ |
| 16 | + echo ('THIS IS NOT VALID ENTRY POINT.'); exit (1); |
| 17 | +} |
| 18 | + |
| 19 | +$wgExtensionFunctions[] = 'efGlobalUserGroupsEMWT'; |
| 20 | + |
| 21 | +$wgExtensionCredits['specialpage'][] = array( |
| 22 | + 'name' => 'GlobalUserGroups', |
| 23 | + 'url' => 'http://www.mediawiki.org/wiki/Extension:GlobalUserGroups', |
| 24 | + 'author' => 'Tim Weyer', |
| 25 | + 'descriptionmsg' => 'globalusergroups-desc', |
| 26 | + 'version' => '1.0.1', |
| 27 | +); |
| 28 | + |
| 29 | +// Use extra translations for various user group names and similars |
| 30 | +$wgGlobalUserGroupsUseEMWT = true; |
| 31 | + |
| 32 | +// Translations |
| 33 | +$dir = dirname( __FILE__ ) . '/'; |
| 34 | +$wgExtensionMessagesFiles['GlobalUserGroups'] = $dir . 'GlobalUserGroups.i18n.php'; |
| 35 | + |
| 36 | +// Hooks |
| 37 | +$wgHooks['UserRights'][] = 'efManageGlobalUserGroups'; |
| 38 | + |
| 39 | +function efManageGlobalUserGroups($user, $addgroup, $removegroup) { |
| 40 | + global $wgGlobalUserGroups, $wgLocalDatabases; |
| 41 | + |
| 42 | + # Remove groups in all local databases if there is anything to remove |
| 43 | + if (!empty($removegroup)) { |
| 44 | + $global_removeable = array_intersect($removegroup, $wgGlobalUserGroups); |
| 45 | + |
| 46 | + if (!empty($global_removeable)) { |
| 47 | + |
| 48 | + foreach ( $wgLocalDatabases as $wikiID ) { |
| 49 | + $db = wfGetDB( DB_MASTER, array(), $wikiID ); |
| 50 | + |
| 51 | + |
| 52 | + foreach ( $global_removeable as $group ) { |
| 53 | + |
| 54 | + # delete from all local databases |
| 55 | + $db->delete('user_groups', array( |
| 56 | + 'ug_user' => $user->getId(), |
| 57 | + 'ug_group' => $group), |
| 58 | + 'GlobalUserGroups::removeGroup' |
| 59 | + ); |
| 60 | + |
| 61 | + } |
| 62 | + } |
| 63 | + } |
| 64 | + } |
| 65 | + |
| 66 | + # Add groups in all local databases if there is anything to add |
| 67 | + if (!empty($addgroup)) { |
| 68 | + $global_addable = array_intersect($addgroup, $wgGlobalUserGroups); |
| 69 | + |
| 70 | + if (!empty($global_addable)) { |
| 71 | + |
| 72 | + foreach ( $wgLocalDatabases as $wikiID ) { |
| 73 | + $db = wfGetDB( DB_MASTER, array(), $wikiID ); |
| 74 | + |
| 75 | + foreach ( $global_addable as $group ) { |
| 76 | + |
| 77 | + # insert into all local databases |
| 78 | + $db->insert('user_groups', array( |
| 79 | + 'ug_user' => $user->getId(), |
| 80 | + 'ug_group' => $group), |
| 81 | + 'GlobalUserGroups::addGroup', |
| 82 | + 'IGNORE' |
| 83 | + ); |
| 84 | + |
| 85 | + } |
| 86 | + } |
| 87 | + } |
| 88 | + } |
| 89 | + |
| 90 | + return true; |
| 91 | +} |
| 92 | + |
| 93 | + |
| 94 | + |
| 95 | +function efGlobalUserGroupsEMWT() { |
| 96 | + global $wgGlobalUserGroupsUseEMWT; |
| 97 | + global $wgExtensionMessagesFiles; |
| 98 | + |
| 99 | + $dir = dirname( __FILE__ ) . '/'; |
| 100 | + |
| 101 | + if ( $wgGlobalUserGroupsUseEMWT ) { |
| 102 | + $wgExtensionMessagesFiles['GlobalUserGroupsExtras'] = $dir . 'GlobalUserGroups.i18n.extras.php'; |
| 103 | + } |
| 104 | +} |
Property changes on: branches/REL1_17/extensions/GlobalUserGroups/GlobalUserGroups.php |
___________________________________________________________________ |
Added: svn:eol-style |
106 | 105 | + native |
Index: branches/REL1_17/extensions/GlobalUserGroups/GlobalUserGroups.i18n.extras.php |
— | — | @@ -17,57 +17,57 @@ |
18 | 18 | * @author SVG |
19 | 19 | */ |
20 | 20 | $messages['en'] = array( |
21 | | - 'group-bot-global' => 'Global Bots', |
| 21 | + 'group-bot-global' => 'Global bots', |
22 | 22 | 'group-bot-global-member' => '{{GENDER:$1|global bot}}', |
23 | | - 'grouppage-bot-global' => '{{ns:help}}:Global Bots', |
| 23 | + 'grouppage-bot-global' => '{{ns:project}}:Global bots', |
24 | 24 | |
25 | | - 'group-checkuser-global' => 'Global Check users', |
| 25 | + 'group-checkuser-global' => 'Global check users', |
26 | 26 | 'group-checkuser-global-member' => '{{GENDER:$1|global check user}}', |
27 | | - 'grouppage-checkuser-global' => '{{ns:help}}:Global Checkusers', |
| 27 | + 'grouppage-checkuser-global' => '{{ns:project}}:Global checkusers', |
28 | 28 | |
29 | 29 | 'group-communitymanager' => 'Community managers', |
30 | 30 | 'group-communitymanager-member' => '{{GENDER:$1|community manager}}', |
31 | | - 'grouppage-communitymanager' => '{{ns:help}}:Community managers', |
| 31 | + 'grouppage-communitymanager' => '{{ns:project}}:Community managers', |
32 | 32 | |
33 | 33 | 'group-helper' => 'Helpers', |
34 | 34 | 'group-helper-member' => '{{GENDER:$1|helper}}', |
35 | | - 'grouppage-helper' => '{{ns:help}}:Helpers', |
| 35 | + 'grouppage-helper' => '{{ns:project}}:Helpers', |
36 | 36 | |
37 | | - 'group-helper-global' => 'Global Helpers', |
| 37 | + 'group-helper-global' => 'Global helpers', |
38 | 38 | 'group-helper-global-member' => '{{GENDER:$1|global helper}}', |
39 | | - 'grouppage-helper-global' => '{{ns:help}}:Global Helpers', |
| 39 | + 'grouppage-helper-global' => '{{ns:project}}:Global helpers', |
40 | 40 | |
41 | 41 | 'group-ipblock-exempt' => 'IP block exemptions', |
42 | 42 | 'group-ipblock-exempt-member' => '{{GENDER:$1|ip block exemption}}', |
43 | | - 'grouppage-ipblock-exempt' => '{{ns:help}}:IP block exemptions', |
| 43 | + 'grouppage-ipblock-exempt' => '{{ns:project}}:IP block exemptions', |
44 | 44 | |
45 | 45 | 'group-ipblock-exempt-g' => 'Global IP block exemptions', |
46 | 46 | 'group-ipblock-exempt-g-member' => '{{GENDER:$1|global ip block exemption}}', |
47 | | - 'grouppage-ipblock-exempt-g' => '{{ns:help}}:Global IP block exemptions', |
| 47 | + 'grouppage-ipblock-exempt-g' => '{{ns:project}}:Global IP block exemptions', |
48 | 48 | |
49 | | - 'group-rollback-global' => 'Global Rollbackers', |
| 49 | + 'group-rollback-global' => 'Global rollbackers', |
50 | 50 | 'group-rollback-global-member' => '{{GENDER:$1|global rollbacker}}', |
51 | | - 'grouppage-rollback-global' => '{{ns:help}}:Global Rollbackers', |
| 51 | + 'grouppage-rollback-global' => '{{ns:project}}:Global rollbackers', |
52 | 52 | |
53 | 53 | 'group-steward' => 'Stewards', |
54 | 54 | 'group-steward-member' => '{{GENDER:$1|steward|stewardess}}', |
55 | | - 'grouppage-steward' => '{{ns:help}}:Stewards', |
| 55 | + 'grouppage-steward' => '{{ns:project}}:Stewards', |
56 | 56 | |
57 | | - 'group-steward-global' => 'Global Stewards', |
| 57 | + 'group-steward-global' => 'Global stewards', |
58 | 58 | 'group-steward-global-member' => '{{GENDER:$1|global steward|global stewardess}}', |
59 | | - 'grouppage-steward-global' => '{{ns:help}}:Global Stewards', |
| 59 | + 'grouppage-steward-global' => '{{ns:project}}:Global stewards', |
60 | 60 | |
61 | 61 | 'group-sysadmin' => 'System administrators', |
62 | 62 | 'group-sysadmin-member' => '{{GENDER:$1|system administrator}}', |
63 | | - 'grouppage-sysadmin' => '{{ns:help}}:System administrators', |
| 63 | + 'grouppage-sysadmin' => '{{ns:project}}:System administrators', |
64 | 64 | |
65 | | - 'group-sysadmin-global' => 'Global System administrators', |
| 65 | + 'group-sysadmin-global' => 'Global system administrators', |
66 | 66 | 'group-sysadmin-global-member' => '{{GENDER:$1|global system administrator}}', |
67 | | - 'grouppage-sysadmin-global' => '{{ns:help}}:Global System administrators', |
| 67 | + 'grouppage-sysadmin-global' => '{{ns:project}}:Global system administrators', |
68 | 68 | |
69 | | - 'group-sysop-global' => 'Global Administrators', |
| 69 | + 'group-sysop-global' => 'Global administrators', |
70 | 70 | 'group-sysop-global-member' => '{{GENDER:$1|global administrator}}', |
71 | | - 'grouppage-sysop-global' => '{{ns:help}}:Global Administrators', |
| 71 | + 'grouppage-sysop-global' => '{{ns:project}}:Global administrators', |
72 | 72 | ); |
73 | 73 | |
74 | 74 | /** German (Deutsch) |
— | — | @@ -76,54 +76,53 @@ |
77 | 77 | $messages['de'] = array( |
78 | 78 | 'group-bot-global' => 'Globale Bots', |
79 | 79 | 'group-bot-global-member' => '{{GENDER:$1|Globaler Bot}}', |
80 | | - 'grouppage-bot-global' => '{{ns:help}}:Globale Bots', |
| 80 | + 'grouppage-bot-global' => '{{ns:project}}:Globale Bots', |
81 | 81 | |
82 | 82 | 'group-communitymanager' => 'Community Manager', |
83 | 83 | 'group-communitymanager-member' => '{{GENDER:$1|Community Manager|Community Managerin}}', |
84 | | - 'grouppage-communitymanager' => '{{ns:help}}:Community Manager', |
| 84 | + 'grouppage-communitymanager' => '{{ns:project}}:Community Manager', |
85 | 85 | |
86 | 86 | 'group-checkuser-global' => 'Globale Checkuser', |
87 | 87 | 'group-checkuser-global-member' => '{{GENDER:$1|Globaler Checkuser|Globale Checkuserin}}', |
88 | | - 'grouppage-checkuser-global' => '{{ns:help}}:Globale Checkuser', |
| 88 | + 'grouppage-checkuser-global' => '{{ns:project}}:Globale Checkuser', |
89 | 89 | |
90 | 90 | 'group-helper' => 'Helfer', |
91 | 91 | 'group-helper-member' => '{{GENDER:$1|Helfer|Helferin}}', |
92 | | - 'grouppage-helper' => '{{ns:help}}:Helfer', |
| 92 | + 'grouppage-helper' => '{{ns:project}}:Helfer', |
93 | 93 | |
94 | 94 | 'group-helper-global' => 'Globale Helfer', |
95 | 95 | 'group-helper-global-member' => '{{GENDER:$1|Globaler Helfer|Globale Helferin}}', |
96 | | - 'grouppage-helper-global' => '{{ns:help}}:Globale Helfer', |
| 96 | + 'grouppage-helper-global' => '{{ns:project}}:Globale Helfer', |
97 | 97 | |
98 | 98 | 'group-ipblock-exempt' => 'IP-Sperre-Ausnahmen', |
99 | 99 | 'group-ipblock-exempt-member' => '{{GENDER:$1|IP-Sperre-Ausnahme}}', |
100 | | - 'grouppage-ipblock-exempt' => '{{ns:help}}:IP-Sperre-Ausnahmen', |
| 100 | + 'grouppage-ipblock-exempt' => '{{ns:project}}:IP-Sperre-Ausnahmen', |
101 | 101 | |
102 | 102 | 'group-ipblock-exempt-g' => 'Globale IP-Sperre-Ausnahmen', |
103 | 103 | 'group-ipblock-exempt-g-member' => '{{GENDER:$1|Globale IP-Sperre-Ausnahme}}', |
104 | | - 'grouppage-ipblock-exempt-g' => '{{ns:help}}:Globale IP-Sperre-Ausnahmen', |
| 104 | + 'grouppage-ipblock-exempt-g' => '{{ns:project}}:Globale IP-Sperre-Ausnahmen', |
105 | 105 | |
106 | | - 'group-rollback-global' => 'Globale Zurücksetzer', |
107 | | - 'group-rollback-global-member' => '{{GENDER:$1|Globaler Zurücksetzer|Globale Zurücksetzerin}}', |
108 | | - 'grouppage-rollback-global' => '{{ns:help}}:Globale Zurücksetzer', |
| 106 | + 'group-rollback-global' => 'Globale Zurücksetzer', |
| 107 | + 'group-rollback-global-member' => '{{GENDER:$1|Globaler Zurücksetzer|Globale Zurücksetzerin}}', |
| 108 | + 'grouppage-rollback-global' => '{{ns:project}}:Globale Zurücksetzer', |
109 | 109 | |
110 | 110 | 'group-steward' => 'Stewards', |
111 | 111 | 'group-steward-member' => '{{GENDER:$1|Steward|Stewardess}}', |
112 | | - 'grouppage-steward' => '{{ns:help}}:Stewards', |
| 112 | + 'grouppage-steward' => '{{ns:project}}:Stewards', |
113 | 113 | |
114 | 114 | 'group-steward-global' => 'Globale Stewards', |
115 | 115 | 'group-steward-global-member' => '{{GENDER:$1|Globaler Steward|Globale Stewardess}}', |
116 | | - 'grouppage-steward-global' => '{{ns:help}}:Globale Stewards', |
| 116 | + 'grouppage-steward-global' => '{{ns:project}}:Globale Stewards', |
117 | 117 | |
118 | 118 | 'group-sysadmin' => 'Systemadministratoren', |
119 | 119 | 'group-sysadmin-member' => '{{GENDER:$1|Systemadministrator|Systemadministratorin}}', |
120 | | - 'grouppage-sysadmin' => '{{ns:help}}:Systemadministratoren', |
| 120 | + 'grouppage-sysadmin' => '{{ns:project}}:Systemadministratoren', |
121 | 121 | |
122 | 122 | 'group-sysadmin-global' => 'Globale Systemadministratoren', |
123 | 123 | 'group-sysadmin-global-member' => '{{GENDER:$1|Globaler Systemadministrator|Globale Systemadministratorin}}', |
124 | | - 'grouppage-sysadmin-global' => '{{ns:help}}:Globale Systemadministratoren', |
| 124 | + 'grouppage-sysadmin-global' => '{{ns:project}}:Globale Systemadministratoren', |
125 | 125 | |
126 | 126 | 'group-sysop-global' => 'Globale Administratoren', |
127 | 127 | 'group-sysop-global-member' => '{{GENDER:$1|Globaler Administrator|Globale Administratorin}}', |
128 | | - 'grouppage-sysop-global' => '{{ns:help}}:Globale Administratoren', |
| 128 | + 'grouppage-sysop-global' => '{{ns:project}}:Globale Administratoren', |
129 | 129 | ); |
130 | | - |
Property changes on: branches/REL1_17/extensions/GlobalUserGroups/GlobalUserGroups.i18n.extras.php |
___________________________________________________________________ |
Added: svn:eol-style |
131 | 130 | + native |