Merge "Register a couple of test classes in autoloader"
[lhc/web/wiklou.git] / includes / actions / PurgeAction.php
index e5da172..183c3b9 100644 (file)
@@ -58,7 +58,14 @@ class PurgeAction extends FormAction {
                // This will throw exceptions if there's a problem
                $this->checkCanExecute( $this->getUser() );
 
-               if ( $this->getUser()->isAllowed( 'purge' ) ) {
+               $user = $this->getUser();
+
+               if ( $user->pingLimiter( 'purge' ) ) {
+                       // TODO: Display actionthrottledtext
+                       return;
+               }
+
+               if ( $user->isAllowed( 'purge' ) ) {
                        $this->redirectParams = wfArrayToCgi( array_diff_key(
                                $this->getRequest()->getQueryValues(),
                                array( 'title' => null, 'action' => null )
@@ -90,4 +97,8 @@ class PurgeAction extends FormAction {
        public function onSuccess() {
                $this->getOutput()->redirect( $this->getTitle()->getFullURL( $this->redirectParams ) );
        }
+
+       public function doesWrites() {
+               return true;
+       }
 }