Skip to content

Switch from nologin to manual to fix issue #13 #14

Closed
wants to merge 1 commit into from
View
6 lib.php
@@ -28,6 +28,10 @@
use moodle\local\ltiprovider as ltiprovider;
+/**
+ * Auth type since nologin sessions are destroyed during session_gc
+ */
+define('LTIPROVIDER_AUTH_TYPE', 'manual');
/**
* Function for backwards compatibility (<2.4)
@@ -60,7 +64,7 @@ function local_ltiprovider_extends_navigation ($nav) {
$coursenode->add(get_string('pluginname', 'local_ltiprovider'), $ltiurl, $nav::TYPE_CONTAINER, null, 'ltiprovider'.$PAGE->course->id);
}
- if (isset($USER) and isset($USER->auth) and $USER->auth == 'nologin' and strpos($USER->username, 'ltiprovider') === 0) {
+ if (isset($USER) and isset($USER->auth) and $USER->auth == LTIPROVIDER_AUTH_TYPE and strpos($USER->username, 'ltiprovider') === 0) {
// Force course or activity navigation
if (isset($SESSION->ltiprovider) and $SESSION->ltiprovider->forcenavigation) {
$context = $SESSION->ltiprovider->context;
View
3 tool.php
@@ -25,6 +25,7 @@
require_once(dirname(__FILE__) . '/../../config.php');
require_once($CFG->dirroot.'/local/ltiprovider/ims-blti/blti.php');
+require_once($CFG->dirroot.'/local/ltiprovider/lib.php');
$toolid = required_param('id', PARAM_INT);
@@ -118,7 +119,7 @@ function user_match($newuser, $olduser) {
if (! $dbuser ) {
$user = new stdClass();
// clean_param , email username text
- $user->auth = 'nologin';
+ $user->auth = LTIPROVIDER_AUTH_TYPE;
$user->username = $username;
$user->password = md5(uniqid(rand(), 1));
populate($user,$context,$tool);
Something went wrong with that request. Please try again.