Slap some prettier warnings on too-big deletions.
This commit is contained in:
parent
552308cc42
commit
ba113e12e5
2 changed files with 21 additions and 12 deletions
|
|
@ -1942,20 +1942,9 @@ class Article {
|
|||
$wgOut->showPermissionsErrorPage( $permission_errors );
|
||||
return;
|
||||
}
|
||||
|
||||
# Hack for big sites
|
||||
if( $this->isBigDeletion() ) {
|
||||
$permission_errors = $this->mTitle->getUserPermissionsErrors(
|
||||
'bigdelete', $wgUser );
|
||||
|
||||
if( count( $permission_errors ) > 0 ) {
|
||||
$wgOut->showPermissionsErrorPage( $permission_errors );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$wgOut->setPagetitle( wfMsg( 'confirmdelete' ) );
|
||||
|
||||
|
||||
# Better double-check that it hasn't been deleted yet!
|
||||
$dbw = wfGetDB( DB_MASTER );
|
||||
$conds = $this->mTitle->pageCond();
|
||||
|
|
@ -1965,6 +1954,17 @@ class Article {
|
|||
return;
|
||||
}
|
||||
|
||||
# Hack for big sites
|
||||
$bigHistory = $this->isBigDeletion();
|
||||
if( $bigHistory && !$this->mTitle->userCan( 'bigdelete' ) ) {
|
||||
global $wgLang, $wgDeleteRevisionsLimit;
|
||||
$wgOut->addWikiText( "<div class='error'>\n" .
|
||||
wfMsg( 'delete-toobig',
|
||||
$wgLang->formatNum( $wgDeleteRevisionsLimit ) ) .
|
||||
"</div>\n" );
|
||||
return;
|
||||
}
|
||||
|
||||
if( $confirm ) {
|
||||
$this->doDelete( $reason );
|
||||
if( $wgRequest->getCheck( 'wpWatch' ) ) {
|
||||
|
|
@ -1983,6 +1983,13 @@ class Article {
|
|||
if( $hasHistory && !$confirm ) {
|
||||
$skin=$wgUser->getSkin();
|
||||
$wgOut->addHTML( '<strong>' . wfMsg( 'historywarning' ) . ' ' . $skin->historyLink() . '</strong>' );
|
||||
if( $bigHistory ) {
|
||||
global $wgLang, $wgDeleteRevisionsLimit;
|
||||
$wgOut->addWikiText( "<div class='error'>\n" .
|
||||
wfMsg( 'delete-warning-toobig',
|
||||
$wgLang->formatNum( $wgDeleteRevisionsLimit ) ) .
|
||||
"</div>\n" );
|
||||
}
|
||||
}
|
||||
|
||||
return $this->confirmDelete( '', $reason );
|
||||
|
|
|
|||
|
|
@ -1917,6 +1917,8 @@ See $2 for a record of recent deletions.',
|
|||
** Author request
|
||||
** Copyright violation
|
||||
** Vandalism',
|
||||
'delete-toobig' => 'This page has a large edit history, over $1 revisions. Deletion of such pages has been restricted to prevent accidental disruption of the site.',
|
||||
'delete-warning-toobig' => 'This page has a large edit history, over $1 revisions. Deleting it may disrupt database operations; proceed with caution.',
|
||||
'rollback' => 'Roll back edits',
|
||||
'rollback_short' => 'Rollback',
|
||||
'rollbacklink' => 'rollback',
|
||||
|
|
|
|||
Loading…
Reference in a new issue