more work on AccessList integration

This commit is contained in:
redmatrix
2015-08-27 22:20:30 -07:00
parent 3fbb955cf2
commit ca0bc2bb7b
9 changed files with 113 additions and 139 deletions

View File

@@ -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');