]> git.mxchange.org Git - friendica.git/commitdiff
don't show connect link to authenticated visitors
authorFriendika <info@friendika.com>
Wed, 20 Apr 2011 22:27:10 +0000 (15:27 -0700)
committerFriendika <info@friendika.com>
Wed, 20 Apr 2011 22:27:10 +0000 (15:27 -0700)
boot.php
mod/dfrn_poll.php

index 060a9e7cd6071c545924e4cf9a2b722b233a900d..2713f3dcea96b261cf7cf2a1ccb0159c622cd711 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -2,7 +2,7 @@
 
 set_time_limit(0);
 
-define ( 'FRIENDIKA_VERSION',      '2.1.954' );
+define ( 'FRIENDIKA_VERSION',      '2.1.955' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.21'    );
 define ( 'DB_UPDATE_VERSION',      1053      );
 
@@ -2252,8 +2252,15 @@ function profile_sidebar($profile) {
 
        $photo = '<div id="profile-photo-wrapper"><img class="photo" src="' . $profile['photo'] . '" alt="' . $profile['name'] . '" /></div>';
 
+       // don't show connect link to yourself
+       
        $connect = (($profile['uid'] != local_user()) ? '<li><a id="dfrn-request-link" href="dfrn_request/' . $profile['nickname'] . '">' . t('Connect') . '</a></li>' : '');
+
+       // don't show connect link to authenticated visitors either
+
+       if((remote_user()) && ($_SESSION['visitor_visiting'] == $profile['uid']))
+               $connect = ''; 
+
        if((x($profile,'address') == 1) 
                || (x($profile,'locality') == 1) 
                || (x($profile,'region') == 1) 
index 2da1a30faea838710005f6b460becd76f9251cf7..f8c726c1af350239f855f9c30d28fbeabeef69c1 100644 (file)
@@ -76,6 +76,7 @@ function dfrn_poll_init(&$a) {
                                        $_SESSION['authenticated'] = 1;
                                        $_SESSION['visitor_id'] = $r[0]['id'];
                                        $_SESSION['visitor_home'] = $r[0]['url'];
+                                       $_SESSION['visitor_visiting'] = $r[0]['uid'];
                                        notice( sprintf(t('%s welcomes %s'), $r[0]['username'] , $r[0]['name']) . EOL);
                                        // Visitors get 1 day session.
                                        $session_id = session_id();
@@ -501,6 +502,7 @@ function dfrn_poll_content(&$a) {
                                        $_SESSION['authenticated'] = 1;
                                        $_SESSION['visitor_id'] = $r[0]['id'];
                                        $_SESSION['visitor_home'] = $r[0]['url'];
+                                       $_SESSION['visitor_visiting'] = $r[0]['uid'];
                                        notice( sprintf(t('%s welcomes %s'), $r[0]['username'] , $r[0]['name']) . EOL);
                                        // Visitors get 1 day session.
                                        $session_id = session_id();