3 require_once("../config.php");
5 $agree = optional_param('agree', 0, PARAM_INT
);
7 define('MESSAGE_WINDOW', true); // This prevents the message window coming up
10 if (!isset($USER->id
)) {
14 if ($agree == 1 and confirm_sesskey()) { // User has agreed
15 if ($USER->username
!= 'guest') { // Don't remember guests
16 if (!set_field('user', 'policyagreed', 1, 'id', $USER->id
)) {
17 error('Could not save your agreement');
20 $USER->policyagreed
= 1;
22 if (!empty($SESSION->wantsurl
)) {
23 $wantsurl = $SESSION->wantsurl
;
24 unset($SESSION->wantsurl
);
27 redirect($CFG->wwwroot
.'/');
32 $strpolicyagree = get_string('policyagree');
33 $strpolicyagreement = get_string('policyagreement');
34 $strpolicyagreementclick = get_string('policyagreementclick');
36 print_header($strpolicyagreement, $SITE->fullname
, $strpolicyagreement);
38 print_heading($strpolicyagreement);
41 echo '<iframe width="90%" height="70%" src="'.$CFG->sitepolicy
.'">';
42 echo link_to_popup_window ($CFG->sitepolicy
, 'agreement', $strpolicyagreementclick,
43 500, 500, 'Popup window', 'none', true);
47 notice_yesno($strpolicyagree, "policy.php?agree=1&sesskey=$USER->sesskey", $CFG->wwwroot
);