]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/api.php
Merge branch '0.7.x' of git@gitorious.org:laconica/dev into 0.7.x
[quix0rs-gnu-social.git] / actions / api.php
index dfe2c8857b67ff4d8a94d9de1a299856d525c32d..a27d244929f032468cc5ae0e4373a936a8d47c37 100644 (file)
@@ -131,14 +131,14 @@ class ApiAction extends Action
                                  'statuses/followers',
                                  'favorites/favorites');
 
-        # If the site is "private", all API methods need authentication
-
+        $fullname = "$this->api_action/$this->api_method";
+        
+        // If the site is "private", all API methods except laconica/config 
+        // need authentication
         if (common_config('site', 'private')) {
-            return true;
+            return $fullname != 'laconica/config' || false;
         }
 
-        $fullname = "$this->api_action/$this->api_method";
-
         if (in_array($fullname, $bareauth)) {
             # bareauth: only needs auth if without an argument
             if ($this->api_arg) {
@@ -162,12 +162,12 @@ class ApiAction extends Action
 
         if ($this->content_type == 'xml') {
             header('Content-Type: application/xml; charset=utf-8');
-            common_start_xml();
+            $this->startXML();
             $this->elementStart('hash');
             $this->element('error', null, $msg);
             $this->element('request', null, $_SERVER['REQUEST_URI']);
             $this->elementEnd('hash');
-            common_end_xml();
+            $this->endXML();
         } else if ($this->content_type == 'json')  {
             header('Content-Type: application/json; charset=utf-8');
             $error_array = array('error' => $msg, 'request' => $_SERVER['REQUEST_URI']);