* Special page entry point
*/
public function execute( $par ) {
- global $wgGroupPermissions;
-
$this->setHeaders();
$this->outputHeader();
$user = $this->getUser();
$permissionRequired = UploadBase::isAllowed( $user );
if( $permissionRequired !== true ) {
- if( !$user->isLoggedIn() && ( $wgGroupPermissions['user']['upload']
- || $wgGroupPermissions['autoconfirmed']['upload'] ) ) {
- // Custom message if logged-in users without any special rights can upload
- throw new ErrorPageError( 'uploadnologin', 'uploadnologintext' );
- } else {
- throw new PermissionsError( $permissionRequired );
- }
+ throw new PermissionsError( $permissionRequired );
}
# Check blocks
if( $user->isBlocked() ) {
- $this->getOutput()->blockedPage();
- return;
+ throw new UserBlockedError( $user->mBlock );
}
# Check whether we actually want to allow changing stuff
$delNotice = ''; // empty by default
if ( $desiredTitleObj instanceof Title && !$desiredTitleObj->exists() ) {
LogEventsList::showLogExtract( $delNotice, array( 'delete', 'move' ),
- $desiredTitleObj->getPrefixedText(),
+ $desiredTitleObj,
'', array( 'lim' => 10,
'conds' => array( "log_action != 'revision'" ),
'showIfEmpty' => false,
$title = Title::makeTitleSafe( NS_FILE, $this->mDesiredDestName );
$user = $this->getUser();
// Show a subtitle link to deleted revisions (to sysops et al only)
- if( $title instanceof Title && $user->isAllowed( 'deletedhistory' ) && !$user->isBlocked() ) {
- $canViewSuppress = $user->isAllowed( 'suppressrevision' );
- $count = $title->isDeleted( $canViewSuppress );
- if ( $count > 0 ) {
+ if( $title instanceof Title ) {
+ $count = $title->isDeleted();
+ if ( $count > 0 && $user->isAllowed( 'deletedhistory' ) ) {
$link = wfMsgExt(
$user->isAllowed( 'delete' ) ? 'thisisdeleted' : 'viewdeleted',
array( 'parse', 'replaceafter' ),
*/
protected function showRecoverableUploadError( $message ) {
$sessionKey = $this->mUpload->stashSession();
- $message = '<h2>' . wfMsgHtml( 'uploadwarning' ) . "</h2>\n" .
+ $message = '<h2>' . wfMsgHtml( 'uploaderror' ) . "</h2>\n" .
'<div class="error">' . $message . "</div>\n";
$form = $this->getUploadForm( $message, $sessionKey );
$this->showRecoverableUploadError( wfMsgExt( 'illegalfilename',
'parseinline', $details['filtered'] ) );
break;
+ case UploadBase::FILENAME_TOO_LONG:
+ $this->showRecoverableUploadError( wfMsgHtml( 'filename-toolong' ) );
+ break;
case UploadBase::FILETYPE_MISSING:
$this->showRecoverableUploadError( wfMsgExt( 'filetype-missing',
'parseinline' ) );