visage tracking opt-in/opt-out
This commit is contained in:
parent
1e86a88f0d
commit
06b7aea1a0
@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
require_once('include/plugin.php');
|
||||
require_once('include/identity.php');
|
||||
|
||||
function get_system_apps() {
|
||||
|
||||
@ -93,6 +94,10 @@ function parse_app_description($f) {
|
||||
if(! local_user())
|
||||
unset($ret);
|
||||
break;
|
||||
case 'public_profile':
|
||||
if(! is_public_profile())
|
||||
unset($ret);
|
||||
break;
|
||||
case 'observer':
|
||||
if(! $observer)
|
||||
unset($ret);
|
||||
@ -189,6 +194,10 @@ function app_render($papp,$mode = 'view') {
|
||||
if(! local_user())
|
||||
return '';
|
||||
break;
|
||||
case 'public_profile':
|
||||
if(! is_public_profile())
|
||||
return '';
|
||||
break;
|
||||
case 'observer':
|
||||
$observer = get_app()->get_observer();
|
||||
if(! $observer)
|
||||
|
@ -1300,3 +1300,15 @@ function identity_selector() {
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
function is_public_profile() {
|
||||
if(! local_user())
|
||||
return false;
|
||||
if(intval(get_config('system','block_public')))
|
||||
return false;
|
||||
$channel = get_app()->get_channel();
|
||||
if($channel && $channel['channel_r_profile'] == PERMS_PUBLIC)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
@ -780,6 +780,14 @@ function post_post(&$a) {
|
||||
$ret['confirm'] = $confirm;
|
||||
if($u && $u[0]['account_service_class'])
|
||||
$ret['service_class'] = $u[0]['account_service_class'];
|
||||
|
||||
// Set "do not track" flag if this site or this channel's profile is restricted
|
||||
|
||||
if(intval(get_config('system','block_public')))
|
||||
$ret['DNT'] = true;
|
||||
if(! perm_is_allowed($c[0]['channel_id'],'','view_profile'))
|
||||
$ret['DNT'] = true;
|
||||
|
||||
json_return_and_die($ret);
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user