]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
if the site is marked as private, redirect anon users to login
authorEvan Prodromou <evan@controlyourself.ca>
Wed, 3 Dec 2008 18:24:21 +0000 (13:24 -0500)
committerEvan Prodromou <evan@controlyourself.ca>
Wed, 3 Dec 2008 18:24:21 +0000 (13:24 -0500)
darcs-hash:20081203182421-5ed1f-9a8569a5b38ca15c7ae83438a59a05f8b07215bd.gz

index.php

index ae2e56f25c44a7e290a0ce27f6dcdb62e90e790e..8a2afbd7f1d4136d97f2556b5ec91d3352c55e45 100644 (file)
--- a/index.php
+++ b/index.php
@@ -36,6 +36,10 @@ if (!$action || !preg_match('/^[a-zA-Z0-9_-]*$/', $action)) {
     common_redirect(common_local_url('public'));
 }
 
+if (!$user && common_config('site', 'private') && $action != 'login') {
+    common_redirect(common_local_url('login'));
+}
+
 $actionfile = INSTALLDIR."/actions/$action.php";
 
 if (file_exists($actionfile)) {