]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Autocomplete/autocomplete.php
Mark OembedAction, XrdAction, and (plugin) AutocompleteAction as read-only. Tweaked...
[quix0rs-gnu-social.git] / plugins / Autocomplete / autocomplete.php
index c4b30d264d5d3d23c0a3afade9d568cce65395fb..e15e95ec19abd2c7da8c27362497593701b1dbe9 100644 (file)
@@ -87,7 +87,15 @@ class AutocompleteAction extends Action
 
     function prepare($args)
     {
+        // If we die, show short error messages.
+        StatusNet::setApi(true);
+
         parent::prepare($args);
+
+        $cur = common_current_user();
+        if (!$cur) {
+            throw new ClientException('Access forbidden', true);
+        }
         $this->groups=array();
         $this->users=array();
         $q = $this->arg('q');
@@ -157,4 +165,16 @@ class AutocompleteAction extends Action
             print json_encode($result) . "\n";
         }
     }
+
+    /**
+     * Is this action read-only?
+     *
+     * @param array $args other arguments
+     *
+     * @return boolean is read only action?
+     */
+    function isReadOnly($args)
+    {
+        return true;
+    }
 }