r92148 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92147‎ | r92148 | r92149 >
Date:10:47, 14 July 2011
Author:zhenya
Status:resolved (Comments)
Tags:
Comment:
checks userstatus for wfReadOnly and user->isBlocked
Modified paths:
  • /trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php
@@ -1793,9 +1793,20 @@
17941794 } else {
17951795 $buf = $user_status_array['us_status'];
17961796 }
 1797+
 1798+ // Only owners of the page can change statuses
 1799+ if ( $wgUser->getId() == $userId ) {
 1800+ if ( $wgUser->isBlocked() ) {
 1801+ $us = 'You are blocked';
 1802+ return false;
 1803+ }
17971804
1798 - // Only owners of the page can change statuses
1799 - if ( $wgUser->getId() == $userId || $userId == 0 ) {
 1805+ // Database operations require write mode
 1806+ if ( wfReadOnly() ) {
 1807+ $us = 'Database is in ReadOnly mode';
 1808+ return;
 1809+ }
 1810+
18001811 $us = "<script>UserStatus.toShowMode('$buf','$userId');</script>";
18011812 } else {
18021813 $us = $buf;

Follow-up revisions

RevisionCommit summaryAuthorDate
r92407some small changes in getStatus funczhenya19:29, 17 July 2011

Comments

#Comment by Jack Phoenix (talk | contribs)   20:43, 15 July 2011
+				$us = 'You are blocked';
[...]
+				$us = 'Database is in ReadOnly mode';

If/when these are shown to end-user, they should be localizable; place them in the UserStatus i18n file and use the usual wfMsg() stuff to load them here. I'd also like some wording tweaks here, for example, "You are currently blocked and thus you cannot add status updates." and "The database is currently locked." or something like that. The translator community at translatewiki.net can help you to come up with the best wording for a message; you can also ask in the #mediawiki-i18n IRC channel.

Status & tagging log