*/
/**
- * User-requested page cache purging.
- *
- * For users with 'purge', this will directly trigger the cache purging and
- * for users without that right, it will show a confirmation form.
+ * User-requested page cache purging
*
* @ingroup Actions
*/
}
public function onSubmit( $data ) {
- return $this->page->doPurge();
+ return $this->page->doPurge( WikiPage::PURGE_ALL );
}
- /**
- * purge is slightly weird because it can be either formed or formless depending
- * on user permissions
- */
public function show() {
$this->setHeaders();
return;
}
- if ( $user->isAllowed( 'purge' ) ) {
+ if ( $this->getRequest()->wasPosted() ) {
$this->redirectParams = wfArrayToCgi( array_diff_key(
$this->getRequest()->getQueryValues(),
- array( 'title' => null, 'action' => null )
+ [ 'title' => null, 'action' => null ]
) );
- if ( $this->onSubmit( array() ) ) {
+ if ( $this->onSubmit( [] ) ) {
$this->onSuccess();
}
} else {
public function onSuccess() {
$this->getOutput()->redirect( $this->getTitle()->getFullURL( $this->redirectParams ) );
}
+
+ public function doesWrites() {
+ return true;
+ }
}