aboutsummaryrefslogtreecommitdiffstats
path: root/include/menu.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/menu.php')
-rw-r--r--include/menu.php32
1 files changed, 16 insertions, 16 deletions
diff --git a/include/menu.php b/include/menu.php
index d20df1d6e..7ed931a59 100644
--- a/include/menu.php
+++ b/include/menu.php
@@ -3,6 +3,7 @@
require_once('include/security.php');
require_once('include/bbcode.php');
+
function menu_fetch($name,$uid,$observer_xchan) {
$sql_options = permissions_sql($uid);
@@ -299,19 +300,18 @@ function menu_add_item($menu_id, $uid, $arr) {
$channel = get_app()->get_channel();
}
- $str_group_allow = perms2str($arr['group_allow']);
- $str_contact_allow = perms2str($arr['contact_allow']);
- $str_group_deny = perms2str($arr['group_deny']);
- $str_contact_deny = perms2str($arr['contact_deny']);
+ $acl = new AccessList($channel);
+ $acl->set_from_array($arr);
+ $p = $acl->get();
$r = q("insert into menu_item ( mitem_link, mitem_desc, mitem_flags, allow_cid, allow_gid, deny_cid, deny_gid, mitem_channel_id, mitem_menu_id, mitem_order ) values ( '%s', '%s', %d, '%s', '%s', '%s', '%s', %d, %d, %d ) ",
dbesc($mitem_link),
dbesc($mitem_desc),
intval($mitem_flags),
- dbesc($str_contact_allow),
- dbesc($str_group_allow),
- dbesc($str_contact_deny),
- dbesc($str_group_deny),
+ dbesc($p['allow_cid']),
+ dbesc($p['allow_gid']),
+ dbesc($p['deny_cid']),
+ dbesc($p['deny_gid']),
intval($uid),
intval($menu_id),
intval($mitem_order)
@@ -341,19 +341,19 @@ function menu_edit_item($menu_id, $uid, $arr) {
$channel = get_app()->get_channel();
}
- $str_group_allow = perms2str($arr['group_allow']);
- $str_contact_allow = perms2str($arr['contact_allow']);
- $str_group_deny = perms2str($arr['group_deny']);
- $str_contact_deny = perms2str($arr['contact_deny']);
+ $acl = new AccessList($channel);
+ $acl->set_from_array($arr);
+ $p = $acl->get();
+
$r = q("update menu_item set mitem_link = '%s', mitem_desc = '%s', mitem_flags = %d, allow_cid = '%s', allow_gid = '%s', deny_cid = '%s', deny_gid = '%s', mitem_order = %d where mitem_channel_id = %d and mitem_menu_id = %d and mitem_id = %d",
dbesc($mitem_link),
dbesc($mitem_desc),
intval($mitem_flags),
- dbesc($str_contact_allow),
- dbesc($str_group_allow),
- dbesc($str_contact_deny),
- dbesc($str_group_deny),
+ dbesc($p['allow_cid']),
+ dbesc($p['allow_gid']),
+ dbesc($p['deny_cid']),
+ dbesc($p['deny_gid']),
intval($mitem_order),
intval($uid),
intval($menu_id),