aboutsummaryrefslogtreecommitdiff
path: root/start.php
blob: de7657fab0e2e83ac8dbef6d4ad6a16fbcff0e64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
/*******************************************************************************
 * registrationterms
 *
 * @author Administrator
 ******************************************************************************/

	function registrationterms_init()
	{
		global $CONFIG;

		//put the terms agreement at the very end
		extend_view('register/extend', 'registrationterms/register', 1000);
		
		//block user registration if they don't check the box
		register_plugin_hook('action', 'register', 'registrationterms_register_hook');
	}
	
	function registrationterms_register_hook()
	{
		if (get_input('agreetoterms',false) != 'true') {
			register_error(elgg_echo('agreetoterms:required'));
			forward($_SERVER['HTTP_REFERER']);
		}
	}
	
	register_elgg_event_handler('init', 'system', 'registrationterms_init');
?>