Privileges:Update
phpexec
0
c
Execute('SELECT id FROM groups ORDER by id');
$pages = $GLOBALS['pages']->GetList();
$groups = $groupres->GetArray();
array_unshift($groups, array(0));
$group_max = $groups[count($groups)-1][0];
foreach($pages as $page) {
if($page[strlen($page)-1] != $_POST['type']) continue;
$page = substr($page, 0, -2);
$access = join('', array_fill(0, $group_max/4 + 1, '0'));
foreach($groups as $group)
if(isset($_POST[$page . ':' . $group[0]]))
$access[$group[0]/4] = dechex(hexdec($access[$group[0]/4]) | (1 << ($group[0]%4)));
$GLOBALS['pages']->SetAccess($page, $_POST['type'], $access);
}
header('Location: ' . $GLOBALS['links']->GetNeonLink('Privileges', 'type=' . $_POST['type'], false));
exit();
?>
]]>