]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
For good measure, don't return autocomplete results when not logged in.
authorBrion Vibber <brion@pobox.com>
Tue, 7 Dec 2010 01:20:14 +0000 (17:20 -0800)
committerBrion Vibber <brion@pobox.com>
Tue, 7 Dec 2010 01:20:14 +0000 (17:20 -0800)
plugins/Autocomplete/autocomplete.php

index c4b30d264d5d3d23c0a3afade9d568cce65395fb..c92002245fba467c457f866c2e10e9406407c568 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');