summaryrefslogtreecommitdiff
path: root/includes/controller
diff options
context:
space:
mode:
authorPhilip Häusler <msquare@notrademark.de>2014-08-22 22:34:13 +0200
committerPhilip Häusler <msquare@notrademark.de>2014-08-22 22:34:13 +0200
commit74647e16d37fac9425a4561b49618b52cdc3e75c (patch)
tree7bfd868f8ef2646e65ffd8dbdf63dd8bf91723e3 /includes/controller
parent721aa7f160db36e53d03081bbda73970b702eeb7 (diff)
add basic bootstrap theme
Diffstat (limited to 'includes/controller')
-rw-r--r--includes/controller/angeltypes_controller.php2
-rw-r--r--includes/controller/users_controller.php48
2 files changed, 48 insertions, 2 deletions
diff --git a/includes/controller/angeltypes_controller.php b/includes/controller/angeltypes_controller.php
index 59e55a2d..ba0d65d9 100644
--- a/includes/controller/angeltypes_controller.php
+++ b/includes/controller/angeltypes_controller.php
@@ -149,7 +149,7 @@ function angeltype_edit_controller() {
}
return array(
- isset($angeltype) ? sprintf(_("Edit %s"), $name) : _("Add new angeltype"),
+ sprintf(_("Edit %s"), $name),
AngelType_edit_view($name, $restricted, $description, $coordinator_mode)
);
}
diff --git a/includes/controller/users_controller.php b/includes/controller/users_controller.php
index bf83fa9e..f65f54e3 100644
--- a/includes/controller/users_controller.php
+++ b/includes/controller/users_controller.php
@@ -1,7 +1,53 @@
<?php
/**
- * User password recovery. (By email)
+ * Route user actions.
+ */
+function users_controller() {
+ global $privileges, $user;
+
+ if (! isset($user))
+ redirect(page_link_to(''));
+
+ if (! isset($_REQUEST['action']))
+ $_REQUEST['action'] = 'list';
+
+ switch ($_REQUEST['action']) {
+ default:
+ case 'list':
+ return users_list_controller();
+ case 'view':
+ return user_controller();
+ case 'edit':
+ return user_edit_controller();
+ case 'delete':
+ return user_delete_controller();
+ }
+}
+
+function user_controller() {
+ global $privileges, $user;
+
+ if (isset($_REQUEST['user_id'])) {
+ $user_source = User($_REQUEST['user_id']);
+ } else
+ $user_source = $user;
+
+ $admin_user_privilege = in_array('admin_user', $privileges);
+
+ return array(
+ $user_source['Nick'],
+ User_view($user_source)
+ );
+}
+
+function users_list_controller() {
+ redirect(page_link_to('admin_user'));
+}
+
+/**
+ * User password recovery.
+ * (By email)
*/
function user_password_recovery_controller() {
if (isset($_REQUEST['token'])) {