r51952 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51951‎ | r51952 | r51953 >
Date:09:40, 16 June 2009
Author:werdna
Status:resolved
Tags:
Comment:
Fix bug in global auth caused by r48970 (I think). You need to call this->changeableGroups, not wgUser->changeableGroups
Modified paths:
  • /trunk/extensions/LiquidThreads/classes/LqtNewMessages.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUserrights.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialUserrights.php
@@ -154,6 +154,7 @@
155155 $removegroup[] = $group;
156156 }
157157 }
 158+
158159 $this->doSaveUserGroups( $user, $addgroup, $removegroup, $reason );
159160 }
160161
@@ -172,7 +173,7 @@
173174 // Validate input set...
174175 $isself = ($user->getName() == $wgUser->getName());
175176 $groups = $user->getGroups();
176 - $changeable = $wgUser->changeableGroups();
 177+ $changeable = $this->changeableGroups();
177178 $addable = array_merge( $changeable['add'], $isself ? $changeable['add-self'] : array() );
178179 $removable = array_merge( $changeable['remove'], $isself ? $changeable['remove-self'] : array() );
179180
Index: trunk/extensions/LiquidThreads/classes/LqtNewMessages.php
@@ -94,11 +94,7 @@
9595 if ( $changeUser->getId() == $row->wl_user )
9696 continue;
9797
98 - if ( $row->ums_read_timestamp ) {
99 - $conds = array( 'ums_user' => $row->ums_user,
100 - 'ums_thread' => $t->id() );
101 - $update_tuples[$row->ums_user.$t->id()] = $dbw->makeList( $conds, LIST_AND );
102 - } elseif ( $row->ums_user ) {
 98+ if ( $row->ums_user && !$row->ums_read_timestamp ) {
10399 // It's already positive.
104100 } else {
105101 $insert_rows[] =
@@ -114,9 +110,6 @@
115111 }
116112 }
117113
118 - // Avoids duplicates
119 - $update_tuples = array_values( $update_tuples );
120 -
121114 // Add user talk notification
122115 if ( $t->article()->getTitle()->getNamespace() == NS_USER_TALK ) {
123116 $name = $t->article()->getTitle()->getText();
@@ -125,12 +118,9 @@
126119 if ( $user ) {
127120 $user->setNewtalk( true );
128121
129 - $dbw->replace( 'user_message_state',
130 - array( array( 'ums_user', 'ums_thread' ) ),
131 - array( 'ums_user' => $user->getId(),
 122+ $insert_rows[] = array( 'ums_user' => $user->getId(),
132123 'ums_thread' => $t->id(),
133 - 'ums_read_timestamp' => null ),
134 - __METHOD__ );
 124+ 'ums_read_timestamp' => null );
135125
136126 if ( $user->getOption( 'enotifusertalkpages' ) ) {
137127 $notify_users[] = $user->getId();
@@ -141,14 +131,9 @@
142132
143133 // Do the actual updates
144134 if ( count($insert_rows) ) {
145 - $dbw->insert( 'user_message_state', $insert_rows, __METHOD__, array( 'IGNORE' ) );
 135+ $dbw->replace( 'user_message_state', array( array( 'ums_user', 'ums_thread' ) ),
 136+ $insert_rows, __METHOD__ );
146137 }
147 - if ( count($update_tuples) ) {
148 - $where = $dbw->makeList( $update_tuples, LIST_OR );
149 -
150 - $dbw->update( 'user_message_state', array( 'ums_read_timestamp' => null ),
151 - array($where), __METHOD__ );
152 - }
153138
154139 if ( count($notify_users) ) {
155140 self::notifyUsersByMail( $t, $notify_users, wfTimestampNow(), $type );

Follow-up revisions

RevisionCommit summaryAuthorDate
r51953Revert unrelated LQT stuff in r51952.werdna09:41, 16 June 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r48970Redo r48746 (API userrights, reverted in r48909 and r48910) in a way that doe...catrope19:08, 28 March 2009

Status & tagging log