aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-11-08 18:44:33 -0800
committerfriendica <info@friendica.com>2012-11-08 18:44:33 -0800
commitf66a3d26befeb9966d9059164864c49d1f5a7721 (patch)
tree9a95dfcf2612ae67fb29072d81515025274ba5d8 /include
parentc1b931549c762b90f6c6d67b604c8b0fc09c0a9f (diff)
downloadvolse-hubzilla-f66a3d26befeb9966d9059164864c49d1f5a7721.tar.gz
volse-hubzilla-f66a3d26befeb9966d9059164864c49d1f5a7721.tar.bz2
volse-hubzilla-f66a3d26befeb9966d9059164864c49d1f5a7721.zip
magic auth indicator (link is dead at the moment)
Diffstat (limited to 'include')
-rw-r--r--include/nav.php32
1 files changed, 19 insertions, 13 deletions
diff --git a/include/nav.php b/include/nav.php
index c714502a1..969a20853 100644
--- a/include/nav.php
+++ b/include/nav.php
@@ -36,8 +36,6 @@ EOT;
* Placeholder div for popup panel
*/
- $a->page['nav'] .= '<div id="panel" style="display: none;"></div>' ;
-
/**
*
* Our network is distributed, and as you visit friends some of the
@@ -46,14 +44,17 @@ EOT;
*
*/
- $channel = $a->get_channel();
- $xchan = q("select * from xchan where xchan_hash = '%s' limit 1",
- dbesc($channel['channel_hash'])
- );
+ if(local_user()) {
+ $channel = $a->get_channel();
+ $observer = $a->get_observer();
+ }
+ elseif(remote_user())
+ $observer = $a->get_observer();
+
- $myident = ((is_array($channel) && isset($channel['channel_address'])) ? $channel['channel_address'] . '@' : '');
+ $myident = (($channel) ? $channel['xchan_address'] : '');
- $sitelocation = $myident . substr($a->get_baseurl($ssl_state),strpos($a->get_baseurl($ssl_state),'//') + 2 );
+ $sitelocation = (($myident) ? $myident : $a->get_hostname());
// nav links: array of array('href', 'text', 'extra css classes', 'title')
@@ -76,16 +77,20 @@ EOT;
$nav['usermenu'][] = Array('photos/' . $channel['channel_address'], t('Photos'), "", t('Your photos'));
$nav['usermenu'][] = Array('events/', t('Events'), "", t('Your events'));
- $userinfo = array(
- 'icon' => $xchan[0]['xchan_photo_s'],
- 'name' => $channel['channel_name'],
- );
-
}
else {
$nav['login'] = Array('login',t('Login'), ($a->module == 'login'?'selected':''), t('Sign in'));
}
+ if($observer) {
+ $userinfo = array(
+ 'icon' => $observer['xchan_photo_s'],
+ 'name' => $observer['xchan_addr'],
+ );
+ }
+
+
+ $nav['lock'] = array('rmagic','',(($observer) ? 'lock' : 'unlock'), (($observer) ? $observer['xchan_addr'] : t('Click to authenticate to your home hub')));
/**
* "Home" should also take you home from an authenticated remote profile connection
@@ -188,6 +193,7 @@ EOT;
'$banner' => $banner,
'$emptynotifications' => t('Nothing new here'),
'$userinfo' => $userinfo,
+ '$localuser' => local_user(),
'$sel' => $a->nav_sel,
'$apps' => $a->get_apps(),
));