mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
027a160469
If the admin specifies a Policy Agreement (via URL in the config variables) then each user is required to see and agree to that document once before continuing. To get everyone to see it again (on an update, say) one just needs to issue: UPDATE user SET policyagreed = 0
41 lines
1.2 KiB
PHP
41 lines
1.2 KiB
PHP
<?php // $Id$
|
|
|
|
require_once("../config.php");
|
|
|
|
optional_param('agree', 0, PARAM_INT);
|
|
|
|
|
|
if (!isset($USER->id)) {
|
|
require_login();
|
|
}
|
|
|
|
if ($agree == 1 and confirm_sesskey()) { // User has agreed
|
|
if (!set_field('user', 'policyagreed', 1, 'id', $USER->id)) {
|
|
error('Could not save your agreement');
|
|
}
|
|
$USER->policyagreed = 1;
|
|
redirect($CFG->wwwroot);
|
|
exit;
|
|
}
|
|
|
|
$strpolicyagree = get_string('policyagree');
|
|
$strpolicyagreement = get_string('policyagreement');
|
|
$strpolicyagreementclick = get_string('policyagreementclick');
|
|
|
|
print_header($strpolicyagreement, $SITE->fullname, $strpolicyagreement);
|
|
|
|
print_heading($strpolicyagreement);
|
|
|
|
echo '<center>';
|
|
echo '<iframe align="center" width="80%" height="70%" src="'.$CFG->sitepolicy.'" />';
|
|
echo link_to_popup_window ($CFG->sitepolicy, 'agreement', $strpolicyagreementclick,
|
|
500, 500, 'Popup window', 'none', true);
|
|
echo '</iframe>';
|
|
echo '</center>';
|
|
|
|
notice_yesno($strpolicyagree, "policy.php?agree=1&sesskey=$USER->sesskey", $CFG->wwwroot);
|
|
|
|
print_footer();
|
|
|
|
?>
|