Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -1130,6 +1130,8 @@ |
1131 | 1131 | 'uploadbtn', |
1132 | 1132 | 'reupload', |
1133 | 1133 | 'reuploaddesc', |
| 1134 | + 'uploadnologin', |
| 1135 | + 'uploadnologintext', |
1134 | 1136 | 'upload_directory_missing', |
1135 | 1137 | 'upload_directory_read_only', |
1136 | 1138 | 'uploaderror', |
— | — | @@ -1922,6 +1924,8 @@ |
1923 | 1925 | 'movepagetext', |
1924 | 1926 | 'movepagetalktext', |
1925 | 1927 | 'movearticle', |
| 1928 | + 'movenologin', |
| 1929 | + 'movenologintext', |
1926 | 1930 | 'movenotallowed', |
1927 | 1931 | 'movenotallowedfile', |
1928 | 1932 | 'cant-move-user-page', |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -1171,7 +1171,14 @@ |
1172 | 1172 | |
1173 | 1173 | if( !$user->isAllowed( 'move' ) ) { |
1174 | 1174 | // User can't move anything |
1175 | | - $errors[] = array ('movenotallowed'); |
| 1175 | + global $wgGroupPermissions; |
| 1176 | + if( $user->isAnon() && ( $wgGroupPermissions['user']['move'] |
| 1177 | + || $wgGroupPermissions['autoconfirmed']['move'] ) ) { |
| 1178 | + // custom message if logged-in users without any special rights can move |
| 1179 | + $errors[] = array ( 'movenologintext' ); |
| 1180 | + } else { |
| 1181 | + $errors[] = array ('movenotallowed'); |
| 1182 | + } |
1176 | 1183 | } |
1177 | 1184 | } elseif ( $action == 'create' ) { |
1178 | 1185 | if( ( $this->isTalkPage() && !$user->isAllowed( 'createtalk' ) ) || |
Index: trunk/phase3/includes/specials/SpecialUpload.php |
— | — | @@ -244,8 +244,15 @@ |
245 | 245 | } |
246 | 246 | |
247 | 247 | # Check permissions |
| 248 | + global $wgGroupPermissions; |
248 | 249 | if( !$wgUser->isAllowed( 'upload' ) ) { |
249 | | - $wgOut->permissionRequired( 'upload' ); |
| 250 | + if( !$wgUser->isLoggedIn() && ( $wgGroupPermissions['user']['upload'] |
| 251 | + || $wgGroupPermissions['autoconfirmed']['upload'] ) ) { |
| 252 | + // Custom message if logged-in users without any special rights can upload |
| 253 | + $wgOut->showErrorPage( 'uploadnologin', 'uploadnologintext' ); |
| 254 | + } else { |
| 255 | + $wgOut->permissionRequired( 'upload' ); |
| 256 | + } |
250 | 257 | return; |
251 | 258 | } |
252 | 259 | |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1820,6 +1820,8 @@ |
1821 | 1821 | 'uploadbtn' => 'Upload file', |
1822 | 1822 | 'reupload' => 'Re-upload', |
1823 | 1823 | 'reuploaddesc' => 'Cancel upload and return to the upload form', |
| 1824 | +'uploadnologin' => 'Not logged in', |
| 1825 | +'uploadnologintext' => 'You must be [[Special:UserLogin|logged in]] to upload files.', |
1824 | 1826 | 'upload_directory_missing' => 'The upload directory ($1) is missing and could not be created by the webserver.', |
1825 | 1827 | 'upload_directory_read_only' => 'The upload directory ($1) is not writable by the webserver.', |
1826 | 1828 | 'uploaderror' => 'Upload error', |
— | — | @@ -2773,6 +2775,8 @@ |
2774 | 2776 | |
2775 | 2777 | In those cases, you will have to move or merge the page manually if desired.", |
2776 | 2778 | 'movearticle' => 'Move page:', |
| 2779 | +'movenologin' => 'Not logged in', |
| 2780 | +'movenologintext' => 'You must be a registered user and [[Special:UserLogin|logged in]] to move a page.', |
2777 | 2781 | 'movenotallowed' => 'You do not have permission to move pages.', |
2778 | 2782 | 'movenotallowedfile' => 'You do not have permission to move files.', |
2779 | 2783 | 'cant-move-user-page' => 'You do not have permission to move user pages (apart from subpages).', |