Index: trunk/extensions/SecurePoll/cli/wm-scripts/voterList-bv2009.php |
— | — | @@ -4,13 +4,14 @@ |
5 | 5 | $dbr = wfGetDB( DB_SLAVE ); |
6 | 6 | $dbw = wfGetDB( DB_MASTER ); |
7 | 7 | $fname = 'voterList-bv2009.php'; |
| 8 | +$listName = 'board-vote-2009-amended'; |
8 | 9 | |
9 | 10 | if ( !$wgCentralAuthDatabase ) { |
10 | 11 | echo wfWikiID() . ": CentralAuth not active, skipping\n"; |
11 | 12 | exit( 0 ); |
12 | 13 | } |
13 | 14 | |
14 | | -$dbw->delete( 'securepoll_lists', array( 'li_name' => 'board-vote-2009' ), $fname ); |
| 15 | +$dbw->delete( 'securepoll_lists', array( 'li_name' => $listName ), $fname ); |
15 | 16 | |
16 | 17 | $userId = 0; |
17 | 18 | $numQualified = 0; |
— | — | @@ -32,7 +33,7 @@ |
33 | 34 | $insertBatch = array(); |
34 | 35 | foreach ( $qualifieds as $id => $name ) { |
35 | 36 | $insertBatch[] = array( |
36 | | - 'li_name' => 'board-vote-2009', |
| 37 | + 'li_name' => $listName, |
37 | 38 | 'li_member' => $id |
38 | 39 | ); |
39 | 40 | } |
— | — | @@ -74,6 +75,7 @@ |
75 | 76 | $attached = array_diff( $attached, $nonLocalUsers ); |
76 | 77 | |
77 | 78 | # Check all global accounts |
| 79 | + $localWiki = wfWikiID(); |
78 | 80 | if ( $attached ) { |
79 | 81 | $res = $dbc->select( 'localuser', |
80 | 82 | array( 'lu_name', 'lu_wiki' ), |
— | — | @@ -81,7 +83,9 @@ |
82 | 84 | __METHOD__ ); |
83 | 85 | $foreignUsers = array(); |
84 | 86 | foreach ( $res as $row ) { |
85 | | - $foreignUsers[$row->lu_wiki][] = $row->lu_name; |
| 87 | + if ( $row->lu_wiki != $localWiki ) { |
| 88 | + $foreignUsers[$row->lu_wiki][] = $row->lu_name; |
| 89 | + } |
86 | 90 | } |
87 | 91 | |
88 | 92 | foreach ( $foreignUsers as $wiki => $wikiUsers ) { |