remote_user => remote_channel

This commit is contained in:
friendica 2015-01-28 20:58:59 -08:00
parent a496036066
commit e157371c39
33 changed files with 47 additions and 47 deletions

View file

@ -1615,7 +1615,7 @@ function local_channel() {
*
* @return int|bool visitor_id or false
*/
function remote_user() {
function remote_channel() {
if((x($_SESSION, 'authenticated')) && (x($_SESSION, 'visitor_id')))
return $_SESSION['visitor_id'];

View file

@ -11,7 +11,7 @@ Returns numeric account_id if authenticated or 0. It is possible to be authentic
Returns authenticated numeric channel_id if authenticated and connected to a channel or 0. Sometimes referred to as $uid in the code.
* remote_user()
* remote_channel()
Returns authenticated string hash of Red global identifier, if authenticated via remote auth, or an empty string.

View file

@ -8,7 +8,7 @@ Returns numeric account_id if authenticated or 0. It is possible to be authentic
Returns authenticated numeric channel_id if authenticated and connected to a channel or 0. Sometimes referred to as $uid in the code.
[b]remote_user()[/b]
[b]remote_channel()[/b]
Returns authenticated string hash of Red global identifier, if authenticated via remote auth, or an empty string.

File diff suppressed because one or more lines are too long

View file

@ -37,7 +37,7 @@ var boot_8php =
[ "notice", "boot_8php.html#a9255af5ae9c887520091ea04763c1a88", null ],
[ "os_mkdir", "boot_8php.html#a5fbebdf7a1c0ea8f904dbd9d78c2c06c", null ],
[ "proc_run", "boot_8php.html#ab346a2ece14993861f3e4206befa94f0", null ],
[ "remote_user", "boot_8php.html#a5542c5c2806ab8bca04bad53d47b5209", null ],
[ "remote_channel", "boot_8php.html#a5542c5c2806ab8bca04bad53d47b5209", null ],
[ "startup", "boot_8php.html#aca47505b8732177f52bb2d647eb2741c", null ],
[ "system_unavailable", "boot_8php.html#ac608a34f3bc180e7724192e0fd31f9b0", null ],
[ "x", "boot_8php.html#ae97836b0547953be182a2334c9c91d3c", null ],

View file

@ -316,7 +316,7 @@ $(document).ready(function(){initNavTree('globals_0x72.html','');});
<li>remote_online_status()
: <a class="el" href="identity_8php.html#a47d6f53216f23a3484061793bef29854">identity.php</a>
</li>
<li>remote_user()
<li>remote_channel()
: <a class="el" href="boot_8php.html#a5542c5c2806ab8bca04bad53d47b5209">boot.php</a>
</li>
<li>remove_all_xchan_resources()

View file

@ -273,7 +273,7 @@ $(document).ready(function(){initNavTree('globals_func_0x72.html','');});
<li>remote_online_status()
: <a class="el" href="identity_8php.html#a47d6f53216f23a3484061793bef29854">identity.php</a>
</li>
<li>remote_user()
<li>remote_channel()
: <a class="el" href="boot_8php.html#a5542c5c2806ab8bca04bad53d47b5209">boot.php</a>
</li>
<li>remove_all_xchan_resources()

View file

@ -81,7 +81,7 @@ var searchData=
['reload_5fplugins',['reload_plugins',['../plugin_8php.html#af9ac19004dca49adae1ac7a0d9f3b025',1,'plugin.php']]],
['reltoabs',['reltoabs',['../text_8php.html#ad855a32bee22c3f3b9734e3a334b96f2',1,'text.php']]],
['remote_5fonline_5fstatus',['remote_online_status',['../identity_8php.html#a47d6f53216f23a3484061793bef29854',1,'identity.php']]],
['remote_5fuser',['remote_user',['../boot_8php.html#a5542c5c2806ab8bca04bad53d47b5209',1,'boot.php']]],
['remote_5fuser',['remote_channel',['../boot_8php.html#a5542c5c2806ab8bca04bad53d47b5209',1,'boot.php']]],
['remove_5fall_5fxchan_5fresources',['remove_all_xchan_resources',['../Contact_8php.html#acc12cda999c88c4d6185cca967c15125',1,'Contact.php']]],
['remove_5fchild',['remove_child',['../classItem.html#a2ce70ef63f9f4d86a09c351678806925',1,'Item']]],
['remove_5fcommunity_5ftag',['remove_community_tag',['../zot_8php.html#aad25a3fe0e1566121d6fb8222979bc10',1,'zot.php']]],

View file

@ -44,7 +44,7 @@ var searchData=
['reload_5fplugins',['reload_plugins',['../plugin_8php.html#af9ac19004dca49adae1ac7a0d9f3b025',1,'plugin.php']]],
['reltoabs',['reltoabs',['../text_8php.html#ad855a32bee22c3f3b9734e3a334b96f2',1,'text.php']]],
['remote_5fonline_5fstatus',['remote_online_status',['../identity_8php.html#a47d6f53216f23a3484061793bef29854',1,'identity.php']]],
['remote_5fuser',['remote_user',['../boot_8php.html#a5542c5c2806ab8bca04bad53d47b5209',1,'boot.php']]],
['remote_5fuser',['remote_channel',['../boot_8php.html#a5542c5c2806ab8bca04bad53d47b5209',1,'boot.php']]],
['remove_5fall_5fxchan_5fresources',['remove_all_xchan_resources',['../Contact_8php.html#acc12cda999c88c4d6185cca967c15125',1,'Contact.php']]],
['remove_5fchild',['remove_child',['../classItem.html#a2ce70ef63f9f4d86a09c351678806925',1,'Item']]],
['remove_5fcommunity_5ftag',['remove_community_tag',['../zot_8php.html#aad25a3fe0e1566121d6fb8222979bc10',1,'zot.php']]],

View file

@ -233,7 +233,7 @@ function app_render($papp,$mode = 'view') {
$installed = app_installed(local_channel(),$papp);
$hosturl = z_root() . '/';
}
elseif(remote_user()) {
elseif(remote_channel()) {
$observer = get_app()->get_observer();
if($observer && $observer['xchan_network'] === 'zot') {
// some folks might have xchan_url redirected offsite, use the connurl

View file

@ -783,7 +783,7 @@ function profile_load(&$a, $nickname, $profile = '') {
function profile_create_sidebar(&$a,$connect = true) {
$block = (((get_config('system','block_public')) && (! local_channel()) && (! remote_user())) ? true : false);
$block = (((get_config('system','block_public')) && (! local_channel()) && (! remote_channel())) ? true : false);
$a->set_widget('profile',profile_sidebar($a->profile, $block, $connect));
return;
@ -905,7 +905,7 @@ logger('online: ' . $profile['online']);
$block = true;
}
if(($profile['hidewall'] && (! local_channel()) && (! remote_user())) || $block ) {
if(($profile['hidewall'] && (! local_channel()) && (! remote_channel())) || $block ) {
$location = $pdesc = $gender = $marital = $homepage = $online = False;
}
@ -1290,7 +1290,7 @@ function zid_init(&$a) {
$r = q("select * from hubloc where hubloc_addr = '%s' order by hubloc_connected desc limit 1",
dbesc($tmp_str)
);
if($r && remote_user() && remote_user() === $r[0]['hubloc_hash'])
if($r && remote_channel() && remote_channel() === $r[0]['hubloc_hash'])
return;
logger('zid_init: not authenticated. Invoking reverse magic-auth for ' . $tmp_str);
// try to avoid recursion - but send them home to do a proper magic auth
@ -1421,7 +1421,7 @@ function get_online_status($nick) {
$ret = array('result' => false);
if(get_config('system','block_public') && ! local_channel() && ! remote_user())
if(get_config('system','block_public') && ! local_channel() && ! remote_channel())
return $ret;
$r = q("select channel_id, channel_hash from channel where channel_address = '%s' limit 1",

View file

@ -3949,7 +3949,7 @@ function retain_item($id) {
function drop_items($items) {
$uid = 0;
if(! local_channel() && ! remote_user())
if(! local_channel() && ! remote_channel())
return;
if(count($items)) {

View file

@ -39,7 +39,7 @@ EOT;
}
elseif(remote_user())
elseif(remote_channel())
$observer = $a->get_observer();
@ -151,7 +151,7 @@ EOT;
$nav['home'] = array($homelink, t('Home'), "", t('Home Page'),'home_nav_btn');
if(($a->config['system']['register_policy'] == REGISTER_OPEN) && (! local_channel()) && (! remote_user()))
if(($a->config['system']['register_policy'] == REGISTER_OPEN) && (! local_channel()) && (! remote_channel()))
$nav['register'] = array('register',t('Register'), "", t('Create an account'),'register_nav_btn');
$help_url = z_root() . '/help?f=&cmd=' . $a->cmd;

View file

@ -154,7 +154,7 @@ function permissions_sql($owner_id, $remote_verified = false, $groups = null) {
return '';
$local_channel = local_channel();
$remote_user = remote_user();
$remote_channel = remote_channel();
/**
* Construct permissions
@ -227,7 +227,7 @@ function item_permissions_sql($owner_id, $remote_verified = false, $groups = nul
return '';
$local_channel = local_channel();
$remote_user = remote_user();
$remote_channel = remote_channel();
/**
* Construct permissions

View file

@ -426,7 +426,7 @@ function poco($a,$extended = false) {
$system_mode = false;
if(intval(get_config('system','block_public')) && (! local_channel()) && (! remote_user())) {
if(intval(get_config('system','block_public')) && (! local_channel()) && (! remote_channel())) {
logger('mod_poco: block_public');
http_status_exit(401);
}

View file

@ -11,7 +11,7 @@ require_once('include/contact_widgets.php');
function widget_profile($args) {
$a = get_app();
$block = (((get_config('system', 'block_public')) && (! local_channel()) && (! remote_user())) ? true : false);
$block = (((get_config('system', 'block_public')) && (! local_channel()) && (! remote_channel())) ? true : false);
return profile_sidebar($a->profile, $block, true);
}
@ -362,7 +362,7 @@ function widget_fullprofile($arr) {
if(! $a->profile['profile_uid'])
return;
$block = (((get_config('system', 'block_public')) && (! local_channel()) && (! remote_user())) ? true : false);
$block = (((get_config('system', 'block_public')) && (! local_channel()) && (! remote_channel())) ? true : false);
return profile_sidebar($a->profile, $block);
}

View file

@ -263,7 +263,7 @@ function navbar_complete(&$a) {
// logger('navbar_complete');
if((get_config('system','block_public')) && (! local_channel()) && (! remote_user())) {
if((get_config('system','block_public')) && (! local_channel()) && (! remote_channel())) {
return;
}

View file

@ -52,7 +52,7 @@ function channel_content(&$a, $update = 0, $load = false) {
$datequery = ((x($_GET,'dend') && is_a_date_arg($_GET['dend'])) ? notags($_GET['dend']) : '');
$datequery2 = ((x($_GET,'dbegin') && is_a_date_arg($_GET['dbegin'])) ? notags($_GET['dbegin']) : '');
if(get_config('system','block_public') && (! get_account_id()) && (! remote_user())) {
if(get_config('system','block_public') && (! get_account_id()) && (! remote_channel())) {
return login();
}

View file

@ -18,7 +18,7 @@ function directory_init(&$a) {
function directory_content(&$a) {
if((get_config('system','block_public')) && (! local_channel()) && (! remote_user())) {
if((get_config('system','block_public')) && (! local_channel()) && (! remote_channel())) {
notice( t('Public access denied.') . EOL);
return;
}

View file

@ -5,7 +5,7 @@ function display_content(&$a, $update = 0, $load = false) {
// logger("mod-display: update = $update load = $load");
if(intval(get_config('system','block_public')) && (! local_channel()) && (! remote_user())) {
if(intval(get_config('system','block_public')) && (! local_channel()) && (! remote_channel())) {
notice( t('Public access denied.') . EOL);
return;
}

View file

@ -100,7 +100,7 @@ function home_content(&$a, $update = 0, $load = false) {
if($sitename)
$o .= '<h1>' . sprintf( t("Welcome to %s") ,$sitename) . '</h1>';
if(intval(get_config('system','block_public')) && (! local_channel()) && (! remote_user())) {
if(intval(get_config('system','block_public')) && (! local_channel()) && (! remote_channel())) {
// If there's nothing special happening, just spit out a login box
if (! $a->config['system']['no_login_on_homepage'])

View file

@ -26,7 +26,7 @@ function item_post(&$a) {
// This will change. Figure out who the observer is and whether or not
// they have permission to post here. Else ignore the post.
if((! local_channel()) && (! remote_user()) && (! x($_REQUEST,'commenter')))
if((! local_channel()) && (! remote_channel()) && (! x($_REQUEST,'commenter')))
return;
require_once('include/security.php');
@ -905,7 +905,7 @@ function item_post(&$a) {
function item_content(&$a) {
if((! local_channel()) && (! remote_user()))
if((! local_channel()) && (! remote_channel()))
return;
require_once('include/security.php');

View file

@ -15,7 +15,7 @@ function oexchange_init(&$a) {
function oexchange_content(&$a) {
if(! local_channel()) {
if(remote_user()) {
if(remote_channel()) {
$observer = $a->get_observer();
if($observer && $observer['xchan_url']) {
$parsed = @parse_url($observer['xchan_url']);

View file

@ -11,7 +11,7 @@ require_once('include/Contact.php');
function photos_init(&$a) {
if((get_config('system','block_public')) && (! local_channel()) && (! remote_user())) {
if((get_config('system','block_public')) && (! local_channel()) && (! remote_channel())) {
return;
}
@ -122,8 +122,8 @@ function photos_post(&$a) {
// get the list of photos we are about to delete
if(remote_user() && (! local_channel())) {
$str = photos_album_get_db_idstr($page_owner_uid,$album,remote_user());
if(remote_channel() && (! local_channel())) {
$str = photos_album_get_db_idstr($page_owner_uid,$album,remote_channel());
}
elseif(local_channel()) {
$str = photos_album_get_db_idstr(local_channel(),$album);
@ -425,7 +425,7 @@ function photos_content(&$a) {
// photos/name/image/xxxxx
if((get_config('system','block_public')) && (! local_channel()) && (! remote_user())) {
if((get_config('system','block_public')) && (! local_channel()) && (! remote_channel())) {
notice( t('Public access denied.') . EOL);
return;
}

View file

@ -148,7 +148,7 @@ function post_init(&$a) {
// If they are already authenticated and haven't changed credentials,
// we can save an expensive network round trip and improve performance.
$remote = remote_user();
$remote = remote_channel();
$result = null;
$remote_service_class = '';
$remote_level = 0;

View file

@ -51,7 +51,7 @@ function profile_init(&$a) {
function profile_content(&$a, $update = 0) {
if(get_config('system','block_public') && (! get_account_id()) && (! remote_user())) {
if(get_config('system','block_public') && (! get_account_id()) && (! remote_channel())) {
return login();
}
@ -68,7 +68,7 @@ function profile_content(&$a, $update = 0) {
$is_owner = ((local_channel()) && (local_channel() == $a->profile['profile_uid']) ? true : false);
if($a->profile['hidewall'] && (! $is_owner) && (! remote_user())) {
if($a->profile['hidewall'] && (! $is_owner) && (! remote_channel())) {
notice( t('Permission denied.') . EOL);
return;
}

View file

@ -30,7 +30,7 @@ function rpost_content(&$a) {
$o = '';
if(! local_channel()) {
if(remote_user()) {
if(remote_channel()) {
// redirect to your own site.
// We can only do this with a GET request so you'll need to keep the text short or risk getting truncated
// by the wretched beast called 'suhosin'. All the browsers now allow long GET requests, but suhosin

View file

@ -9,7 +9,7 @@ function search_init(&$a) {
function search_content(&$a,$update = 0, $load = false) {
if((get_config('system','block_public')) || (get_config('system','block_public_search'))) {
if ((! local_channel()) && (! remote_user())) {
if ((! local_channel()) && (! remote_channel())) {
notice( t('Public access denied.') . EOL);
return;
}

View file

@ -10,7 +10,7 @@ function share_init(&$a) {
if(! $post_id)
killme();
if(! (local_channel() || remote_user()))
if(! (local_channel() || remote_channel()))
killme();

View file

@ -7,7 +7,7 @@ require_once('include/items.php');
function subthread_content(&$a) {
if((! local_channel()) && (! remote_user())) {
if((! local_channel()) && (! remote_channel())) {
return;
}

View file

@ -7,7 +7,7 @@ require_once('include/items.php');
function tagger_content(&$a) {
if(! local_channel() && ! remote_user()) {
if(! local_channel() && ! remote_channel()) {
return;
}

View file

@ -4,7 +4,7 @@ require_once('include/Contact.php');
function viewconnections_init(&$a) {
if((get_config('system','block_public')) && (! local_channel()) && (! remote_user())) {
if((get_config('system','block_public')) && (! local_channel()) && (! remote_channel())) {
return;
}
if(argc() > 1)
@ -13,7 +13,7 @@ function viewconnections_init(&$a) {
function viewconnections_content(&$a) {
if((get_config('system','block_public')) && (! local_channel()) && (! remote_user())) {
if((get_config('system','block_public')) && (! local_channel()) && (! remote_channel())) {
notice( t('Public access denied.') . EOL);
return;
}

View file

@ -11,7 +11,7 @@ function zotfeed_init(&$a) {
if(! $mindate)
$mindate = datetime_convert('UTC','UTC', 'now - 1 month');
if(get_config('system','block_public') && (! get_account_id()) && (! remote_user())) {
if(get_config('system','block_public') && (! get_account_id()) && (! remote_channel())) {
$result['message'] = 'Public access denied';
json_return_and_die($result);
}