aboutsummaryrefslogtreecommitdiff
path: root/mod/registrationterms/start.php
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2013-11-09 16:18:26 +0100
committerSem <sembrestels@riseup.net>2013-11-09 16:18:26 +0100
commited6d980dcb06a66e1746fe4959aa138c39fb4e9e (patch)
treea018c2f31e0abbc543f97edf9d0337ebaf648a41 /mod/registrationterms/start.php
parent6834f913fe7ce7d4274a9757661589e9a222b71c (diff)
parente586807b4e6ace77d53b3195ca4fa13ab62d4a09 (diff)
downloadelgg-ed6d980dcb06a66e1746fe4959aa138c39fb4e9e.tar.gz
elgg-ed6d980dcb06a66e1746fe4959aa138c39fb4e9e.tar.bz2
Add 'mod/registrationterms/' from commit 'e586807b4e6ace77d53b3195ca4fa13ab62d4a09'
git-subtree-dir: mod/registrationterms git-subtree-mainline: 6834f913fe7ce7d4274a9757661589e9a222b71c git-subtree-split: e586807b4e6ace77d53b3195ca4fa13ab62d4a09
Diffstat (limited to 'mod/registrationterms/start.php')
-rw-r--r--mod/registrationterms/start.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/mod/registrationterms/start.php b/mod/registrationterms/start.php
new file mode 100644
index 000000000..3c42aa14a
--- /dev/null
+++ b/mod/registrationterms/start.php
@@ -0,0 +1,18 @@
+<?php
+
+function registrationterms_init() {
+ //put the terms agreement at the very end
+ elgg_extend_view('register/extend', 'registrationterms/register', 1000);
+
+ //block user registration if they don't check the box
+ elgg_register_plugin_hook_handler('action', 'register', 'registrationterms_register_hook');
+}
+
+function registrationterms_register_hook() {
+ if (get_input('agreetoterms', false) != 'true') {
+ register_error(elgg_echo('registrationterms:required'));
+ forward(REFERER);
+ }
+}
+
+elgg_register_event_handler('init', 'system', 'registrationterms_init');