]> git.mxchange.org Git - friendica.git/commitdiff
"firewall" setting - block all public pages from the public if configured to do so
authorFriendika <info@friendika.com>
Fri, 22 Apr 2011 00:29:47 +0000 (17:29 -0700)
committerFriendika <info@friendika.com>
Fri, 22 Apr 2011 00:29:47 +0000 (17:29 -0700)
boot.php
mod/dfrn_poll.php
mod/directory.php
mod/display.php
mod/photos.php
mod/profile.php
mod/search.php

index 2713f3dcea96b261cf7cf2a1ccb0159c622cd711..13d6a36d2fc5db4c503b3ee9eafd995b74af7dbb 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -2,7 +2,7 @@
 
 set_time_limit(0);
 
-define ( 'FRIENDIKA_VERSION',      '2.1.955' );
+define ( 'FRIENDIKA_VERSION',      '2.1.956' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.21'    );
 define ( 'DB_UPDATE_VERSION',      1053      );
 
index f8c726c1af350239f855f9c30d28fbeabeef69c1..718aa165c6bbefd9a229e40f5e7a2d1c739a1dfd 100644 (file)
@@ -27,6 +27,10 @@ function dfrn_poll_init(&$a) {
        }
 
        if(($dfrn_id === '') && (! x($_POST,'dfrn_id')) && ($a->argc > 1)) {
+               if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
+                       killme();
+               }
+
                logger('dfrn_poll: public feed request from ' . $_SERVER['REMOTE_ADDR'] );
                header("Content-type: application/atom+xml");
                $o = get_feed_for($a, '', $a->argv[1],$last_update);
index a02a4a4a572e8a688df4f8654766129f78a073e0..95ddbda21a162ae3d4bb646466efd5624798ab2c 100644 (file)
@@ -13,6 +13,12 @@ function directory_post(&$a) {
 
 
 function directory_content(&$a) {
+
+       if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
+               notice( t('Public access denied.') . EOL);
+               return;
+       }
+
        $o = '';
        $o .= '<script> $(document).ready(function() { $(\'#nav-directory-link\').addClass(\'nav-selected\'); });</script>';
        if(x($_SESSION,'theme'))
index c8496160f5ed7fe026284152bdf71308318b9791..fdb93e480cc3676f8487dfa899edda6ad9d72d8f 100644 (file)
@@ -3,6 +3,11 @@
 
 function display_content(&$a) {
 
+       if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
+               notice( t('Public access denied.') . EOL);
+               return;
+       }
+
        require_once("include/bbcode.php");
        require_once('include/security.php');
        require_once('include/conversation.php');
index 186873a7b899b6ca5ebd1b8809542b3ff735d4c8..324ce898d26003fdf188ebd919114cc43e6590a6 100644 (file)
@@ -6,6 +6,10 @@ require_once('include/bbcode.php');
 
 function photos_init(&$a) {
 
+
+       if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
+               return;
+       }
        $o = '';
 
        if($a->argc > 1) {
@@ -657,6 +661,12 @@ function photos_content(&$a) {
        // photos/name/image/xxxxx/edit
 
 
+       if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
+               notice( t('Public access denied.') . EOL);
+               return;
+       }
+
+
        require_once('include/bbcode.php');
        require_once('include/security.php');
        require_once('include/conversation.php');
index dfa5649e083585a931bf77c05d6cc1fc265faeed..c350aa08792ca445879570a7ec64ba60b35dfb6c 100644 (file)
@@ -2,6 +2,9 @@
 
 function profile_init(&$a) {
 
+       if((get_config('system','block_public')) && (! local_user()) && (! remote_user()))
+               return;
+
        if($a->argc > 1)
                $which = $a->argv[1];
        else {
@@ -48,6 +51,13 @@ function profile_init(&$a) {
 
 function profile_content(&$a, $update = 0) {
 
+       if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
+               notice( t('Public access denied.') . EOL);
+               return;
+       }
+
+
+
        require_once("include/bbcode.php");
        require_once('include/security.php');
        require_once('include/conversation.php');
index 793a8c2bb282e9f26a14f9689abd3ea3caead314..33032e183234b706c45b98fbd8ddf1f4104f8d28 100644 (file)
@@ -9,6 +9,11 @@ function search_post(&$a) {
 
 function search_content(&$a) {
 
+       if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
+               notice( t('Public access denied.') . EOL);
+               return;
+       }
+
        require_once("include/bbcode.php");
        require_once('include/security.php');
        require_once('include/conversation.php');