Open the /api/laconica/config.format API method so clients can determine whether a site is "private".
This commit is contained in:
parent
6fb3923cef
commit
28e1c163e3
|
@ -131,14 +131,14 @@ class ApiAction extends Action
|
||||||
'statuses/followers',
|
'statuses/followers',
|
||||||
'favorites/favorites');
|
'favorites/favorites');
|
||||||
|
|
||||||
# If the site is "private", all API methods need authentication
|
|
||||||
|
|
||||||
if (common_config('site', 'private')) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$fullname = "$this->api_action/$this->api_method";
|
$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 $fullname != 'laconica/config' || false;
|
||||||
|
}
|
||||||
|
|
||||||
if (in_array($fullname, $bareauth)) {
|
if (in_array($fullname, $bareauth)) {
|
||||||
# bareauth: only needs auth if without an argument
|
# bareauth: only needs auth if without an argument
|
||||||
if ($this->api_arg) {
|
if ($this->api_arg) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user