X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fidentity.php;h=5439b2cc1055ccacfab59f4530178710c3ce1449;hb=fc9dbc0899aed223378be677356cd74e722dfd14;hp=1307b42b1bf6905ef09af6069308284f7b47797f;hpb=884f44ce94de8fdf26a40751dfd4b61b29765d29;p=friendica.git diff --git a/include/identity.php b/include/identity.php index 1307b42b1b..5439b2cc10 100644 --- a/include/identity.php +++ b/include/identity.php @@ -229,13 +229,16 @@ function profile_sidebar($profile, $block = 0) { // Is the local user already connected to that user? if ($connect AND local_user()) { - if (isset($profile["url"])) + if (isset($profile["url"])) { $profile_url = normalise_link($profile["url"]); - else + } + else { $profile_url = normalise_link(App::get_baseurl()."/profile/".$profile["nickname"]); + } $r = q("SELECT * FROM `contact` WHERE NOT `pending` AND `uid` = %d AND `nurl` = '%s'", local_user(), $profile_url); + if (dbm::is_result($r)) $connect = false; } @@ -684,8 +687,9 @@ function advanced_profile(&$a) { $profile['forumlist'] = array( t('Forums:'), ForumManager::profile_advanced($uid)); } - if ($a->profile['uid'] == local_user()) + if ($a->profile['uid'] == local_user()) { $profile['edit'] = array(App::get_baseurl(). '/profiles/'.$a->profile['id'], t('Edit profile'),"", t('Edit profile')); + } return replace_macros($tpl, array( '$title' => t('Profile'),