From: Zach Copley Date: Wed, 18 Feb 2009 23:33:52 +0000 (-0800) Subject: Open the /api/laconica/config.format API method so clients can determine whether... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=28e1c163e3e14b646851d7641c1c8a6a00de8fdc;p=quix0rs-gnu-social.git Open the /api/laconica/config.format API method so clients can determine whether a site is "private". --- diff --git a/actions/api.php b/actions/api.php index 21fe4eea32..a27d244929 100644 --- a/actions/api.php +++ b/actions/api.php @@ -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) {