]> git.mjollnir.org Git - moodle.git/commitdiff
Add a warning that require_capabiliy can only be used before output is started.
authortjhunt <tjhunt>
Sat, 4 Jul 2009 14:22:11 +0000 (14:22 +0000)
committertjhunt <tjhunt>
Sat, 4 Jul 2009 14:22:11 +0000 (14:22 +0000)
lib/accesslib.php

index afaf568e28d774d51830c2b243c6b6dc602fb073..c4296104d4295e2d772d48d57ef4fe8717b3e131 100755 (executable)
@@ -1049,6 +1049,10 @@ function aggregate_roles_from_accessdata($context, $accessdata) {
  * This is an easy to use function, combining has_capability() with require_course_login().
  * And will call those where needed.
  *
+ * NOTE becuase this function calls require_login, and becuase require_login tries
+ * to initialise $PAGE->course, and the themes, you will get an exception if you
+ * try to call require_login after output has started, so don't do that.
+ *
  * It checks for a capability assertion being true.  If it isn't
  * then the page is terminated neatly with a standard error message.
  *