diff options
author | marijus <mario@localhost.localdomain> | 2014-02-07 21:35:18 +0100 |
---|---|---|
committer | marijus <mario@localhost.localdomain> | 2014-02-07 21:35:18 +0100 |
commit | 4c0f9a91b95025f08e3c4e2739cb5f4186726023 (patch) | |
tree | 3b19b8c3aa086e4931aac9790d298b2306f71ff7 /include | |
parent | c26ae94592dda51a40903ea65f117fd7dd9d0ef3 (diff) | |
parent | f62ec4132ed571288737423de386054a4cc8b0d5 (diff) | |
download | volse-hubzilla-4c0f9a91b95025f08e3c4e2739cb5f4186726023.tar.gz volse-hubzilla-4c0f9a91b95025f08e3c4e2739cb5f4186726023.tar.bz2 volse-hubzilla-4c0f9a91b95025f08e3c4e2739cb5f4186726023.zip |
Merge branch 'upstream'
Diffstat (limited to 'include')
-rw-r--r-- | include/chat.php | 11 | ||||
-rw-r--r-- | include/group.php | 4 | ||||
-rwxr-xr-x | include/items.php | 10 | ||||
-rw-r--r-- | include/menu.php | 2 | ||||
-rw-r--r-- | include/nav.php | 10 | ||||
-rw-r--r-- | include/zot.php | 11 |
6 files changed, 38 insertions, 10 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/group.php b/include/group.php index 56a7555bc..56f177ab0 100644 --- a/include/group.php +++ b/include/group.php @@ -188,11 +188,11 @@ function group_get_members($gid) { if(intval($gid)) { $r = q("SELECT * FROM `group_member` LEFT JOIN abook ON abook_xchan = `group_member`.`xchan` left join xchan on xchan_hash = abook_xchan - WHERE `gid` = %d AND abook_channel = %d and `group_member`.`uid` = %d and not ( abook_flags & %d ) and not ( abook_flags & %d ) and not ( abook_flags & %d ) ORDER BY xchan_name ASC ", + WHERE `gid` = %d AND abook_channel = %d and `group_member`.`uid` = %d and not ( xchan_flags & %d ) and not ( abook_flags & %d ) and not ( abook_flags & %d ) ORDER BY xchan_name ASC ", intval($gid), intval(local_user()), intval(local_user()), - intval(ABOOK_FLAG_SELF), + intval(XCHAN_FLAGS_DELETED), intval(ABOOK_FLAG_BLOCKED), intval(ABOOK_FLAG_PENDING) ); diff --git a/include/items.php b/include/items.php index 8b9cc8d04..88b258604 100755 --- a/include/items.php +++ b/include/items.php @@ -160,8 +160,8 @@ function red_zrl_callback($matches) { $zrl = true; } if($zrl) - return $matches[1] . '[zrl=' . $matches[2] . ']' . $matches[2] . '[/zrl]'; - return $matches[0]; + return $matches[1] . '#^[zrl=' . $matches[2] . ']' . $matches[2] . '[/zrl]'; + return $matches[1] . '#^[url=' . $matches[2] . ']' . $matches[2] . '[/url]'; } @@ -2109,11 +2109,13 @@ function send_status_notifications($post_id,$item) { $link = get_app()->get_baseurl() . '/display/' . $item['mid']; - $r = q("select id from notify where link = '%s' and uid = %d limit 1", + + $y = q("select id from notify where link = '%s' and uid = %d limit 1", dbesc($link), intval($item['uid']) ); - if($r) + + if($y) $notify = false; if(! $notify) 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); |