summaryrefslogtreecommitdiffstats
path: root/pages
diff options
context:
space:
mode:
authorneoraider <devnull@localhost>2006-04-13 02:45:02 +0200
committerneoraider <devnull@localhost>2006-04-13 02:45:02 +0200
commit415243607829013d91b23b40608507fcd76b307b (patch)
tree8199fbaacf2d17fbc4c2efe68a2fb46c386086b3 /pages
parent0ef2bb0245fedaf18508feabfa980955ba4a238e (diff)
downloadneon-415243607829013d91b23b40608507fcd76b307b.tar
neon-415243607829013d91b23b40608507fcd76b307b.zip
Seiten-Verwaltung vollkommen ?berarbeitet.
Diffstat (limited to 'pages')
-rw-r--r--pages/Login.c.xml32
-rw-r--r--pages/Login.n.xml43
-rw-r--r--pages/Logout.c.xml27
-rw-r--r--pages/Pages.c.xml58
-rw-r--r--pages/Pages/Copy.c.xml36
-rw-r--r--pages/Pages/Delete.c.xml35
-rw-r--r--pages/Pages/Edit.c.xml44
-rw-r--r--pages/Pages/Handle.c.xml110
-rw-r--r--pages/Pages/New.c.xml39
-rw-r--r--pages/Pages/Rename.c.xml36
-rw-r--r--pages/Privileges.c.xml89
-rw-r--r--pages/Privileges/Update.c.xml77
-rw-r--r--pages/Users.c.xml42
-rw-r--r--pages/Users/Delete.c.xml32
-rw-r--r--pages/Users/Group.c.xml32
-rw-r--r--pages/Users/Handle.c.xml132
-rw-r--r--pages/Users/New.c.xml35
-rw-r--r--pages/Users/Password.c.xml35
-rw-r--r--pages/Users/Rename.c.xml33
-rw-r--r--pages/default.e.xml32
-rw-r--r--pages/phpexec.e.xml29
21 files changed, 1028 insertions, 0 deletions
diff --git a/pages/Login.c.xml b/pages/Login.c.xml
new file mode 100644
index 0000000..5175136
--- /dev/null
+++ b/pages/Login.c.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<page>
+ <info>
+ <name>Login</name>
+ <template>phpexec</template>
+ <access>01</access>
+ <type>c</type>
+ </info>
+ <data>
+ <code>
+ <![CDATA[
+<?PHP
+ if($_POST['name'] && $_POST['password'] && $_POST['page']) {
+ require_once('code/user.inc.php');
+ require_once('code/links.inc.php');
+ require_once('code/message.inc.php');
+ require_once('code/util.inc.php');
+
+ if($GLOBALS['user']->Login(Unquote($_POST['name']), Unquote($_POST['password']))) {
+ header('Location: ' . $GLOBALS['links']->GetNeonLink($_POST['page'], null, false));
+ exit();
+ }
+ }
+
+ $title = Message('Error');
+
+ echo '<span class="error">' . Message('LoginError') . '</span>';
+?>
+ ]]>
+ </code>
+ </data>
+</page>
diff --git a/pages/Login.n.xml b/pages/Login.n.xml
new file mode 100644
index 0000000..c6c50b3
--- /dev/null
+++ b/pages/Login.n.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<page>
+ <info>
+ <name>Login</name>
+ <template>phpexec</template>
+ <access>01</access>
+ <type>n</type>
+ </info>
+ <data>
+ <code>
+ <![CDATA[
+<?PHP
+ if(!$GLOBALS['user']->uid) {
+ require_once('code/user.inc.php');
+ require_once('code/links.inc.php');
+ require_once('code/util.inc.php');
+
+ echo '<form action="';
+ echo $GLOBALS['links']->GetNeonLink('Login');
+ echo '" method="post">';
+ ?>
+ <div class="login">
+ User:<br />
+ <input type="text" name="name" /><br />
+ Passwort:<br />
+ <input type="password" name="password" /><br />
+ <input type="hidden" name="page" value="<?PHP
+ if($_POST['page']) echo Unquote($_POST['page']);
+ else echo $GLOBALS['page'];
+ ?>" />
+ <div class="login_submit">
+ <input type="submit" value="Login" />
+
+ </div>
+ </div>
+</form>
+<?PHP
+ }
+?>
+ ]]>
+ </code>
+ </data>
+</page>
diff --git a/pages/Logout.c.xml b/pages/Logout.c.xml
new file mode 100644
index 0000000..4fcb5b2
--- /dev/null
+++ b/pages/Logout.c.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<page>
+ <info>
+ <name>Logout</name>
+ <template>phpexec</template>
+ <access>08</access>
+ <type>c</type>
+ </info>
+ <data>
+ <code>
+ <![CDATA[
+<?PHP
+ require_once('config/config.inc.php');
+
+ require_once('code/user.inc.php');
+ require_once('code/links.inc.php');
+
+ $GLOBALS['user']->Logout();
+
+ header('Location: ' . $GLOBALS['links']->GetNeonLink($GLOBALS['config']['home'], null, false));
+
+ exit();
+?>
+ ]]>
+ </code>
+ </data>
+</page>
diff --git a/pages/Pages.c.xml b/pages/Pages.c.xml
new file mode 100644
index 0000000..8435abd
--- /dev/null
+++ b/pages/Pages.c.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<page>
+ <info>
+ <name>Pages</name>
+ <template>phpexec</template>
+ <access>00</access>
+ <type>c</type>
+ </info>
+ <data>
+ <code>
+ <![CDATA[
+<?PHP
+ require_once('code/links.inc.php');
+ require_once('code/pages.inc.php');
+
+ $title = 'Seiten';
+
+ echo '<h2>Seiten</h2>';
+
+ $type = $_GET['type'];
+ if($type != 'c' && $type != 'n' && $type != 'e') $type = 'c';
+
+ echo 'Seitentyp: ';
+ echo '<a href="' . $GLOBALS['links']->GetNeonLink('Pages', 'type=c') . '"';
+ if($type == 'c') echo ' class="active_page_link"';
+ echo '>Inhalt</a> | ';
+ echo '<a href="' . $GLOBALS['links']->GetNeonLink('Pages', 'type=n') . '"';
+ if($type == 'n') echo ' class="active_page_link"';
+ echo '>Navigation</a> | ';
+ echo '<a href="' . $GLOBALS['links']->GetNeonLink('Pages', 'type=e') . '"';
+ if($type == 'e') echo ' class="active_page_link"';
+ echo '>Editor</a><br /><br />';
+
+ echo '<form method="post" action="' . $GLOBALS['links']->GetNeonLink('Pages:Handle') . '">';
+
+ echo '<input type="hidden" name="type" value="' . $type . '" />';
+
+ echo '<select name="name" size="15" class="pagelist spaced-bottom">';
+
+ foreach($GLOBALS['pages']->GetList() as $page)
+ if($page[strlen($page)-1] == $type)
+ echo '<option>' . substr($page, 0, -2) . '</option>';
+
+ echo '</select>';
+ echo '<br />';
+ if($type == 'c')
+ echo '<input type="submit" name="view" value="Anzeigen" /> ';
+ echo '<input type="submit" name="new" value="Neu" /> ';
+ echo '<input type="submit" name="edit" value="Bearbeiten" /> ';
+ echo '<input type="submit" name="copy" value="Kopieren" /> ';
+ echo '<input type="submit" name="rename" value="Umbenennen" /> ';
+ echo '<input type="submit" name="delete" value="Löschen" />';
+ echo '</form>';
+?>
+ ]]>
+ </code>
+ </data>
+</page>
diff --git a/pages/Pages/Copy.c.xml b/pages/Pages/Copy.c.xml
new file mode 100644
index 0000000..49aede8
--- /dev/null
+++ b/pages/Pages/Copy.c.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<page>
+ <info>
+ <name>Pages:Copy</name>
+ <template>phpexec</template>
+ <access>00</access>
+ <type>c</type>
+ </info>
+ <data>
+ <code>
+ <![CDATA[
+<?PHP
+ require_once('code/pages.inc.php');
+ require_once('code/links.inc.php');
+ require_once('code/util.inc.php');
+
+
+ if($_POST['type'] != 'c' && $_POST['type'] != 'n' && $_POST['type'] != 'e')
+ exit();
+
+ if($_POST['back']) {
+ header('Location: ' . $GLOBALS['links']->GetNeonLink('Pages', 'type=' . $_POST['type'], false));
+ exit();
+ }
+
+ if(!$_POST['name'] || !$_POST['newname']) exit();
+
+ $GLOBALS['pages']->Copy(Unquote($_POST['name']), $_POST['type'], Unquote($_POST['newname']));
+
+ header('Location: ' . $GLOBALS['links']->GetNeonLink('Pages', 'type=' . $_POST['type'], false));
+ exit();
+?>
+ ]]>
+ </code>
+ </data>
+</page>
diff --git a/pages/Pages/Delete.c.xml b/pages/Pages/Delete.c.xml
new file mode 100644
index 0000000..62c8f41
--- /dev/null
+++ b/pages/Pages/Delete.c.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<page>
+ <info>
+ <name>Pages:Delete</name>
+ <template>phpexec</template>
+ <access>00</access>
+ <type>c</type>
+ </info>
+ <data>
+ <code>
+ <![CDATA[
+<?PHP
+ require_once('code/pages.inc.php');
+ require_once('code/links.inc.php');
+
+
+ if($_POST['type'] != 'c' && $_POST['type'] != 'n' && $_POST['type'] != 'e')
+ exit();
+
+ if($_POST['back']) {
+ header('Location: ' . $GLOBALS['links']->GetNeonLink('Pages', 'type=' . $_POST['type'], false));
+ exit();
+ }
+
+ if(!$_POST['name']) exit();
+
+ $GLOBALS['pages']->Delete(Unquote($_POST['name']), $_POST['type']);
+
+ header('Location: ' . $GLOBALS['links']->GetNeonLink('Pages', 'type=' . $_POST['type'], false));
+ exit();
+?>
+ ]]>
+ </code>
+ </data>
+</page>
diff --git a/pages/Pages/Edit.c.xml b/pages/Pages/Edit.c.xml
new file mode 100644
index 0000000..bf4ea6a
--- /dev/null
+++ b/pages/Pages/Edit.c.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<page>
+ <info>
+ <name>Pages:Edit</name>
+ <template>phpexec</template>
+ <access>00</access>
+ <type>c</type>
+ </info>
+ <data>
+ <code>
+ <![CDATA[
+<?PHP
+ require_once('code/pages.inc.php');
+ require_once('code/links.inc.php');
+ require_once('code/util.inc.php');
+
+
+ if($_POST['type'] != 'c' && $_POST['type'] != 'n' && $_POST['type'] != 'e')
+ exit();
+
+ if($_POST['back']) {
+ header('Location: ' . $GLOBALS['links']->GetNeonLink('Pages', 'type=' . $_POST['type'], false));
+ exit();
+ }
+
+ if(!$_POST['name']) exit();
+
+ $data = array();
+
+ foreach($_POST as $key => $val) {
+ if(substr($key, 0, 5) != 'data_') continue;
+
+ $data[substr($key, 5)] = Unquote($val);
+ }
+
+ $GLOBALS['pages']->Edit(Unquote($_POST['name']), $_POST['type'], $data);
+
+ header('Location: ' . $GLOBALS['links']->GetNeonLink('Pages', 'type=' . $_POST['type'], false));
+ exit();
+?>
+ ]]>
+ </code>
+ </data>
+</page>
diff --git a/pages/Pages/Handle.c.xml b/pages/Pages/Handle.c.xml
new file mode 100644
index 0000000..55aae8b
--- /dev/null
+++ b/pages/Pages/Handle.c.xml
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<page>
+ <info>
+ <name>Pages:Handle</name>
+ <template>phpexec</template>
+ <access>00</access>
+ <type>c</type>
+ </info>
+ <data>
+ <code>
+ <![CDATA[
+<?PHP
+ require_once('code/pages.inc.php');
+ require_once('code/links.inc.php');
+ require_once('code/templates.inc.php');
+
+ if($_POST['type'] != 'c' && $_POST['type'] != 'n' && $_POST['type'] != 'e')
+ exit();
+
+ if(isset($_POST['view'])) {
+ if($_POST['name']) {
+ header('Location: ' . $GLOBALS['links']->GetNeonLink(Unquote($_POST['name']), null, false));
+ exit();
+ }
+ }
+ elseif(isset($_POST['new'])) {
+ $title = 'Neue Seite';
+ ?>
+ <h2>Neue Seite</h2>
+
+ <form method="post" action="<?PHP echo $GLOBALS['links']->GetNeonLink('Pages:New'); ?>">
+ <input type="hidden" name="type" value="<?PHP echo $_POST['type']; ?>" />
+ Name: <input type="text" id="pagename" name="name" size="70" /><br />
+ Template: <select type="text" class="spaced-top" name="template" size="1" />
+ <?PHP
+ foreach(array_keys($GLOBALS['templates']) as $key)
+ echo '<option>' . $key . '</option>';
+ ?>
+ </select><br />
+ <input type="submit" class="spaced-top" value="Neu" />
+ <input type="submit" class="spaced-top" name="back" value="Zurück" />
+ </form>
+ <?PHP
+ }
+ elseif(isset($_POST['edit'])) {
+ if($_POST['name']) {
+ $data = $GLOBALS['pages']->GetEditor(Unquote($_POST['name']), $_POST['type']);
+
+ $title = $data['title'];
+
+ echo $data['content'];
+ }
+ }
+ elseif(isset($_POST['copy'])) {
+ if($_POST['name']) {
+ $name = strtr(Unquote($_POST['name']), array('<' => '&lt;', '>' => '&gt;', '&' => '&amp;', '"' => '&quot;'));
+
+ $title = '\'' . $name . '\' kopieren';
+
+ echo '<h2>\'' . $name . '\' kopieren</h2>';
+
+ echo '<form method="post" action="' . $GLOBALS['links']->GetNeonLink('Pages:Copy') . '">';
+ echo '<input type="hidden" name="name" value="' . $name . '" />';
+ echo '<input type="hidden" name="type" value="' . $_POST['type'] . '" />';
+ echo 'Neuer Name: <input type="text" name="newname" value="' . $name . '" size="70" /><br />';
+ echo '<input type="submit" class="spaced-top" value="Kopieren" /> ';
+ echo '<input type="submit" class="spaced-top" name="back" value="Zurück" />';
+ echo '</form>';
+ }
+ }
+ elseif(isset($_POST['rename'])) {
+ if($_POST['name']) {
+ $name = strtr(Unquote($_POST['name']), array('<' => '&lt;', '>' => '&gt;', '&' => '&amp;', '"' => '&quot;'));
+
+ $title = '\'' . $name . '\' umbenennen';
+
+ echo '<h2>\'' . $name . '\' umbenennen</h2>';
+
+ echo '<form method="post" action="' . $GLOBALS['links']->GetNeonLink('Pages:Rename') . '">';
+ echo '<input type="hidden" name="name" value="' . $name . '" />';
+ echo '<input type="hidden" name="type" value="' . $_POST['type'] . '" />';
+ echo 'Neuer Name:<br />';
+ echo '<input type="text" name="newname" value="' . $name . '" size="70" /><br />';
+ echo '<input type="submit" class="spaced-top" value="Umbenennen" /> ';
+ echo '<input type="submit" class="spaced-top" name="back" value="Zurück" />';
+ echo '</form>';
+ }
+ }
+ elseif(isset($_POST['delete'])) {
+ if($_POST['name']) {
+ $name = strtr(Unquote($_POST['name']), array('<' => '&lt;', '>' => '&gt;', '&' => '&amp;', '"' => '&quot;'));
+
+ $title = '\'' . $name . '\' löschen';
+
+ echo '<h2>\'' . $name . '\' löschen</h2>';
+
+ echo '<form method="post" action="' . $GLOBALS['links']->GetNeonLink('Pages:Delete') . '">';
+ echo '<input type="hidden" name="name" value="' . $name . '" />';
+ echo '<input type="hidden" name="type" value="' . $_POST['type'] . '" />';
+ echo 'Wollen Sie die Seite \'' . $name . '\' wirklich löschen?<br />';
+ echo '<input type="submit" class="spaced-top" value="Löschen" /> ';
+ echo '<input type="submit" class="spaced-top" name="back" value="Zurück" />';
+ echo '</form>';
+ }
+ }
+?>
+ ]]>
+ </code>
+ </data>
+</page>
diff --git a/pages/Pages/New.c.xml b/pages/Pages/New.c.xml
new file mode 100644
index 0000000..8ee794e
--- /dev/null
+++ b/pages/Pages/New.c.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<page>
+ <info>
+ <name>Pages:New</name>
+ <template>phpexec</template>
+ <access>00</access>
+ <type>c</type>
+ </info>
+ <data>
+ <code>
+ <![CDATA[
+<?PHP
+ require_once('code/pages.inc.php');
+ require_once('code/links.inc.php');
+ require_once('code/util.inc.php');
+
+
+ if($_POST['type'] != 'c' && $_POST['type'] != 'n' && $_POST['type'] != 'e')
+ exit();
+
+ if($_POST['back']) {
+ header('Location: ' . $GLOBALS['links']->GetNeonLink('Pages', 'type=' . $_POST['type'], false));
+ exit();
+ }
+
+ if(!$_POST['name'] || !$_POST['template']) exit();
+
+ $GLOBALS['pages']->Add(Unquote($_POST['name']), $_POST['type'], Unquote($_POST['template']));
+
+ $data = $GLOBALS['pages']->GetEditor(Unquote($_POST['name']), $_POST['type']);
+
+ $title = $data['title'];
+
+ echo $data['content'];
+?>
+ ]]>
+ </code>
+ </data>
+</page>
diff --git a/pages/Pages/Rename.c.xml b/pages/Pages/Rename.c.xml
new file mode 100644
index 0000000..be485e2
--- /dev/null
+++ b/pages/Pages/Rename.c.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<page>
+ <info>
+ <name>Pages:Rename</name>
+ <template>phpexec</template>
+ <access>00</access>
+ <type>c</type>
+ </info>
+ <data>
+ <code>
+ <![CDATA[
+<?PHP
+ require_once('code/pages.inc.php');
+ require_once('code/links.inc.php');
+ require_once('code/util.inc.php');
+
+
+ if($_POST['type'] != 'c' && $_POST['type'] != 'n' && $_POST['type'] != 'e')
+ exit();
+
+ if($_POST['back']) {
+ header('Location: ' . $GLOBALS['links']->GetNeonLink('Pages', 'type=' . $_POST['type'], false));
+ exit();
+ }
+
+ if(!$_POST['name'] || !$_POST['newname']) exit();
+
+ $GLOBALS['pages']->Rename(Unquote($_POST['name']), $_POST['type'], Unquote($_POST['newname']));
+
+ header('Location: ' . $GLOBALS['links']->GetNeonLink('Pages', 'type=' . $_POST['type'], false));
+ exit();
+?>
+ ]]>
+ </code>
+ </data>
+</page>
diff --git a/pages/Privileges.c.xml b/pages/Privileges.c.xml
new file mode 100644
index 0000000..7374abb
--- /dev/null
+++ b/pages/Privileges.c.xml
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<page>
+ <info>
+ <name>Privileges</name>
+ <template>phpexec</template>
+ <access>00</access>
+ <type>c</type>
+ </info>
+ <data>
+ <code>
+ <![CDATA[
+<?PHP
+ require_once('code/db.inc.php');
+ require_once('code/links.inc.php');
+ require_once('code/pages.inc.php');
+
+ $title = 'Rechte';
+
+ echo '<h2>Rechte</h2>';
+
+ $type = $_GET['type'];
+ if($type != 'c' && $type != 'n' && $type != 'e') $type = 'c';
+
+ echo 'Seitentyp: ';
+ echo '<a href="' . $GLOBALS['links']->GetNeonLink('Privileges', 'type=c') . '"';
+ if($type == 'c') echo ' class="active_page_link"';
+ echo '>Inhalt</a> | ';
+ echo '<a href="' . $GLOBALS['links']->GetNeonLink('Privileges', 'type=n') . '"';
+ if($type == 'n') echo ' class="active_page_link"';
+ echo '>Navigation</a> | ';
+ echo '<a href="' . $GLOBALS['links']->GetNeonLink('Privileges', 'type=e') . '"';
+ if($type == 'e') echo ' class="active_page_link"';
+ echo '>Editor</a><br /><br />';
+
+ echo '<form action="' . $GLOBALS['links']->GetNeonLink('Privileges:Update') . '" method="post">';
+
+ echo '<input type="hidden" name="type" value="' . $type . '" />';
+
+ echo '<table class="privtab">';
+
+ $groupres = $GLOBALS['db']->Execute('SELECT * FROM groups ORDER BY id');
+ $pages = $GLOBALS['pages']->GetList();
+
+ $groups = $groupres->GetArray();
+ array_unshift($groups, array(0, 'Gast'));
+
+ echo '<tr class="group">';
+
+ echo '<td></td>';
+
+ foreach($groups as $group) {
+ echo '<td>' . $group[1] . '</td>';
+ }
+
+ echo '</tr>';
+
+ $linex = true;
+
+ foreach($pages as $page) {
+ if($page[strlen($page)-1] != $type) continue;
+
+ $pagedata = $GLOBALS['pages']->GetPageData(substr($page, 0, -2), $type);
+
+ echo '<tr class="line' . ($linex ? '1' : '2') . '">';
+ $linex = !$linex;
+
+ echo '<td class="page">' . $pagedata['name'] . '</td>';
+
+ foreach($groups as $group) {
+ echo '<td><input type="checkbox" name="' . $pagedata['name'] . ':' . $group[0] . '" value="true" ';
+ if((hexdec(substr($pagedata['access'], ($group[0]/8)*2, 2)) & (1 << ($group[0]%8))) != 0) echo 'checked="checked" ';
+ echo '/></td>';
+ }
+
+ echo '</tr>';
+ }
+
+ echo '<tr><td colspan="' . (count($groups)+1) . '" class="submit">';
+ echo '<input type="submit" value="Ändern" class="spaced-top" />';
+ echo '</td></tr>';
+
+ echo '</table>';
+
+ echo '</form>';
+?>
+ ]]>
+ </code>
+ </data>
+</page>
diff --git a/pages/Privileges/Update.c.xml b/pages/Privileges/Update.c.xml
new file mode 100644
index 0000000..033bb7f
--- /dev/null
+++ b/pages/Privileges/Update.c.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<page>
+ <info>
+ <name>Privileges:Update</name>
+ <template>phpexec</template>
+ <access>00</access>
+ <type>c</type>
+ </info>
+ <data>
+ <code>
+ <![CDATA[
+<?PHP
+ require_once('code/db.inc.php');
+ require_once('code/links.inc.php');
+ require_once('code/pages.inc.php');
+
+ if($_POST['type'] != 'c' && $_POST['type'] != 'n' && $_POST['type'] != 'e')
+ exit();
+
+ $groupres = $GLOBALS['db']->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 = array_fill(0, $group_max/8 + 1, 0);
+
+ foreach($groups as $group) {
+ if(isset($_POST[$page . ':' . $group[0]]))
+ $access[$group[0]/8] |= (1 << ($group[0]%8));
+ }
+
+ $privileges = join('', array_map('chr', $access));
+
+ $GLOBALS['db']->Execute('UPDATE pages SET access = ? WHERE name = ?', array($privileges, $page));
+
+ if($GLOBALS['db']->Affected_Rows()) continue;
+
+ $pagedata = $GLOBALS['pages']->GetPageData($page, $_POST['type']);
+
+ $access = '';
+
+ for($i = 0; $i < strlen($pagedata['access']); $i+=2)
+ $access .= chr(hexdec(substr($pagedata['access'], $i, 2)));
+
+ if($access == substr($privileges, 0, strlen($access))) {
+ for($i = strlen($access); $i < strlen($privileges); $i++)
+ if($privileges[$i] != 0) break;
+
+ if($i == strlen($privileges)) continue;
+ }
+
+ $string = '';
+
+ foreach($pagedata['data'] as $key => $val)
+ $string .= urlencode($key) . '=' . urlencode($val) . '&';
+
+ $GLOBALS['db']->Execute('INSERT INTO pages (name, template, access, data, type) VALUES (?, ?, ?, ?, ?)',
+ array($page, $pagedata['template'], $access, $string, $_POST['type']));
+ }
+
+ header('Location: ' . $GLOBALS['links']->GetNeonLink('Privileges', 'type=' . $_POST['type'], false));
+ exit();
+
+ $GLOBALS['pages']->GetPageData()
+?>
+ ]]>
+ </code>
+ </data>
+</page>
diff --git a/pages/Users.c.xml b/pages/Users.c.xml
new file mode 100644
index 0000000..076f035
--- /dev/null
+++ b/pages/Users.c.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<page>
+ <info>
+ <name>Users</name>
+ <template>phpexec</template>
+ <access>00</access>
+ <type>c</type>
+ </info>
+ <data>
+ <code>
+ <![CDATA[
+<?PHP
+ require_once('code/db.inc.php');
+ require_once('code/links.inc.php');
+
+ $title = 'Benutzer';
+
+ echo '<h2>Benutzer</h2>';
+
+ $res = $GLOBALS['db']->Execute('SELECT id, user FROM users ORDER BY user');
+
+ echo '<form method="post" action="' . $GLOBALS['links']->GetNeonLink('Users:Handle') . '">';
+
+ echo '<select name="id" size="15" class="userlist spaced-bottom">';
+
+ while($row = $res->FetchRow()) {
+ echo '<option value="' . $row[0] . '">' . $row[1] . '</option>';
+ }
+
+ echo '</select>';
+ echo '<br />';
+ echo '<input type="submit" name="new" value="Neu" /> ';
+ echo '<input type="submit" name="group" value="Gruppe ändern" /> ';
+ echo '<input type="submit" name="password" value="Passwort ändern" /> ';
+ echo '<input type="submit" name="rename" value="Umbenennen" /> ';
+ echo '<input type="submit" name="delete" value="Löschen" />';
+ echo '</form>';
+?>
+ ]]>
+ </code>
+ </data>
+</page>
diff --git a/pages/Users/Delete.c.xml b/pages/Users/Delete.c.xml
new file mode 100644
index 0000000..c4d9594
--- /dev/null
+++ b/pages/Users/Delete.c.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<page>
+ <info>
+ <name>Users:Delete</name>
+ <template>phpexec</template>
+ <access>00</access>
+ <type>c</type>
+ </info>
+ <data>
+ <code>
+ <![CDATA[
+ <?PHP
+ require_once('code/user.inc.php');
+ require_once('code/links.inc.php');
+
+
+ if($_POST['back']) {
+ header('Location: ' . $GLOBALS['links']->GetNeonLink('Users', null, false));
+ exit();
+ }
+
+ if(!$_POST['id']) exit();
+
+ $GLOBALS['user']->Delete($_POST['id']);
+
+ header('Location: ' . $GLOBALS['links']->GetNeonLink('Users', null, false));
+ exit();
+ ?>
+ ]]>
+ </code>
+ </data>
+</page>
diff --git a/pages/Users/Group.c.xml b/pages/Users/Group.c.xml
new file mode 100644
index 0000000..3a7f216
--- /dev/null
+++ b/pages/Users/Group.c.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<page>
+ <info>
+ <name>Users:Group</name>
+ <template>phpexec</template>
+ <access>00</access>
+ <type>c</type>
+ </info>
+ <data>
+ <code>
+ <![CDATA[
+ <?PHP
+ require_once('code/user.inc.php');
+ require_once('code/links.inc.php');
+
+
+ if($_POST['back']) {
+ header('Location: ' . $GLOBALS['links']->GetNeonLink('Users', null, false));
+ exit();
+ }
+
+ if(!isset($_POST['id']) || !isset($_POST['gid'])) exit();
+
+ $GLOBALS['user']->ChangeGroup($_POST['id'], $_POST['gid']);
+
+ header('Location: ' . $GLOBALS['links']->GetNeonLink('Users', null, false));
+ exit();
+ ?>
+ ]]>
+ </code>
+ </data>
+</page>
diff --git a/pages/Users/Handle.c.xml b/pages/Users/Handle.c.xml
new file mode 100644
index 0000000..9002d9f
--- /dev/null
+++ b/pages/Users/Handle.c.xml
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<page>
+ <info>
+ <name>Users:Handle</name>
+ <template>phpexec</template>
+ <access>00</access>
+ <type>c</type>
+ </info>
+ <data>
+ <code>
+ <![CDATA[
+ <?PHP
+ require_once('code/db.inc.php');
+ require_once('code/links.inc.php');
+ require_once('code/user.inc.php');
+
+ if(isset($_POST['new'])) {
+ $title = 'Neuer Benutzer';
+ ?>
+ <h2>Neuer Benutzer</h2>
+
+ <form method="post" action="<?PHP echo $GLOBALS['links']->GetNeonLink('Users:New'); ?>">
+ <div class="spaced-bottom">Name: <input type="text" id="username" name="name" size="70" /></div>
+ Gruppe:<br />
+ <select name="gid" size="15" class="grouplist spaced-bottom">
+ <option value="0">Administrator</option>
+ <?PHP
+ $res = $GLOBALS['db']->Execute('SELECT * FROM groups ORDER BY name');
+
+ while($group = $res->FetchRow()) {
+ echo '<option value="' . $group[0] . '">' . strtr($group[1], array('<' => '&lt;', '>' => '&gt;', '&' => '&amp;', '"' => '&quot;')) . '</option>';
+ }
+ ?>
+ </select><br />
+ Passwort:<br />
+ <input type="password" class="spaced-bottom" name="password" size="30" /><br />
+ Bestätigen:<br />
+ <input type="password" class="spaced-bottom" name="password2" size="30" /><br />
+ <input type="submit" value="Neu" />
+ <input type="submit" name="back" value="Zurück" />
+ </form>
+ <?PHP
+ }
+ elseif(isset($_POST['group'])) {
+ if($_POST['id']) {
+ $name = strtr($GLOBALS['user']->GetName($_POST['id']), array('<' => '&lt;', '>' => '&gt;', '&' => '&amp;', '"' => '&quot;'));
+ $gid = $GLOBALS['user']->GetGid($_POST['id']);
+
+ $title = 'Gruppe von \'' . $name . '\' ändern';
+
+ echo '<h2>Gruppe von \'' . $name . '\' ändern</h2>';
+
+ echo '<form method="post" action="' . $GLOBALS['links']->GetNeonLink('Users:Group') . '">';
+ echo '<input type="hidden" name="id" value="' . $_POST['id'] . '" />';
+ echo 'Neue Gruppe:<br />';
+
+ echo '<select name="gid" size="15" class="grouplist spaced-bottom">';
+
+ $res = $GLOBALS['db']->Execute('SELECT * FROM groups ORDER BY name');
+ $groups = $res->GetArray();
+ array_unshift($groups, array(0, 'Administrator'));
+
+ foreach($groups as $group) {
+ echo '<option value="' . $group[0] . '"';
+ if($group[0] == $gid) echo ' selected="selected"';
+ echo '>' . strtr($group[1], array('<' => '&lt;', '>' => '&gt;', '&' => '&amp;', '"' => '&quot;')) . '</option>';
+ }
+
+ echo '</select><br />';
+
+ echo '<input type="submit" value="Ändern" /> ';
+ echo '<input type="submit" name="back" value="Zurück" />';
+ echo '</form>';
+ }
+ }
+ elseif(isset($_POST['password'])) {
+ if($_POST['id']) {
+ $name = strtr($GLOBALS['user']->GetName($_POST['id']), array('<' => '&lt;', '>' => '&gt;', '&' => '&amp;', '"' => '&quot;'));
+
+ $title = 'Passwort von \'' . $name . '\' ändern';
+
+ echo '<h2>Passwort von \'' . $name . '\' ändern</h2>';
+
+ echo '<form method="post" action="' . $GLOBALS['links']->GetNeonLink('Users:Password') . '">';
+ echo '<input type="hidden" name="id" value="' . $_POST['id'] . '" />';
+ echo 'Neues Passwort:<br />';
+ echo '<input type="password" name="password" class="spaced-bottom" size="30" /><br />';
+ echo 'Bestätigen:<br />';
+ echo '<input type="password" name="password2" class="spaced-bottom" size="30" /><br />';
+ echo '<input type="submit" value="Ändern" /> ';
+ echo '<input type="submit" name="back" value="Zurück" />';
+ echo '</form>';
+ }
+ }
+ elseif(isset($_POST['rename'])) {
+ if($_POST['id']) {
+ $name = strtr($GLOBALS['user']->GetName($_POST['id']), array('<' => '&lt;', '>' => '&gt;', '&' => '&amp;', '"' => '&quot;'));
+
+ $title = '\'' . $name . '\' umbenennen';
+
+ echo '<h2>\'' . $name . '\' umbenennen</h2>';
+
+ echo '<form method="post" action="' . $GLOBALS['links']->GetNeonLink('Users:Rename') . '">';
+ echo '<input type="hidden" name="id" value="' . $_POST['id'] . '" />';
+ echo 'Neuer Name: ';
+ echo '<input type="text" name="name" value="' . $name . '" size="70" /><br />';
+ echo '<input type="submit" class="spaced-top" value="Umbenennen" /> ';
+ echo '<input type="submit" class="spaced-top" name="back" value="Zurück" />';
+ echo '</form>';
+ }
+ }
+ elseif(isset($_POST['delete'])) {
+ if($_POST['id']) {
+ $name = strtr($GLOBALS['user']->GetName($_POST['id']), array('<' => '&lt;', '>' => '&gt;', '&' => '&amp;', '"' => '&quot;'));
+
+ $title = '\'' . $name . '\' löschen';
+
+ echo '<h2>\'' . $name . '\' löschen</h2>';
+
+ echo '<form method="post" action="' . $GLOBALS['links']->GetNeonLink('Users:Delete') . '">';
+ echo '<input type="hidden" name="id" value="' . $_POST['id'] . '" />';
+ echo 'Wollen Sie den Benutzer \'' . $name . '\' wirklich löschen?<br />';
+ echo '<input type="submit" class="spaced-top" value="Löschen" /> ';
+ echo '<input type="submit" class="spaced-top" name="back" value="Zurück" />';
+ echo '</form>';
+ }
+ }
+ ?>
+ ]]>
+ </code>
+ </data>
+</page>
diff --git a/pages/Users/New.c.xml b/pages/Users/New.c.xml
new file mode 100644
index 0000000..2356c37
--- /dev/null
+++ b/pages/Users/New.c.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<page>
+ <info>
+ <name>Users:New</name>
+ <template>phpexec</template>
+ <access>00</access>
+ <type>c</type>
+ </info>
+ <data>
+ <code>
+ <![CDATA[
+ <?PHP
+ require_once('code/user.inc.php');
+ require_once('code/links.inc.php');
+ require_once('code/util.inc.php');
+
+
+ if($_POST['back']) {
+ header('Location: ' . $GLOBALS['links']->GetNeonLink('Users', null, false));
+ exit();
+ }
+
+ if(!$_POST['name'] || !isset($_POST['gid']) || !$_POST['password'] || !$_POST['password2']) exit();
+
+ if($_POST['password'] != $_POST['password2']) exit();
+
+ $GLOBALS['user']->Add(Unquote($_POST['name']), $_POST['gid'], Unquote($_POST['password']));
+
+ header('Location: ' . $GLOBALS['links']->GetNeonLink('Users', null, false));
+ exit();
+ ?>
+ ]]>
+ </code>
+ </data>
+</page>
diff --git a/pages/Users/Password.c.xml b/pages/Users/Password.c.xml
new file mode 100644
index 0000000..5544e6b
--- /dev/null
+++ b/pages/Users/Password.c.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<page>
+ <info>
+ <name>Users:Password</name>
+ <template>phpexec</template>
+ <access>00</access>
+ <type>c</type>
+ </info>
+ <data>
+ <code>
+ <![CDATA[
+ <?PHP
+ require_once('code/user.inc.php');
+ require_once('code/links.inc.php');
+ require_once('code/util.inc.php');
+
+
+ if($_POST['back']) {
+ header('Location: ' . $GLOBALS['links']->GetNeonLink('Users', null, false));
+ exit();
+ }
+
+ if(!$_POST['id'] || !$_POST['password'] || !$_POST['password2']) exit();
+
+ if($_POST['password'] != $_POST['password2']) exit();
+
+ $GLOBALS['user']->ChangePassword($_POST['id'], Unquote($_POST['password']));
+
+ header('Location: ' . $GLOBALS['links']->GetNeonLink('Users', null, false));
+ exit();
+ ?>
+ ]]>
+ </code>
+ </data>
+</page>
diff --git a/pages/Users/Rename.c.xml b/pages/Users/Rename.c.xml
new file mode 100644
index 0000000..c076b10
--- /dev/null
+++ b/pages/Users/Rename.c.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<page>
+ <info>
+ <name>Users:Rename</name>
+ <template>phpexec</template>
+ <access>00</access>
+ <type>c</type>
+ </info>
+ <data>
+ <code>
+ <![CDATA[
+ <?PHP
+ require_once('code/user.inc.php');
+ require_once('code/links.inc.php');
+ require_once('code/util.inc.php');
+
+
+ if($_POST['back']) {
+ header('Location: ' . $GLOBALS['links']->GetNeonLink('Users', null, false));
+ exit();
+ }
+
+ if(!$_POST['id'] || !$_POST['name']) exit();
+
+ $GLOBALS['user']->Rename($_POST['id'], Unquote($_POST['name']));
+
+ header('Location: ' . $GLOBALS['links']->GetNeonLink('Users', null, false));
+ exit();
+ ?>
+ ]]>
+ </code>
+ </data>
+</page>
diff --git a/pages/default.e.xml b/pages/default.e.xml
new file mode 100644
index 0000000..da641dd
--- /dev/null
+++ b/pages/default.e.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<page>
+ <info>
+ <name>phpexec</name>
+ <template>phpexec</template>
+ <access>00</access>
+ <type>e</type>
+ </info>
+ <data>
+ <code>
+ <![CDATA[
+<?PHP
+ $title = 'Edit \'' . $data['_data']['_page'] . '\'';
+
+ echo '<h2>' . $title . '</h2>';
+?>
+<form method="post" action="<?PHP echo $GLOBALS['links']->GetNeonLink('Pages:Edit'); ?>">
+ <input type="hidden" name="name" value="<?PHP echo $data['_data']['_page'] ?>" />
+ <input type="hidden" name="type" value="<?PHP echo $data['_data']['_type']; ?>" />
+ Titel: <input type="text" name="data_title" value="<?PHP
+ echo strtr($data['_data']['title'], array('<' => '&lt;', '>' => '&gt;', '&' => '&amp;', '"' => '&quot;'));
+ ?>" size="70" /><br />
+ <textarea name="data_content" class="pageedit spaced-top spaced-bottom" rows="25" cols="70"><?PHP
+ echo strtr($data['_data']['content'], array('<' => '&lt;', '>' => '&gt;', '&' => '&amp;', '"' => '&quot;'));
+ ?></textarea><br />
+ <input type="submit" value="Änderungen übernehmen" />
+ <input type="submit" name="back" value="Zurück" />
+</form>
+ ]]>
+ </code>
+ </data>
+</page>
diff --git a/pages/phpexec.e.xml b/pages/phpexec.e.xml
new file mode 100644
index 0000000..d56262d
--- /dev/null
+++ b/pages/phpexec.e.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<page>
+ <info>
+ <name>phpexec</name>
+ <template>phpexec</template>
+ <access>00</access>
+ <type>e</type>
+ </info>
+ <data>
+ <code>
+ <![CDATA[
+<?PHP
+ $title = 'Edit \'' . $data['_data']['_page'] . '\'';
+
+ echo '<h2>' . $title . '</h2>';
+?>
+<form method="post" action="<?PHP echo $GLOBALS['links']->GetNeonLink('Pages:Edit'); ?>">
+ <input type="hidden" name="name" value="<?PHP echo $data['_data']['_page'] ?>" />
+ <input type="hidden" name="type" value="<?PHP echo $data['_data']['_type']; ?>" />
+ <textarea name="data_code" class="pageedit spaced-bottom" rows="25" cols="70"><?PHP
+ echo strtr($data['_data']['code'], array('<' => '&lt;', '>' => '&gt;', '&' => '&amp;', '"' => '&quot;'));
+ ?></textarea><br />
+ <input type="submit" value="Änderungen übernehmen" />
+ <input type="submit" name="back" value="Zurück" />
+</form>
+ ]]>
+ </code>
+ </data>
+</page>