aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/auth.php4
-rw-r--r--include/conversation.php3
-rw-r--r--include/features.php2
-rwxr-xr-xinclude/items.php26
-rw-r--r--include/nav.php2
-rw-r--r--include/network.php8
-rw-r--r--include/session.php3
-rw-r--r--include/widgets.php8
8 files changed, 38 insertions, 18 deletions
diff --git a/include/auth.php b/include/auth.php
index aaec45c40..228143e12 100644
--- a/include/auth.php
+++ b/include/auth.php
@@ -246,7 +246,7 @@ else {
notice( t('Failed authentication') . EOL);
}
- logger('authenticate: ' . print_r(App::$account, true), LOGGER_DEBUG);
+ logger('authenticate: ' . print_r(App::$account, true), LOGGER_ALL);
}
if((! $record) || (! count($record))) {
@@ -274,7 +274,7 @@ else {
// (i.e. expire when the browser is closed), even when there's a time expiration
// on the cookie
- if($_POST['remember']) {
+ if($_POST['remember_me']) {
new_cookie(31449600); // one year
}
else {
diff --git a/include/conversation.php b/include/conversation.php
index 829e85382..5e9ba16a1 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -1592,6 +1592,7 @@ function network_tabs() {
function profile_tabs($a, $is_owner = false, $nickname = null){
// Don't provide any profile tabs if we're running as the sys channel
+
if (App::$is_sys)
return;
@@ -1669,7 +1670,7 @@ function profile_tabs($a, $is_owner = false, $nickname = null){
}
- if ($p['chat']) {
+ if ($p['chat'] && feature_enabled($uid,'ajaxchat')) {
require_once('include/chat.php');
$has_chats = chatroom_list_count($uid);
if ($has_chats) {
diff --git a/include/features.php b/include/features.php
index ff6b71d4c..38700f9f5 100644
--- a/include/features.php
+++ b/include/features.php
@@ -56,7 +56,7 @@ function get_features($filtered = true) {
array('private_notes', t('Private Notes'), t('Enables a tool to store notes and reminders (note: not encrypted)'),false,get_config('feature_lock','private_notes')),
array('nav_channel_select', t('Navigation Channel Select'), t('Change channels directly from within the navigation dropdown menu'),false,get_config('feature_lock','nav_channel_select')),
array('photo_location', t('Photo Location'), t('If location data is available on uploaded photos, link this to a map.'),false,get_config('feature_lock','photo_location')),
-
+ array('ajaxchat', t('Access Controlled Chatrooms'), t('Provide chatrooms and chat services with access control.'),true,get_config('feature_lock','ajaxchat')),
array('smart_birthdays', t('Smart Birthdays'), t('Make birthday events timezone aware in case your friends are scattered across the planet.'),true,get_config('feature_lock','smart_birthdays')),
array('expert', t('Expert Mode'), t('Enable Expert Mode to provide advanced configuration options'),false,get_config('feature_lock','expert')),
array('premium_channel', t('Premium Channel'), t('Allows you to set restrictions and terms on those that connect with your channel'),false,get_config('feature_lock','premium_channel')),
diff --git a/include/items.php b/include/items.php
index 07cf2e0e8..95822c0ba 100755
--- a/include/items.php
+++ b/include/items.php
@@ -4118,22 +4118,26 @@ function feed_meta($xml) {
$rawauthor = $feed->get_feed_tags(SIMPLEPIE_NAMESPACE_ATOM_10,'author');
logger('rawauthor: ' . print_r($rawauthor,true));
- if($rawauthor && $rawauthor[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['link']) {
- $base = $rawauthor[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['link'];
- foreach($base as $link) {
- if(!x($author, 'author_photo') || ! $author['author_photo']) {
- if($link['attribs']['']['rel'] === 'photo' || $link['attribs']['']['rel'] === 'avatar') {
- $author['author_photo'] = unxmlify($link['attribs']['']['href']);
- break;
- }
- }
- }
+ if($rawauthor) {
+ if($rawauthor[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['link']) {
+ $base = $rawauthor[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['link'];
+ foreach($base as $link) {
+ if(!x($author, 'author_photo') || ! $author['author_photo']) {
+ if($link['attribs']['']['rel'] === 'photo' || $link['attribs']['']['rel'] === 'avatar') {
+ $author['author_photo'] = unxmlify($link['attribs']['']['href']);
+ break;
+ }
+ }
+ }
+ }
if($rawauthor[0]['child'][NAMESPACE_POCO]['displayName'][0]['data'])
$author['full_name'] = unxmlify($rawauthor[0]['child'][NAMESPACE_POCO]['displayName'][0]['data']);
+ if($rawauthor[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'])
+ $author['author_uri'] = unxmlify($rawauthor[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data']);
+
}
}
-
if(substr($author['author_link'],-1,1) == '/')
$author['author_link'] = substr($author['author_link'],0,-1);
diff --git a/include/nav.php b/include/nav.php
index 3f5c7963a..201882fd1 100644
--- a/include/nav.php
+++ b/include/nav.php
@@ -92,7 +92,7 @@ EOT;
$nav['usermenu'][] = Array('photos/' . $channel['channel_address'], t('Photos'), "", t('Your photos'),'photos_nav_btn');
$nav['usermenu'][] = Array('cloud/' . $channel['channel_address'],t('Files'),"",t('Your files'),'cloud_nav_btn');
- if(! UNO)
+ if((! UNO) && feature_enabled(local_channel(),'ajaxchat'))
$nav['usermenu'][] = Array('chat/' . $channel['channel_address'], t('Chat'),"",t('Your chatrooms'),'chat_nav_btn');
diff --git a/include/network.php b/include/network.php
index ac14548a5..c9ae8b283 100644
--- a/include/network.php
+++ b/include/network.php
@@ -1089,7 +1089,7 @@ function discover_by_webbie($webbie) {
// If we discover zot - don't search further; grab the info and get out of
// here.
- if($link['rel'] == 'http://purl.org/zot/protocol') {
+ if($link['rel'] === PROTOCOL_ZOT) {
logger('discover_by_webbie: zot found for ' . $webbie, LOGGER_DEBUG);
if(array_key_exists('zot',$x) && $x['zot']['success'])
$i = import_xchan($x['zot']);
@@ -1265,6 +1265,12 @@ function discover_by_webbie($webbie) {
if($feed_meta['author']['author_photo'])
$avatar = $feed_meta['author']['author_photo'];
}
+
+ // for GNU-social over-ride any url aliases we may have picked up in webfinger
+ // The author.uri element in the feed is likely to be more accurate
+
+ if($gnusoc && $feed_meta['author']['author_uri'])
+ $location = $feed_meta['author']['author_uri'];
}
}
else {
diff --git a/include/session.php b/include/session.php
index 71bfdc12a..82f82a9b9 100644
--- a/include/session.php
+++ b/include/session.php
@@ -45,12 +45,13 @@ function nuke_session() {
function new_cookie($time) {
+
$old_sid = session_id();
// ??? This shouldn't have any effect if called after session_start()
// We probably need to set the session expiration and change the PHPSESSID cookie.
+ // session_set_cookie_params($time);
- session_set_cookie_params($time);
session_regenerate_id(false);
q("UPDATE session SET sid = '%s' WHERE sid = '%s'",
diff --git a/include/widgets.php b/include/widgets.php
index 0116e5bd1..0355ebd8c 100644
--- a/include/widgets.php
+++ b/include/widgets.php
@@ -785,6 +785,7 @@ function widget_menu_preview($arr) {
function widget_chatroom_list($arr) {
+
require_once("include/chat.php");
$r = chatroom_list(App::$profile['profile_uid']);
@@ -808,6 +809,10 @@ function widget_chatroom_members() {
}
function widget_bookmarkedchats($arr) {
+
+ if(! feature_enabled(App::$profile['profile_uid'],'ajaxchat'))
+ return '';
+
$h = get_observer_hash();
if(! $h)
return;
@@ -827,6 +832,9 @@ function widget_bookmarkedchats($arr) {
function widget_suggestedchats($arr) {
+ if(! feature_enabled(App::$profile['profile_uid'],'ajaxchat'))
+ return '';
+
// probably should restrict this to your friends, but then the widget will only work
// if you are logged in locally.