summaryrefslogtreecommitdiffstats
path: root/pages/Pages:Privs.xml
diff options
context:
space:
mode:
Diffstat (limited to 'pages/Pages:Privs.xml')
-rw-r--r--pages/Pages:Privs.xml56
1 files changed, 56 insertions, 0 deletions
diff --git a/pages/Pages:Privs.xml b/pages/Pages:Privs.xml
new file mode 100644
index 0000000..875d5f4
--- /dev/null
+++ b/pages/Pages:Privs.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<page>
+ <info>
+ <name>Pages:Privs</name>
+ <template>phpexec</template>
+ <access>0:0</access>
+ </info>
+ <data>
+ <code>
+ <![CDATA[
+<?PHP
+ Uses('pages', 'links', 'util');
+
+
+ if($_POST['back']) {
+ header('Location: ' . $GLOBALS['links']->GetNeonLink('Pages', null, false));
+ exit();
+ }
+
+ if(!$_POST['name']) exit();
+
+ $groups = $GLOBALS['user']->ListGroups();
+ array_unshift($groups, array(0));
+
+ $group_max = $groups[count($groups)-1][0];
+
+ $readaccess = implode('', array_fill(0, $group_max/4 + 1, '0'));
+ $writeaccess = $readaccess;
+
+ foreach($groups as $group) {
+ if(!isset($_POST['group_' . $group[0]])) exit();
+
+ switch($_POST['group_' . $group[0]]) {
+ case 0:
+ break;
+ case 1:
+ $readaccess[$group[0]/4] = dechex(hexdec($readaccess[$group[0]/4]) | (1 << ($group[0]%4)));
+ break;
+ case 2:
+ $readaccess[$group[0]/4] = dechex(hexdec($readaccess[$group[0]/4]) | (1 << ($group[0]%4)));
+ $writeaccess[$group[0]/4] = dechex(hexdec($writeaccess[$group[0]/4]) | (1 << ($group[0]%4)));
+ break;
+ default:
+ exit();
+ }
+ }
+
+ $GLOBALS['pages']->SetAccess(Unquote($_POST['name']), array($readaccess, $writeaccess));
+
+ header('Location: ' . $GLOBALS['links']->GetNeonLink('Pages', null, false));
+ exit();
+?>
+ ]]>
+ </code>
+ </data>
+</page>