summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2013-01-24 22:27:16 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2013-01-24 22:30:27 +0100
commitc81bbb7f56dbbfab2497ce936036bf53d6a6c1a0 (patch)
treecc566820ef9bbdf0588dbaf4bcd750fc9c37e329
parentde6f8313a068572c56ae1acfef3e68c7fdce2886 (diff)
downloadsqltutor-plugin-c81bbb7f56dbbfab2497ce936036bf53d6a6c1a0.tar.gz
sqltutor-plugin-c81bbb7f56dbbfab2497ce936036bf53d6a6c1a0.tar.bz2
sqltutor-plugin-c81bbb7f56dbbfab2497ce936036bf53d6a6c1a0.zip
Forbid guest-user to do queries
-rw-r--r--sqlbox/view.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/sqlbox/view.php b/sqlbox/view.php
index e522a75..9efe93b 100644
--- a/sqlbox/view.php
+++ b/sqlbox/view.php
@@ -64,6 +64,13 @@ $PAGE->set_focuscontrol('id_sqlbox_query');
echo $OUTPUT->header();
+if (isguestuser()) {
+ echo $OUTPUT->confirm("Guest not allowed, Login?",
+ get_login_url(), new moodle_url('/course/view.php', array('id'=>$course->id)));
+ echo $OUTPUT->footer();
+ exit;
+}
+
if ($sqlbox->intro) { // Conditions to show the intro can change to look for own settings or whatever
echo $OUTPUT->box(format_module_intro('sqlbox', $sqlbox, $cm->id), 'generalbox mod_introbox', 'sqlboxintro');
}