]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/managedaction.php
A bunch of FormAction and ManagedAction synchronization
[quix0rs-gnu-social.git] / lib / managedaction.php
index 278131b7a6461db41501a8ad417ccfa09fc52874..22752aff61951f144fe65515efa280507602a201 100644 (file)
@@ -64,9 +64,27 @@ class ManagedAction extends Action
         $this->showPage();
     }
 
+    /**
+     * If this is extended in child classes, they should
+     * end with 'return parent::handlePost();' - and they
+     * should only extend this function if what they do
+     * cannot be handled in ->doPost()
+     */
     protected function handlePost()
     {
         // This will only be run if the Action has the property canPost==true
         assert($this->canPost);
+
+        $this->checkSessionToken();
+        return $this->doPost();
+    }
+
+    /**
+     * Do Post stuff. Return a string if successful,
+     * describing what has been done. Always throw an
+     * exception on failure, with a descriptive message.
+     */
+    protected function doPost() {
+        throw new Exception('Unhandled POST');
     }
 }