r52719 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52718‎ | r52719 | r52720 >
Date:22:36, 2 July 2009
Author:pinky
Status:ok
Tags:
Comment:
* s/---/--/ in SQL comments, I don't know how that extra dash got in there, but it causes an SQL error
* Add GlobalGroupMembership as a special page alias
Modified paths:
  • /trunk/extensions/GlobalUserrights/GlobalUserrights.alias.php (modified) (history)
  • /trunk/extensions/GlobalUserrights/GlobalUserrights.php (modified) (history)
  • /trunk/extensions/GlobalUserrights/global_user_groups.sql (modified) (history)

Diff [purge]

Index: trunk/extensions/GlobalUserrights/GlobalUserrights.php
@@ -59,19 +59,19 @@
6060 $uid = $user;
6161 }
6262
63 - $dbw = wfGetDB( DB_MASTER );
 63+ $dbr = wfGetDB( DB_MASTER );
6464 $groups = array();
6565
66 - $res = $dbw->select( 'global_user_groups',
 66+ $res = $dbr->select( 'global_user_groups',
6767 array( 'gug_group' ),
6868 array( 'gug_user' => $uid )
6969 );
7070
71 - while( $row = $dbw->fetchObject( $res ) ) {
 71+ while( $row = $dbr->fetchObject( $res ) ) {
7272 $groups[] = $row->gug_group;
7373 }
7474
75 - $dbw->freeResult( $res );
 75+ $dbr->freeResult( $res );
7676
7777 return $groups;
7878
Index: trunk/extensions/GlobalUserrights/global_user_groups.sql
@@ -1,11 +1,11 @@
 2+-- Additional table for the GlobalUserrights extension
 3+-- To be added to $wgSharedDB
 4+-- replace /*$wgSharedPrefix*/ with $wgSharedPrefix
25
36 CREATE TABLE /*$wgSharedPrefix*/global_user_groups (
4 - --- Key to user_id
 7+ -- Key to user_id
58 gug_user int unsigned NOT NULL default '0',
6 - --- Group name
 9+ -- Group name
710 gug_group varbinary(16) NOT NULL default '',
811
912 PRIMARY KEY (gug_user,gug_group),
Index: trunk/extensions/GlobalUserrights/GlobalUserrights.alias.php
@@ -10,7 +10,7 @@
1111
1212 /** English */
1313 $aliases['en'] = array(
14 - 'GlobalUserrights' => array( 'GlobalUserRights' ),
 14+ 'GlobalUserrights' => array( 'GlobalUserRights', 'GlobalGroupMembership' ),
1515 );
1616
1717 /** Arabic (العربية) */

Status & tagging log