X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=mod%2Fdfrn_poll.php;h=9613229dab04e3381f63a657448acb447f55e6ca;hb=d0cdf863a14d70bb6ce447ad28b2f71872e13b64;hp=82c75d28cfb28ac27035575a462b3d472e487bb9;hpb=0c67c89715df801e0c887be50c9739db3bae7ca3;p=friendica.git diff --git a/mod/dfrn_poll.php b/mod/dfrn_poll.php index 82c75d28cf..9613229dab 100644 --- a/mod/dfrn_poll.php +++ b/mod/dfrn_poll.php @@ -3,7 +3,7 @@ require_once('include/items.php'); require_once('include/auth.php'); require_once('include/dfrn.php'); -if(! function_exists('dfrn_poll_init')) { + function dfrn_poll_init(&$a) { @@ -25,6 +25,8 @@ function dfrn_poll_init(&$a) { $dfrn_id = substr($dfrn_id,2); } + $hidewall = false; + if(($dfrn_id === '') && (! x($_POST,'dfrn_id'))) { if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) { http_status_exit(403); @@ -35,16 +37,17 @@ function dfrn_poll_init(&$a) { $r = q("SELECT `hidewall`,`nickname` FROM `user` WHERE `user`.`nickname` = '%s' LIMIT 1", dbesc($a->argv[1]) ); - if(! $r) + if (!$r) http_status_exit(404); - if(($r[0]['hidewall']) && (! local_user())) - http_status_exit(403); + + $hidewall = ($r[0]['hidewall'] && !local_user()); + $user = $r[0]['nickname']; } logger('dfrn_poll: public feed request from ' . $_SERVER['REMOTE_ADDR'] . ' for ' . $user); header("Content-type: application/atom+xml"); - echo dfrn::feed('', $user,$last_update); + echo dfrn::feed('', $user,$last_update, 0, $hidewall); killme(); } @@ -160,7 +163,7 @@ function dfrn_poll_init(&$a) { if($final_dfrn_id != $orig_id) { logger('profile_check: ' . $final_dfrn_id . ' != ' . $orig_id, LOGGER_DEBUG); - // did not decode properly - cannot trust this site + // did not decode properly - cannot trust this site xml_status(3, 'Bad decryption'); } @@ -195,11 +198,11 @@ function dfrn_poll_init(&$a) { return; // NOTREACHED } } + } -} -if(! function_exists('dfrn_poll_post')) { + function dfrn_poll_post(&$a) { $dfrn_id = ((x($_POST,'dfrn_id')) ? $_POST['dfrn_id'] : ''); @@ -257,7 +260,7 @@ function dfrn_poll_post(&$a) { if($final_dfrn_id != $orig_id) { logger('profile_check: ' . $final_dfrn_id . ' != ' . $orig_id, LOGGER_DEBUG); - // did not decode properly - cannot trust this site + // did not decode properly - cannot trust this site xml_status(3, 'Bad decryption'); } @@ -377,9 +380,7 @@ function dfrn_poll_post(&$a) { } } -} -if(! function_exists('dfrn_poll_content')) { function dfrn_poll_content(&$a) { $dfrn_id = ((x($_GET,'dfrn_id')) ? $_GET['dfrn_id'] : ''); @@ -564,4 +565,3 @@ function dfrn_poll_content(&$a) { } } } -}