r45276 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45275‎ | r45276 | r45277 >
Date:02:03, 1 January 2009
Author:vasilievvv
Status:ok
Tags:
Comment:
* Put restricted image moving back, with Brion's permission
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)
  • /trunk/phase3/includes/User.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -151,6 +151,7 @@
152152 'markbotedits',
153153 'minoredit',
154154 'move',
 155+ 'movefile',
155156 'move-rootuserpages',
156157 'move-subpages',
157158 'nominornewtalk',
Index: trunk/phase3/includes/Title.php
@@ -1222,6 +1222,10 @@
12231223 // Show user page-specific message only if the user can move other pages
12241224 $errors[] = array( 'cant-move-user-page' );
12251225 }
 1226+ // Check if user is allowed to move files if it's a file
 1227+ if( $this->getNamespace() == NS_FILE && !$user->isAllowed( 'movefile' ) ) {
 1228+ $errors[] = array( 'movenotallowedfile' );
 1229+ }
12261230 // Check for immobile pages
12271231 if( !MWNamespace::isMovable( $this->getNamespace() ) ) {
12281232 // Specific message for this case
Index: trunk/phase3/includes/DefaultSettings.php
@@ -1163,41 +1163,42 @@
11641164 $wgGroupPermissions = array();
11651165
11661166 // Implicit group for all visitors
1167 -$wgGroupPermissions['*' ]['createaccount'] = true;
1168 -$wgGroupPermissions['*' ]['read'] = true;
1169 -$wgGroupPermissions['*' ]['edit'] = true;
1170 -$wgGroupPermissions['*' ]['createpage'] = true;
1171 -$wgGroupPermissions['*' ]['createtalk'] = true;
1172 -$wgGroupPermissions['*' ]['writeapi'] = true;
 1167+$wgGroupPermissions['*']['createaccount'] = true;
 1168+$wgGroupPermissions['*']['read'] = true;
 1169+$wgGroupPermissions['*']['edit'] = true;
 1170+$wgGroupPermissions['*']['createpage'] = true;
 1171+$wgGroupPermissions['*']['createtalk'] = true;
 1172+$wgGroupPermissions['*']['writeapi'] = true;
11731173
11741174 // Implicit group for all logged-in accounts
1175 -$wgGroupPermissions['user' ]['move'] = true;
1176 -$wgGroupPermissions['user' ]['move-subpages'] = true;
1177 -$wgGroupPermissions['user' ]['move-rootuserpages'] = true; // can move root userpages
1178 -$wgGroupPermissions['user' ]['read'] = true;
1179 -$wgGroupPermissions['user' ]['edit'] = true;
1180 -$wgGroupPermissions['user' ]['createpage'] = true;
1181 -$wgGroupPermissions['user' ]['createtalk'] = true;
1182 -$wgGroupPermissions['user' ]['writeapi'] = true;
1183 -$wgGroupPermissions['user' ]['upload'] = true;
1184 -$wgGroupPermissions['user' ]['reupload'] = true;
1185 -$wgGroupPermissions['user' ]['reupload-shared'] = true;
1186 -$wgGroupPermissions['user' ]['minoredit'] = true;
1187 -$wgGroupPermissions['user' ]['purge'] = true; // can use ?action=purge without clicking "ok"
 1175+$wgGroupPermissions['user']['move'] = true;
 1176+$wgGroupPermissions['user']['move-subpages'] = true;
 1177+$wgGroupPermissions['user']['move-rootuserpages'] = true; // can move root userpages
 1178+//$wgGroupPermissions['user']['movefile'] = true; // Disabled for now due to possible bugs and security concerns
 1179+$wgGroupPermissions['user']['read'] = true;
 1180+$wgGroupPermissions['user']['edit'] = true;
 1181+$wgGroupPermissions['user']['createpage'] = true;
 1182+$wgGroupPermissions['user']['createtalk'] = true;
 1183+$wgGroupPermissions['user']['writeapi'] = true;
 1184+$wgGroupPermissions['user']['upload'] = true;
 1185+$wgGroupPermissions['user']['reupload'] = true;
 1186+$wgGroupPermissions['user']['reupload-shared'] = true;
 1187+$wgGroupPermissions['user']['minoredit'] = true;
 1188+$wgGroupPermissions['user']['purge'] = true; // can use ?action=purge without clicking "ok"
11881189
11891190 // Implicit group for accounts that pass $wgAutoConfirmAge
11901191 $wgGroupPermissions['autoconfirmed']['autoconfirmed'] = true;
11911192
11921193 // Users with bot privilege can have their edits hidden
11931194 // from various log pages by default
1194 -$wgGroupPermissions['bot' ]['bot'] = true;
1195 -$wgGroupPermissions['bot' ]['autoconfirmed'] = true;
1196 -$wgGroupPermissions['bot' ]['nominornewtalk'] = true;
1197 -$wgGroupPermissions['bot' ]['autopatrol'] = true;
1198 -$wgGroupPermissions['bot' ]['suppressredirect'] = true;
1199 -$wgGroupPermissions['bot' ]['apihighlimits'] = true;
1200 -$wgGroupPermissions['bot' ]['writeapi'] = true;
1201 -#$wgGroupPermissions['bot' ]['editprotected'] = true; // can edit all protected pages without cascade protection enabled
 1195+$wgGroupPermissions['bot']['bot'] = true;
 1196+$wgGroupPermissions['bot']['autoconfirmed'] = true;
 1197+$wgGroupPermissions['bot']['nominornewtalk'] = true;
 1198+$wgGroupPermissions['bot']['autopatrol'] = true;
 1199+$wgGroupPermissions['bot']['suppressredirect'] = true;
 1200+$wgGroupPermissions['bot']['apihighlimits'] = true;
 1201+$wgGroupPermissions['bot']['writeapi'] = true;
 1202+#$wgGroupPermissions['bot']['editprotected'] = true; // can edit all protected pages without cascade protection enabled
12021203
12031204 // Most extra permission abilities go to this group
12041205 $wgGroupPermissions['sysop']['block'] = true;
@@ -1231,6 +1232,7 @@
12321233 $wgGroupPermissions['sysop']['apihighlimits'] = true;
12331234 $wgGroupPermissions['sysop']['browsearchive'] = true;
12341235 $wgGroupPermissions['sysop']['noratelimit'] = true;
 1236+$wgGroupPermissions['sysop']['movefile'] = true;
12351237 #$wgGroupPermissions['sysop']['mergehistory'] = true;
12361238
12371239 // Permission to change users' group assignments
@@ -1668,8 +1670,8 @@
16691671 */
16701672 $wgEnableImageWhitelist = true;
16711673
1672 -/** Allows to move images and other media files. Experemintal, not sure if it always works */
1673 -$wgAllowImageMoving = false;
 1674+/** Allows to move images and other media files */
 1675+$wgAllowImageMoving = true;
16741676
16751677 /** Disable database-intensive features */
16761678 $wgMiserMode = false;
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1620,6 +1620,7 @@
16211621 'right-move' => 'Move pages',
16221622 'right-move-subpages' => 'Move pages with their subpages',
16231623 'right-move-rootuserpages' => 'Move root user pages',
 1624+'right-movefile' => 'Move files',
16241625 'right-suppressredirect' => 'Not create a redirect from the old name when moving a page',
16251626 'right-upload' => 'Upload files',
16261627 'right-reupload' => 'Overwrite an existing file',
@@ -2690,6 +2691,7 @@
26912692 'movenologin' => 'Not logged in',
26922693 'movenologintext' => 'You must be a registered user and [[Special:UserLogin|logged in]] to move a page.',
26932694 'movenotallowed' => 'You do not have permission to move pages.',
 2695+'movenotallowedfile' => 'You do not have permission to move files.',
26942696 'cant-move-user-page' => 'You do not have permission to move user pages (apart from subpages).',
26952697 'cant-move-to-user-page' => 'You do not have permission to move a page to a user page (except to a user subpage).',
26962698 'newtitle' => 'To new title:',
Index: trunk/phase3/RELEASE-NOTES
@@ -255,6 +255,7 @@
256256 * Show subversion too even if a "normal" version number is available
257257 * (bug 16121) Add a note that a page move was without creating a redirect in the
258258 move log
 259+* Image moving is now enabled for sysops by default
259260
260261 === Bug fixes in 1.14 ===
261262

Follow-up revisions

RevisionCommit summaryAuthorDate
r45277Follow up on r45276:...siebrand10:42, 1 January 2009

Status & tagging log

  翻译: