diff options
author | marijus <mario@localhost.localdomain> | 2014-02-07 13:50:18 +0100 |
---|---|---|
committer | marijus <mario@localhost.localdomain> | 2014-02-07 13:50:18 +0100 |
commit | 6dd05bb53fb7892a386740f6ee246649f6f70e1e (patch) | |
tree | cb959c7969402bcc3a70acfb5088ec34f43402f5 /include | |
parent | 6f2c168d1a434b2223f09a922780617fdc07b278 (diff) | |
parent | c80325b4279b6f19540416064382755ca5e6eccd (diff) | |
download | volse-hubzilla-6dd05bb53fb7892a386740f6ee246649f6f70e1e.tar.gz volse-hubzilla-6dd05bb53fb7892a386740f6ee246649f6f70e1e.tar.bz2 volse-hubzilla-6dd05bb53fb7892a386740f6ee246649f6f70e1e.zip |
Merge branch 'master' of https://github.com/friendica/red into upstream
Diffstat (limited to 'include')
-rw-r--r-- | include/chat.php | 11 | ||||
-rwxr-xr-x | include/items.php | 2 | ||||
-rw-r--r-- | include/menu.php | 2 | ||||
-rw-r--r-- | include/nav.php | 10 | ||||
-rw-r--r-- | include/zot.php | 11 |
5 files changed, 31 insertions, 5 deletions
diff --git a/include/chat.php b/include/chat.php index 5af3a3a9a..fb1d4fe65 100644 --- a/include/chat.php +++ b/include/chat.php @@ -114,6 +114,17 @@ function chatroom_enter($observer_xchan,$room_id,$status,$client) { return false; } + $limit = service_class_fetch($r[0]['cr_uid'],'chatters_inroom'); + if($limit !== false) { + $x = q("select count(*) as total from chatpresence where cp_room = %d", + intval($room_id) + ); + if($x && $x[0]['total'] > $limit) { + notice( t('Room is full') . EOL); + return false; + } + } + if(intval($x[0]['cr_expire'])) $r = q("delete from chat where created < UTC_TIMESTAMP() - INTERVAL " . intval($x[0]['cr_expire']) . " MINUTE and chat_room = " . intval($x[0]['cr_id'])); diff --git a/include/items.php b/include/items.php index 1a26198da..88b258604 100755 --- a/include/items.php +++ b/include/items.php @@ -161,7 +161,7 @@ function red_zrl_callback($matches) { } if($zrl) return $matches[1] . '#^[zrl=' . $matches[2] . ']' . $matches[2] . '[/zrl]'; - return $matches[0]; + return $matches[1] . '#^[url=' . $matches[2] . ']' . $matches[2] . '[/url]'; } diff --git a/include/menu.php b/include/menu.php index 813d7bcdb..b879af845 100644 --- a/include/menu.php +++ b/include/menu.php @@ -116,7 +116,7 @@ function menu_list($channel_id, $name = '', $flags = 0) { $sel_options .= (($name) ? " and menu_name = '" . protect_sprintf(dbesc($name)) . "' " : ''); $sel_options .= (($flags) ? " and menu_flags = " . intval($flags) . " " : ''); - $r = q("select * from menu where menu_channel_id = %d $sel_options order by menu_name", + $r = q("select * from menu where menu_channel_id = %d $sel_options order by menu_desc", intval($channel_id) ); return $r; diff --git a/include/nav.php b/include/nav.php index 008899c47..8fef4a1f9 100644 --- a/include/nav.php +++ b/include/nav.php @@ -75,10 +75,14 @@ EOT; $nav['usermenu'][] = Array('channel/' . $channel['channel_address'], t('Home'), "", t('Your posts and conversations')); $nav['usermenu'][] = Array('profile/' . $channel['channel_address'], t('View Profile'), "", t('Your profile page')); if(feature_enabled(local_user(),'multi_profiles')) - $nav['usermenu'][] = Array('profiles', t('Edit Profiles'),"", t('Manage/Edit Profiles')); + $nav['usermenu'][] = Array('profiles', t('Edit Profiles'),"", t('Manage/Edit profiles')); $nav['usermenu'][] = Array('photos/' . $channel['channel_address'], t('Photos'), "", t('Your photos')); -// $nav['usermenu'][] = Array('events/', t('Events'), "", t('Your events')); - + $nav['usermenu'][] = Array('cloud/' . $channel['channel_address'],t('Files'),"",t('Your files')); + $nav['usermenu'][] = Array('chat/' . $channel['channel_address'],t('Chat'),"",t('Your chatrooms')); + $nav['usermenu'][] = Array('events', t('Events'), "", t('Your events')); + $nav['usermenu'][] = Array('bookmarks', t('Bookmarks'), "", t('Your bookmarks')); + if(feature_enabled($channel['channel_id'],'webpages')) + $nav['usermenu'][] = Array('webpages/' . $channel['channel_address'],t('Webpages'),"",t('Your webpages')); } else { if(! get_account_id()) diff --git a/include/zot.php b/include/zot.php index 7c2cfe019..b7a22a099 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1873,6 +1873,17 @@ function import_site($arr,$pubkey) { $access_policy = ACCESS_TIERED; } + // don't let insecure sites register as public hubs + + if(strpos($arr['url'],'https://') === false) + $access_policy = ACCESS_PRIVATE; + + if($access_policy != ACCESS_PRIVATE) { + $x = z_fetch_url($arr['url'] . '/siteinfo/json'); + if(! $x['success']) + $access_policy = ACCESS_PRIVATE; + } + $directory_url = htmlspecialchars($arr['directory_url'],ENT_COMPAT,'UTF-8',false); $url = htmlspecialchars($arr['url'],ENT_COMPAT,'UTF-8',false); $sellpage = htmlspecialchars($arr['sellpage'],ENT_COMPAT,'UTF-8',false); |