We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 8c10b0ac authored by Evan Prodromou's avatar Evan Prodromou

fine-tuning the privacy flag

darcs-hash:20081203183432-5ed1f-7626661b797f64594f990ee06d9e13b73b265b49.gz
parent 06b234c3
This diff is collapsed.
......@@ -120,6 +120,12 @@ class ApiAction extends Action {
'statuses/followers',
'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";
if (in_array($fullname, $bareauth)) {
......
......@@ -36,7 +36,12 @@ if (!$action || !preg_match('/^[a-zA-Z0-9_-]*$/', $action)) {
common_redirect(common_local_url('public'));
}
if (!$user && common_config('site', 'private') && !in_array($action, array('login', 'api', 'doc')) {
// If the site is private, and they're not on one of the "public"
// parts of the site, redirect to login
if (!$user && common_config('site', 'private') &&
!in_array($action, array('login', 'openidlogin', 'api', 'doc')))
{
common_redirect(common_local_url('login'));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment