Merge branch 'MDL-56822-master' of git://github.com/cameron1729/moodle
authorAndrew Nicols <andrew@nicols.co.uk>
Thu, 17 Nov 2016 06:33:39 +0000 (14:33 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Thu, 17 Nov 2016 06:33:39 +0000 (14:33 +0800)
1  2 
message/output/popup/lib.php

@@@ -35,7 -35,8 +35,8 @@@ function message_popup_render_navbar_ou
  
      // Early bail out conditions.
      if (!isloggedin() || isguestuser() || user_not_fully_set_up($USER) ||
-         get_user_preferences('auth_forcepasswordchange')) {
+         get_user_preferences('auth_forcepasswordchange') ||
+         (!$USER->policyagreed && $CFG->sitepolicy)) {
          return '';
      }
  
@@@ -46,8 -47,6 +47,8 @@@
          $context = [
              'userid' => $USER->id,
              'urls' => [
 +                'seeall' => (new moodle_url('/message/index.php'))->out(),
 +                'writeamessage' => (new moodle_url('/message/index.php', ['contactsfirst' => 1]))->out(),
                  'preferences' => (new moodle_url('/message/edit.php', ['id' => $USER->id]))->out(),
              ],
          ];