diff options
author | friendica <info@friendica.com> | 2014-01-29 18:19:19 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-01-29 18:19:19 -0800 |
commit | c24aa824fe49d6dc803fb58c577d2238db416f2f (patch) | |
tree | b6387717d5f76e961391734efb0ba677beeb9f56 /mod | |
parent | 0d326dfb45734950159030ea02b02dec4fba55b7 (diff) | |
download | volse-hubzilla-c24aa824fe49d6dc803fb58c577d2238db416f2f.tar.gz volse-hubzilla-c24aa824fe49d6dc803fb58c577d2238db416f2f.tar.bz2 volse-hubzilla-c24aa824fe49d6dc803fb58c577d2238db416f2f.zip |
chat is a members only feature, there is no "guest" access.
Diffstat (limited to 'mod')
-rw-r--r-- | mod/chat.php | 12 |
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()); |