aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-01-29 18:19:19 -0800
committerfriendica <info@friendica.com>2014-01-29 18:19:19 -0800
commitc24aa824fe49d6dc803fb58c577d2238db416f2f (patch)
treeb6387717d5f76e961391734efb0ba677beeb9f56
parent0d326dfb45734950159030ea02b02dec4fba55b7 (diff)
downloadvolse-hubzilla-c24aa824fe49d6dc803fb58c577d2238db416f2f.tar.gz
volse-hubzilla-c24aa824fe49d6dc803fb58c577d2238db416f2f.tar.bz2
volse-hubzilla-c24aa824fe49d6dc803fb58c577d2238db416f2f.zip
chat is a members only feature, there is no "guest" access.
-rw-r--r--mod/chat.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/mod/chat.php b/mod/chat.php
index bc981b76b..42a7808d9 100644
--- a/mod/chat.php
+++ b/mod/chat.php
@@ -39,20 +39,26 @@ function chat_init(&$a) {
function chat_content(&$a) {
- if(! perm_is_allowed($a->profile['profile_uid'],get_observer_hash(),'chat')) {
+ $observer = get_observer_hash();
+ if(! $observer) {
+ notice( t('Permission denied.') . EOL);
+ return;
+ }
+
+ if(! perm_is_allowed($a->profile['profile_uid'],$observer,'chat')) {
notice( t('Permission denied.') . EOL);
return;
}
if((argc() > 3) && intval(argv(2)) && (argv(3) === 'leave')) {
- chatroom_leave(get_observer_hash(),$room_id,$_SERVER['REMOTE_ADDR']);
+ chatroom_leave($observer,$room_id,$_SERVER['REMOTE_ADDR']);
goaway(z_root() . '/channel/' . argv(1));
}
if(argc() > 2 && intval(argv(2))) {
$room_id = intval(argv(2));
- $x = chatroom_enter(get_observer_hash(),$room_id,'online',$_SERVER['REMOTE_ADDR']);
+ $x = chatroom_enter($observer,$room_id,'online',$_SERVER['REMOTE_ADDR']);
if(! $x)
return;
$o = replace_macros(get_markup_template('chat.tpl'),array());