Skip to content

Commit

Permalink
Collab: Forum/blog/wiki confirm logged in resets session #122418
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-platts authored and sammarshallou committed Jun 10, 2016
1 parent a7a68ab commit a8709e1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion confirmloggedin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
2 changes: 1 addition & 1 deletion module.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a8709e1

Please sign in to comment.