aboutsummaryrefslogtreecommitdiffstats
path: root/mod/chat.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/chat.php')
-rw-r--r--mod/chat.php24
1 files changed, 10 insertions, 14 deletions
diff --git a/mod/chat.php b/mod/chat.php
index c54d29313..c2c11d0ab 100644
--- a/mod/chat.php
+++ b/mod/chat.php
@@ -54,12 +54,11 @@ function chat_post(&$a) {
goaway(z_root() . '/chat/' . $channel['channel_address']);
}
+ $acl = new AccessList($channel);
+ $acl->set_from_array($_REQUEST);
- $arr = array('name' => $room);
- $arr['allow_gid'] = perms2str($_REQUEST['group_allow']);
- $arr['allow_cid'] = perms2str($_REQUEST['contact_allow']);
- $arr['deny_gid'] = perms2str($_REQUEST['group_deny']);
- $arr['deny_cid'] = perms2str($_REQUEST['contact_deny']);
+ $arr = $acl->get();
+ $arr['name'] = $room;
chatroom_create($channel,$arr);
@@ -158,7 +157,10 @@ function chat_content(&$a) {
intval($a->profile['profile_uid'])
);
if($x) {
- $private = ((($x[0]['allow_cid']) || ($x[0]['allow_gid']) || ($x[0]['deny_cid']) || ($x[0]['deny_gid'])) ? true : false);
+ $acl = new AccessList(false);
+ $acl->set($x[0]);
+
+ $private = $acl->is_private();
$room_name = $x[0]['cr_name'];
if($bookmark_link)
$bookmark_link .= '&url=' . z_root() . '/chat/' . argv(1) . '/' . argv(2) . '&title=' . urlencode($x[0]['cr_name']) . (($private) ? '&private=1' : '') . '&ischat=1';
@@ -192,14 +194,8 @@ function chat_content(&$a) {
if(local_channel() && argc() > 2 && argv(2) === 'new') {
-
-
- $channel_acl = array(
- 'allow_cid' => $channel['channel_allow_cid'],
- 'allow_gid' => $channel['channel_allow_gid'],
- 'deny_cid' => $channel['channel_deny_cid'],
- 'deny_gid' => $channel['channel_deny_gid']
- );
+ $acl = new AccessList($channel);
+ $channel_acl = $acl->get();
require_once('include/acl_selectors.php');