';
+ $groups_html .= '';
+ }
+
+ return template_render('../templates/admin_groups.html', array (
+ 'nick' => $user['Nick'],
+ 'groups' => $groups_html
+ ));
+ } else {
+ switch ($_REQUEST["action"]) {
+ case 'edit' :
+ if (isset ($_REQUEST['id']) && preg_match("/^-[0-9]{1,11}$/", $_REQUEST['id']))
+ $id = $_REQUEST['id'];
+ else
+ return error("Incomplete call, missing Groups ID.");
+
+ $room = sql_select("SELECT * FROM `Groups` WHERE `UID`=" . sql_escape($id) . " LIMIT 1");
+ if (count($room) > 0) {
+ list ($room) = $room;
+ $privileges = sql_select("SELECT `Privileges`.*, `GroupPrivileges`.`group_id` FROM `Privileges` LEFT OUTER JOIN `GroupPrivileges` ON (`Privileges`.`id` = `GroupPrivileges`.`privilege_id` AND `GroupPrivileges`.`group_id`=" . sql_escape($id) . ") ORDER BY `Privileges`.`name`");
+ $privileges_html = "";
+ foreach ($privileges as $priv)
+ $privileges_html .= '
' . $priv['name'] . '
' . $priv['desc'] . '
';
+
+ $html .= template_render('../templates/admin_groups_edit_form.html', array (
+ 'link' => page_link_to("admin_groups"),
+ 'id' => $id,
+ 'privileges' => $privileges_html
+ ));
+ } else
+ return error("No Group found.");
+ break;
+
+ case 'save' :
+ if (isset ($_REQUEST['id']) && preg_match("/^-[0-9]{1,11}$/", $_REQUEST['id']))
+ $id = $_REQUEST['id'];
+ else
+ return error("Incomplete call, missing Groups ID.");
+
+ $room = sql_select("SELECT * FROM `Groups` WHERE `UID`=" . sql_escape($id) . " LIMIT 1");
+ if (!is_array($_REQUEST['privileges']))
+ $_REQUEST['privileges'] = array ();
+ if (count($room) > 0) {
+ list ($room) = $room;
+ sql_query("DELETE FROM `GroupPrivileges` WHERE `group_id`=" . sql_escape($id));
+ foreach ($_REQUEST['privileges'] as $priv)
+ if (preg_match("/^[0-9]{1,}$/", $priv) && sql_num_query("SELECT * FROM `Privileges` WHERE `id`=" . sql_escape($priv)) > 0)
+ sql_query("INSERT INTO `GroupPrivileges` SET `group_id`=" . sql_escape($id) . ", `privilege_id`=" . sql_escape($priv));
+ header("Location: " . page_link_to("admin_groups"));
+ } else
+ return error("No Group found.");
+ break;
+ }
+ }
+ return $html;
+}
+?>
diff --git a/includes/sys_menu.php b/includes/sys_menu.php
index 822d558f..739cb9d1 100644
--- a/includes/sys_menu.php
+++ b/includes/sys_menu.php
@@ -29,7 +29,8 @@ function make_navigation() {
// Admin Navigation
$menu .= make_navigation_for(Get_Text('admin/'), array (
"admin_angel_types",
- "admin_rooms"
+ "admin_rooms",
+ "admin_groups"
));
return $menu;
}
diff --git a/templates/admin_groups.html b/templates/admin_groups.html
new file mode 100644
index 00000000..c5b4ac57
--- /dev/null
+++ b/templates/admin_groups.html
@@ -0,0 +1,21 @@
+Hallo %nick%,
+
+hier hast du die Möglichkeit Gruppenrechte zu ändern:
+
+
+
+
+ Name
+
+
+ Rechte
+
+
+
+
+
+
+
+ %groups%
+
+
diff --git a/templates/admin_groups_edit_form.html b/templates/admin_groups_edit_form.html
new file mode 100644
index 00000000..5729df64
--- /dev/null
+++ b/templates/admin_groups_edit_form.html
@@ -0,0 +1,21 @@
+
\ No newline at end of file
diff --git a/txt/TODO b/txt/TODO
index fbaf4377..1ebf5e52 100644
--- a/txt/TODO
+++ b/txt/TODO
@@ -4,6 +4,8 @@
* user_messages schön machen
* Formulare weg von Tabellen
* user_news lässt sich nicht bedienen (POST ohne redirects...)
+ * Privilegien korrigieren (an die vom CVS anpassen)
+ * Beim Raum-Management die benötigten Engel anzeigen
* schichten ueber monatsgrenzen einbaue im moment werden die tage nur
diff --git a/www-ssl/admin/group.php b/www-ssl/admin/group.php
deleted file mode 100644
index b8a52ec2..00000000
--- a/www-ssl/admin/group.php
+++ /dev/null
@@ -1,49 +0,0 @@
-\n";
- echo "