diff --git a/confirmloggedin.php b/confirmloggedin.php index 4987ca8..f77b349 100644 --- a/confirmloggedin.php +++ b/confirmloggedin.php @@ -31,7 +31,11 @@ try { // Test session - These functions throw exceptions so trap and exit if they fail. // This saves 404 errors and sends a smaller page. - require_login(null, true); + $contextid = required_param('contextid', PARAM_INT); + list($context, $course, $cm) = get_context_info_array($contextid); + $PAGE->set_url('/mod/ouwiki/confirmloggedin.php'); + $PAGE->set_context($context); + require_login($course, false, $cm); require_sesskey(); } catch (moodle_exception $e) { $pid = 0; diff --git a/edit.php b/edit.php index bf2d781..add8f99 100644 --- a/edit.php +++ b/edit.php @@ -488,7 +488,7 @@ 'requires' => array('base', 'event', 'io', 'node', 'anim', 'moodle-core-notification-alert', 'button'), 'strings' => $stringlist ); -$PAGE->requires->js_init_call('M.mod_ouwiki_edit.init', null, true, $jsmodule); +$PAGE->requires->js_init_call('M.mod_ouwiki_edit.init', array($context->id), true, $jsmodule); // Footer ouwiki_print_footer($course, $cm, $subwiki, $pagename); diff --git a/module.js b/module.js index 916926e..384ae3c 100644 --- a/module.js +++ b/module.js @@ -525,7 +525,7 @@ M.mod_ouwiki_edit = { } var cfg = { method: 'POST', - data: 'sesskey=' + M.cfg.sesskey, + data: 'sesskey=' + M.cfg.sesskey + '&contextid=' + args, on: { success: checksave, failure: savefail