r99883 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99882‎ | r99883 | r99884 >
Date:12:05, 15 October 2011
Author:cervidae
Status:deferred
Tags:
Comment:
adding svn eol-style native and updating capitalisation from trunk
Modified paths:
  • /branches/REL1_17/extensions/GlobalUserGroups/GlobalUserGroups.i18n.extras.php (modified) (history)
  • /branches/REL1_17/extensions/GlobalUserGroups/GlobalUserGroups.i18n.php (modified) (history)
  • /branches/REL1_17/extensions/GlobalUserGroups/GlobalUserGroups.php (modified) (history)

Diff [purge]

Index: branches/REL1_17/extensions/GlobalUserGroups/GlobalUserGroups.i18n.php
@@ -27,4 +27,3 @@
2828 $messages['de'] = array(
2929 'globalusergroups-desc' => 'Ermöglicht das Nutzen von definierten lokalen Benutzergruppen als globale Gruppen',
3030 );
31 -
Property changes on: branches/REL1_17/extensions/GlobalUserGroups/GlobalUserGroups.i18n.php
___________________________________________________________________
Added: svn:eol-style
3231 + 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
106105 + native
Index: branches/REL1_17/extensions/GlobalUserGroups/GlobalUserGroups.i18n.extras.php
@@ -17,57 +17,57 @@
1818 * @author SVG
1919 */
2020 $messages['en'] = array(
21 - 'group-bot-global' => 'Global Bots',
 21+ 'group-bot-global' => 'Global bots',
2222 'group-bot-global-member' => '{{GENDER:$1|global bot}}',
23 - 'grouppage-bot-global' => '{{ns:help}}:Global Bots',
 23+ 'grouppage-bot-global' => '{{ns:project}}:Global bots',
2424
25 - 'group-checkuser-global' => 'Global Check users',
 25+ 'group-checkuser-global' => 'Global check users',
2626 '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',
2828
2929 'group-communitymanager' => 'Community managers',
3030 'group-communitymanager-member' => '{{GENDER:$1|community manager}}',
31 - 'grouppage-communitymanager' => '{{ns:help}}:Community managers',
 31+ 'grouppage-communitymanager' => '{{ns:project}}:Community managers',
3232
3333 'group-helper' => 'Helpers',
3434 'group-helper-member' => '{{GENDER:$1|helper}}',
35 - 'grouppage-helper' => '{{ns:help}}:Helpers',
 35+ 'grouppage-helper' => '{{ns:project}}:Helpers',
3636
37 - 'group-helper-global' => 'Global Helpers',
 37+ 'group-helper-global' => 'Global helpers',
3838 'group-helper-global-member' => '{{GENDER:$1|global helper}}',
39 - 'grouppage-helper-global' => '{{ns:help}}:Global Helpers',
 39+ 'grouppage-helper-global' => '{{ns:project}}:Global helpers',
4040
4141 'group-ipblock-exempt' => 'IP block exemptions',
4242 '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',
4444
4545 'group-ipblock-exempt-g' => 'Global IP block exemptions',
4646 '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',
4848
49 - 'group-rollback-global' => 'Global Rollbackers',
 49+ 'group-rollback-global' => 'Global rollbackers',
5050 'group-rollback-global-member' => '{{GENDER:$1|global rollbacker}}',
51 - 'grouppage-rollback-global' => '{{ns:help}}:Global Rollbackers',
 51+ 'grouppage-rollback-global' => '{{ns:project}}:Global rollbackers',
5252
5353 'group-steward' => 'Stewards',
5454 'group-steward-member' => '{{GENDER:$1|steward|stewardess}}',
55 - 'grouppage-steward' => '{{ns:help}}:Stewards',
 55+ 'grouppage-steward' => '{{ns:project}}:Stewards',
5656
57 - 'group-steward-global' => 'Global Stewards',
 57+ 'group-steward-global' => 'Global stewards',
5858 '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',
6060
6161 'group-sysadmin' => 'System administrators',
6262 'group-sysadmin-member' => '{{GENDER:$1|system administrator}}',
63 - 'grouppage-sysadmin' => '{{ns:help}}:System administrators',
 63+ 'grouppage-sysadmin' => '{{ns:project}}:System administrators',
6464
65 - 'group-sysadmin-global' => 'Global System administrators',
 65+ 'group-sysadmin-global' => 'Global system administrators',
6666 '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',
6868
69 - 'group-sysop-global' => 'Global Administrators',
 69+ 'group-sysop-global' => 'Global administrators',
7070 'group-sysop-global-member' => '{{GENDER:$1|global administrator}}',
71 - 'grouppage-sysop-global' => '{{ns:help}}:Global Administrators',
 71+ 'grouppage-sysop-global' => '{{ns:project}}:Global administrators',
7272 );
7373
7474 /** German (Deutsch)
@@ -76,54 +76,53 @@
7777 $messages['de'] = array(
7878 'group-bot-global' => 'Globale Bots',
7979 'group-bot-global-member' => '{{GENDER:$1|Globaler Bot}}',
80 - 'grouppage-bot-global' => '{{ns:help}}:Globale Bots',
 80+ 'grouppage-bot-global' => '{{ns:project}}:Globale Bots',
8181
8282 'group-communitymanager' => 'Community Manager',
8383 'group-communitymanager-member' => '{{GENDER:$1|Community Manager|Community Managerin}}',
84 - 'grouppage-communitymanager' => '{{ns:help}}:Community Manager',
 84+ 'grouppage-communitymanager' => '{{ns:project}}:Community Manager',
8585
8686 'group-checkuser-global' => 'Globale Checkuser',
8787 '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',
8989
9090 'group-helper' => 'Helfer',
9191 'group-helper-member' => '{{GENDER:$1|Helfer|Helferin}}',
92 - 'grouppage-helper' => '{{ns:help}}:Helfer',
 92+ 'grouppage-helper' => '{{ns:project}}:Helfer',
9393
9494 'group-helper-global' => 'Globale Helfer',
9595 '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',
9797
9898 'group-ipblock-exempt' => 'IP-Sperre-Ausnahmen',
9999 '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',
101101
102102 'group-ipblock-exempt-g' => 'Globale IP-Sperre-Ausnahmen',
103103 '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',
105105
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',
109109
110110 'group-steward' => 'Stewards',
111111 'group-steward-member' => '{{GENDER:$1|Steward|Stewardess}}',
112 - 'grouppage-steward' => '{{ns:help}}:Stewards',
 112+ 'grouppage-steward' => '{{ns:project}}:Stewards',
113113
114114 'group-steward-global' => 'Globale Stewards',
115115 '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',
117117
118118 'group-sysadmin' => 'Systemadministratoren',
119119 'group-sysadmin-member' => '{{GENDER:$1|Systemadministrator|Systemadministratorin}}',
120 - 'grouppage-sysadmin' => '{{ns:help}}:Systemadministratoren',
 120+ 'grouppage-sysadmin' => '{{ns:project}}:Systemadministratoren',
121121
122122 'group-sysadmin-global' => 'Globale Systemadministratoren',
123123 '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',
125125
126126 'group-sysop-global' => 'Globale Administratoren',
127127 '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',
129129 );
130 -
Property changes on: branches/REL1_17/extensions/GlobalUserGroups/GlobalUserGroups.i18n.extras.php
___________________________________________________________________
Added: svn:eol-style
131130 + native

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r99774Adding GlobalUserGroups extensioncervidae15:45, 14 October 2011

Status & tagging log