aboutsummaryrefslogtreecommitdiff
path: root/mod/registrationterms/start.php
blob: 3c42aa14a73ccd896e0f0b379cff88da8638a073 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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');