rework the new connection stuff so we don't need a "permissions have been changed but not saved" message.
This commit is contained in:
parent
642c933d98
commit
4ca2ec7638
@ -66,14 +66,15 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false)
|
|||||||
|
|
||||||
$my_perms = get_channel_default_perms($uid);
|
$my_perms = get_channel_default_perms($uid);
|
||||||
|
|
||||||
if($is_red && $j) {
|
$role = get_pconfig($uid,'system','permissions_role');
|
||||||
|
if($role) {
|
||||||
|
$x = get_role_perms($role);
|
||||||
|
if($x['perms_follow'])
|
||||||
|
$my_perms = $x['perms_follow'];
|
||||||
|
}
|
||||||
|
|
||||||
$role = get_pconfig($uid,'system','permissions_role');
|
|
||||||
if($role) {
|
if($is_red && $j) {
|
||||||
$x = get_role_perms($role);
|
|
||||||
if($x['perms_follow'])
|
|
||||||
$my_perms = $x['perms_follow'];
|
|
||||||
}
|
|
||||||
|
|
||||||
logger('follow: ' . $url . ' ' . print_r($j,true), LOGGER_DEBUG);
|
logger('follow: ' . $url . ' ' . print_r($j,true), LOGGER_DEBUG);
|
||||||
|
|
||||||
@ -105,7 +106,6 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false)
|
|||||||
|
|
||||||
$xchan_hash = $x['hash'];
|
$xchan_hash = $x['hash'];
|
||||||
|
|
||||||
|
|
||||||
$their_perms = 0;
|
$their_perms = 0;
|
||||||
|
|
||||||
$global_perms = get_perms();
|
$global_perms = get_perms();
|
||||||
@ -163,12 +163,6 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false)
|
|||||||
if($r) {
|
if($r) {
|
||||||
$xchan_hash = $r[0]['xchan_hash'];
|
$xchan_hash = $r[0]['xchan_hash'];
|
||||||
$their_perms = 0;
|
$their_perms = 0;
|
||||||
$role = get_pconfig($uid,'system','permissions_role');
|
|
||||||
if($role) {
|
|
||||||
$x = get_role_perms($role);
|
|
||||||
if($x['perms_follow'])
|
|
||||||
$my_perms = $x['perms_follow'];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -198,6 +192,7 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($is_http) {
|
if($is_http) {
|
||||||
|
|
||||||
if(! intval(get_config('system','feed_contacts'))) {
|
if(! intval(get_config('system','feed_contacts'))) {
|
||||||
$result['message'] = t('Protocol disabled.');
|
$result['message'] = t('Protocol disabled.');
|
||||||
return $result;
|
return $result;
|
||||||
|
@ -131,6 +131,7 @@ function connedit_post(&$a) {
|
|||||||
if(($_REQUEST['pending']) && ($abook_flags & ABOOK_FLAG_PENDING)) {
|
if(($_REQUEST['pending']) && ($abook_flags & ABOOK_FLAG_PENDING)) {
|
||||||
$abook_flags = ( $abook_flags ^ ABOOK_FLAG_PENDING );
|
$abook_flags = ( $abook_flags ^ ABOOK_FLAG_PENDING );
|
||||||
$new_friend = true;
|
$new_friend = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = q("UPDATE abook SET abook_profile = '%s', abook_my_perms = %d , abook_closeness = %d, abook_rating = %d, abook_rating_text = '%s', abook_flags = %d
|
$r = q("UPDATE abook SET abook_profile = '%s', abook_my_perms = %d , abook_closeness = %d, abook_rating = %d, abook_rating_text = '%s', abook_flags = %d
|
||||||
@ -273,27 +274,19 @@ function connedit_content(&$a) {
|
|||||||
$sort_type = 0;
|
$sort_type = 0;
|
||||||
$o = '';
|
$o = '';
|
||||||
|
|
||||||
// this triggers some javascript to set Full Sharing by default after
|
|
||||||
// completing a "follow" - which can be changed to something else before
|
|
||||||
// form submission, but this gives us something useable
|
|
||||||
|
|
||||||
if($_GET['follow'] == 1) {
|
|
||||||
$o .= '<script>var after_following = 1;</script>';
|
|
||||||
}
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
return login();
|
return login();
|
||||||
}
|
}
|
||||||
|
|
||||||
$my_perms = 0;
|
$my_perms = get_channel_default_perms(local_user());
|
||||||
$role = get_pconfig(local_user(),'system','permissions_role');
|
$role = get_pconfig(local_user(),'system','permissions_role');
|
||||||
if($role) {
|
if($role) {
|
||||||
$x = get_role_perms($role);
|
$x = get_role_perms($role);
|
||||||
if($x['perms_accept'])
|
if($x['perms_accept'])
|
||||||
$my_perms = $x['perms_accept'];
|
$my_perms = $x['perms_accept'];
|
||||||
else
|
|
||||||
$my_perms = get_channel_default_perms(local_user());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($my_perms) {
|
if($my_perms) {
|
||||||
$o .= "<script>function connectDefaultShare() {
|
$o .= "<script>function connectDefaultShare() {
|
||||||
\$('.abook-edit-me').each(function() {
|
\$('.abook-edit-me').each(function() {
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
|
|
||||||
function abook_perms_msg() {
|
function abook_perms_msg() {
|
||||||
$('.abook-permsmsg').show();
|
// $('.abook-permsmsg').show();
|
||||||
// $('.abook-permschange').html(aStr['permschange']);
|
// $('.abook-permschange').html(aStr['permschange']);
|
||||||
$('.abook-permssave').show();
|
// $('.abook-permssave').show();
|
||||||
}
|
}
|
||||||
|
|
||||||
function abook_perms_new() {
|
function abook_perms_new() {
|
||||||
$('.abook-permsnew').show();
|
// $('.abook-permsnew').show();
|
||||||
$('.abook-permssave').show();
|
// $('.abook-permssave').show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user