aboutsummaryrefslogtreecommitdiff
path: root/mod/guidtool/actions/delete.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/guidtool/actions/delete.php')
-rw-r--r--mod/guidtool/actions/delete.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/mod/guidtool/actions/delete.php b/mod/guidtool/actions/delete.php
new file mode 100644
index 000000000..36126ee10
--- /dev/null
+++ b/mod/guidtool/actions/delete.php
@@ -0,0 +1,21 @@
+<?php
+ global $CONFIG;
+
+ admin_gatekeeper();
+ action_gatekeeper();
+
+ $guid = (int)get_input('guid');
+ $entity = get_entity($guid);
+
+ if ($entity)
+ {
+ if ($entity->delete())
+ system_message(sprintf(elgg_echo('guidtool:deleted'), $guid));
+ else
+ register_error(sprintf(elgg_echo('guidtool:notdeleted'), $guid));
+ }
+ else
+ register_error(sprintf(elgg_echo('guidtool:notdeleted'), $guid));
+
+ forward($_SERVER['HTTP_REFERER']);
+?> \ No newline at end of file