diff options
author | neoraider <devnull@localhost> | 2006-04-18 01:17:05 +0200 |
---|---|---|
committer | neoraider <devnull@localhost> | 2006-04-18 01:17:05 +0200 |
commit | e7359ccf2db89b1feec820d1c97583f720ae0d7a (patch) | |
tree | 4321a817497f064457c184364a9a2745bf5bd629 /pages/content | |
parent | 1a78cfbd3315897aa84b7a5d6735d54d94a590a1 (diff) | |
download | neon-e7359ccf2db89b1feec820d1c97583f720ae0d7a.tar neon-e7359ccf2db89b1feec820d1c97583f720ae0d7a.zip |
Seiten verschoben.
Diffstat (limited to 'pages/content')
-rw-r--r-- | pages/content/Login.xml | 32 | ||||
-rw-r--r-- | pages/content/Logout.xml | 27 | ||||
-rw-r--r-- | pages/content/Modules.xml | 36 | ||||
-rw-r--r-- | pages/content/Pages.xml | 59 | ||||
-rw-r--r-- | pages/content/Pages:Copy.xml | 36 | ||||
-rw-r--r-- | pages/content/Pages:Delete.xml | 35 | ||||
-rw-r--r-- | pages/content/Pages:Edit.xml | 44 | ||||
-rw-r--r-- | pages/content/Pages:Handle.xml | 161 | ||||
-rw-r--r-- | pages/content/Pages:New.xml | 39 | ||||
-rw-r--r-- | pages/content/Pages:Privs.xml | 62 | ||||
-rw-r--r-- | pages/content/Pages:Rename.xml | 36 | ||||
-rw-r--r-- | pages/content/Users.xml | 42 | ||||
-rw-r--r-- | pages/content/Users:Delete.xml | 32 | ||||
-rw-r--r-- | pages/content/Users:Group.xml | 32 | ||||
-rw-r--r-- | pages/content/Users:Handle.xml | 132 | ||||
-rw-r--r-- | pages/content/Users:New.xml | 35 | ||||
-rw-r--r-- | pages/content/Users:Password.xml | 35 | ||||
-rw-r--r-- | pages/content/Users:Rename.xml | 33 |
18 files changed, 908 insertions, 0 deletions
diff --git a/pages/content/Login.xml b/pages/content/Login.xml new file mode 100644 index 0000000..3f69400 --- /dev/null +++ b/pages/content/Login.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<page> + <info> + <name>Login</name> + <template>phpexec</template> + <access>1:0</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/content/Logout.xml b/pages/content/Logout.xml new file mode 100644 index 0000000..9447dca --- /dev/null +++ b/pages/content/Logout.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<page> + <info> + <name>Logout</name> + <template>phpexec</template> + <access>8:0</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/content/Modules.xml b/pages/content/Modules.xml new file mode 100644 index 0000000..4aa2cda --- /dev/null +++ b/pages/content/Modules.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<page> + <info> + <name>Modules</name> + <template>phpexec</template> + <access>0:0</access> + <type>c</type> + </info> + <data> + <code> + <![CDATA[ +<?PHP + require_once('code/links.inc.php'); + require_once('code/modules.inc.php'); + + $title = 'Module'; + + echo '<h2>Module</h2>'; + + $modules = array_keys($GLOBALS['modules']->modules); + sort($modules); + + foreach($modules as $module) { + echo '<div class="modinfo">'; + + echo '<h3>' . htmlspecialchars($module) . '</h3>'; + + echo htmlspecialchars($GLOBALS['modules']->modules[$module]['desc']); + + echo '</div>'; + } +?> + ]]> + </code> + </data> +</page> diff --git a/pages/content/Pages.xml b/pages/content/Pages.xml new file mode 100644 index 0000000..f9db838 --- /dev/null +++ b/pages/content/Pages.xml @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<page> + <info> + <name>Pages</name> + <template>phpexec</template> + <access>0:0</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="privs" value="Rechte ändern" /> '; + 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/content/Pages:Copy.xml b/pages/content/Pages:Copy.xml new file mode 100644 index 0000000..79becca --- /dev/null +++ b/pages/content/Pages:Copy.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<page> + <info> + <name>Pages:Copy</name> + <template>phpexec</template> + <access>0:0</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/content/Pages:Delete.xml b/pages/content/Pages:Delete.xml new file mode 100644 index 0000000..07e6ff3 --- /dev/null +++ b/pages/content/Pages:Delete.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<page> + <info> + <name>Pages:Delete</name> + <template>phpexec</template> + <access>0:0</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/content/Pages:Edit.xml b/pages/content/Pages:Edit.xml new file mode 100644 index 0000000..dfe9a51 --- /dev/null +++ b/pages/content/Pages:Edit.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<page> + <info> + <name>Pages:Edit</name> + <template>phpexec</template> + <access>0:0</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/content/Pages:Handle.xml b/pages/content/Pages:Handle.xml new file mode 100644 index 0000000..c2b6602 --- /dev/null +++ b/pages/content/Pages:Handle.xml @@ -0,0 +1,161 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<page> + <info> + <name>Pages:Handle</name> + <template>phpexec</template> + <access>0:0</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['privs'])) { + if($_POST['name']) { + $name = htmlspecialchars(Unquote($_POST['name'])); + + $title = 'Rechte von \'' . $name . '\' ändern'; + + echo '<h2>Rechte von \'' . $name . '\' ändern</h2>'; + + $access = $GLOBALS['pages']->GetAccess(Unquote($_POST['name']), $_POST['type']); + $groups = $GLOBALS['user']->ListGroups(); + + array_unshift($groups, array(0, 'Gast')); + + echo '<form action="' . $GLOBALS['links']->GetNeonLink('Pages:Privs') . '" method="post">'; + + echo '<input type="hidden" name="name" value="' . $name . '" />'; + echo '<input type="hidden" name="type" value="' . $_POST['type'] . '" />'; + + echo '<table>'; + + foreach($groups as $group) { + echo '<tr><td>' . htmlspecialchars($group[1]) . '</td><td>'; + + echo '<select size="1" name="group_' . $group[0] . '">'; + + echo '<option value="0"'; + if((hexdec($access[0][$group[0]/4]) & (1 << ($group[0]%4))) == 0) echo ' selected="selected"'; + echo '>Kein Zugriff</option>'; + + echo '<option value="1"'; + if(((hexdec($access[0][$group[0]/4]) & (1 << ($group[0]%4))) != 0) + && ((hexdec($access[1][$group[0]/4]) & (1 << ($group[0]%4))) == 0)) + echo ' selected="selected"'; + echo '>Nur lesen</option>'; + + echo '<option value="2"'; + if((hexdec($access[1][$group[0]/4]) & (1 << ($group[0]%4))) != 0) echo ' selected="selected"'; + echo '>Lesen und schreiben</option>'; + + echo '</select></td></tr>'; + } + + echo '</table>'; + + echo '<input type="submit" class="spaced-top" value="Ändern" /> '; + echo '<input type="submit" class="spaced-top" name="back" value="Zurück" />'; + + echo '</form>'; + } + } + elseif(isset($_POST['copy'])) { + if($_POST['name']) { + $name = htmlspecialchars(Unquote($_POST['name'])); + + $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 = htmlspecialchars(Unquote($_POST['name'])); + + $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 = htmlspecialchars(Unquote($_POST['name'])); + + $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/content/Pages:New.xml b/pages/content/Pages:New.xml new file mode 100644 index 0000000..6dd1b68 --- /dev/null +++ b/pages/content/Pages:New.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<page> + <info> + <name>Pages:New</name> + <template>phpexec</template> + <access>0:0</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/content/Pages:Privs.xml b/pages/content/Pages:Privs.xml new file mode 100644 index 0000000..5023d1e --- /dev/null +++ b/pages/content/Pages:Privs.xml @@ -0,0 +1,62 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<page> + <info> + <name>Pages:Privs</name> + <template>phpexec</template> + <access>0:0</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(); + + $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']), $_POST['type'], array($readaccess, $writeaccess)); + + header('Location: ' . $GLOBALS['links']->GetNeonLink('Pages', 'type=' . $_POST['type'], false)); + exit(); +?> + ]]> + </code> + </data> +</page> diff --git a/pages/content/Pages:Rename.xml b/pages/content/Pages:Rename.xml new file mode 100644 index 0000000..236b709 --- /dev/null +++ b/pages/content/Pages:Rename.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<page> + <info> + <name>Pages:Rename</name> + <template>phpexec</template> + <access>0:0</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/content/Users.xml b/pages/content/Users.xml new file mode 100644 index 0000000..2dcd181 --- /dev/null +++ b/pages/content/Users.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<page> + <info> + <name>Users</name> + <template>phpexec</template> + <access>0:0</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/content/Users:Delete.xml b/pages/content/Users:Delete.xml new file mode 100644 index 0000000..8c32935 --- /dev/null +++ b/pages/content/Users:Delete.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<page> + <info> + <name>Users:Delete</name> + <template>phpexec</template> + <access>0:0</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/content/Users:Group.xml b/pages/content/Users:Group.xml new file mode 100644 index 0000000..b48e369 --- /dev/null +++ b/pages/content/Users:Group.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<page> + <info> + <name>Users:Group</name> + <template>phpexec</template> + <access>0:0</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/content/Users:Handle.xml b/pages/content/Users:Handle.xml new file mode 100644 index 0000000..abed354 --- /dev/null +++ b/pages/content/Users:Handle.xml @@ -0,0 +1,132 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<page> + <info> + <name>Users:Handle</name> + <template>phpexec</template> + <access>0:0</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('<' => '<', '>' => '>', '&' => '&', '"' => '"')) . '</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('<' => '<', '>' => '>', '&' => '&', '"' => '"')); + $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('<' => '<', '>' => '>', '&' => '&', '"' => '"')) . '</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('<' => '<', '>' => '>', '&' => '&', '"' => '"')); + + $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('<' => '<', '>' => '>', '&' => '&', '"' => '"')); + + $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('<' => '<', '>' => '>', '&' => '&', '"' => '"')); + + $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/content/Users:New.xml b/pages/content/Users:New.xml new file mode 100644 index 0000000..ac6bed9 --- /dev/null +++ b/pages/content/Users:New.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<page> + <info> + <name>Users:New</name> + <template>phpexec</template> + <access>0:0</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/content/Users:Password.xml b/pages/content/Users:Password.xml new file mode 100644 index 0000000..c08cd02 --- /dev/null +++ b/pages/content/Users:Password.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<page> + <info> + <name>Users:Password</name> + <template>phpexec</template> + <access>0:0</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/content/Users:Rename.xml b/pages/content/Users:Rename.xml new file mode 100644 index 0000000..def6aa4 --- /dev/null +++ b/pages/content/Users:Rename.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<page> + <info> + <name>Users:Rename</name> + <template>phpexec</template> + <access>0:0</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> |