Skip to content
Browse files

moodlelib: MDL-20702 New require_sesskey function.

Backported from head.
  • Loading branch information...
1 parent dff5e4d commit 2fb0138721d5eb746919cd87ff93a9b38feee906 @timhunt timhunt committed Nov 2, 2009
Showing with 10 additions and 0 deletions.
  1. +10 −0 lib/moodlelib.php
View
10 lib/moodlelib.php
@@ -1604,6 +1604,16 @@ function confirm_sesskey($sesskey=NULL) {
}
/**
+ * Check the session key using {@link confirm_sesskey()},
+ * and cause a fatal error if it does not match.
+ */
+function require_sesskey() {
+ if (!confirm_sesskey()) {
+ print_error('invalidsesskey');
+ }
+}
+
+/**
* Setup all global $CFG course variables, set locale and also themes
* This function can be used on pages that do not require login instead of require_login()
*

0 comments on commit 2fb0138

Please sign in to comment.
Something went wrong with that request. Please try again.