From d04d6bcbec703d609a4bccc64d09b95dbdd76adb Mon Sep 17 00:00:00 2001 From: skodak Date: Tue, 3 Apr 2007 09:51:53 +0000 Subject: [PATCH] MDL-9190 Site policy xhtml compliance and other minor fixes; merged from MOODLE_18_STABLE --- theme/standard/styles_layout.css | 14 ++++++++++++++ user/policy.php | 26 +++++++++++++++----------- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/theme/standard/styles_layout.css b/theme/standard/styles_layout.css index d2b8570dbf..7922a11f6e 100644 --- a/theme/standard/styles_layout.css +++ b/theme/standard/styles_layout.css @@ -2549,6 +2549,20 @@ body#user-index .rolesform { text-align:center; } +#user-policy .noticebox { + text-align:center; + margin-left:auto; + margin-right:auto; + margin-bottom:10px; + width:80%; + height:250px; +} + +#user-policy #policyframe { + width:100%; + height:100%; +} + /*** *** Modules: Assignment ***/ diff --git a/user/policy.php b/user/policy.php index 0519883c66..bc4c83f062 100644 --- a/user/policy.php +++ b/user/policy.php @@ -1,18 +1,18 @@ libdir.'/filelib.php'); - $agree = optional_param('agree', 0, PARAM_INT); + $agree = optional_param('agree', 0, PARAM_BOOL); define('MESSAGE_WINDOW', true); // This prevents the message window coming up - - if (empty($USER->id)) { + if (!isloggedin()) { require_login(); } - if ($agree == 1 and confirm_sesskey()) { // User has agreed - if ($USER->username != 'guest') { // Don't remember guests + if ($agree and confirm_sesskey()) { // User has agreed + if (!isguestuser()) { // Don't remember guests if (!set_field('user', 'policyagreed', 1, 'id', $USER->id)) { error('Could not save your agreement'); } @@ -37,14 +37,18 @@ print_heading($strpolicyagreement); - echo '
'; - echo ''; - echo '
'; + echo ''; - notice_yesno($strpolicyagree, "policy.php?agree=1&sesskey=$USER->sesskey", $CFG->wwwroot); + $linkyes = 'policy.php'; + $optionsyes = array('agree'=>1, 'sesskey'=>sesskey()); + $linkno = $CFG->wwwroot.'/login/logout.php'; + $optionsno = array('sesskey'=>sesskey()); + notice_yesno($strpolicyagree, $linkyes, $linkno, $optionsyes, $optionsno); print_footer(); -- 2.39.5