[LON-CAPA-cvs] cvs: loncom /lti ltiauth.pm
raeburn
raeburn at source.lon-capa.org
Wed May 30 14:06:13 EDT 2018
raeburn Wed May 30 18:06:13 2018 EDT
Modified files:
/loncom/lti ltiauth.pm
Log:
- Bug 6754 LON-CAPA as LTI Provider
- Include value of 1 for $selfenroll arg when calling ltiutils::enrolluser()
so user privs will be added to the user's environment for the new role.
Index: loncom/lti/ltiauth.pm
diff -u loncom/lti/ltiauth.pm:1.13 loncom/lti/ltiauth.pm:1.14
--- loncom/lti/ltiauth.pm:1.13 Mon May 28 23:26:04 2018
+++ loncom/lti/ltiauth.pm Wed May 30 18:06:13 2018
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Basic LTI Authentication Module
#
-# $Id: ltiauth.pm,v 1.13 2018/05/28 23:26:04 raeburn Exp $
+# $Id: ltiauth.pm,v 1.14 2018/05/30 18:06:13 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -57,7 +57,7 @@
}
}
#
-# Retrieve data POSTed by LTI Consumer on launch
+# Retrieve data POSTed by LTI Consumer on launch
#
&Apache::lonacc::get_posted_cgi($r);
my $params = {};
@@ -436,7 +436,8 @@
my (@ltiroles, at lcroles);
my @lcroleorder = ('cc','in','ta','ep','st');
my ($lcrolesref,$ltirolesref) = &LONCAPA::ltiutils::get_lc_roles($params->{'roles'},
- \@lcroleorder);
+ \@lcroleorder,
+ $lti{$itemid}{maproles});
if (ref($lcrolesref) eq 'ARRAY') {
@lcroles = @{$lcrolesref};
}
@@ -661,15 +662,8 @@
my %coursehash = &Apache::lonnet::coursedescription($cdom.'_'.$cnum);
my $start = $coursehash{'default_enrollment_start_date'};
my $end = $coursehash{'default_enrollment_end_date'};
- my $enrollresult = &LONCAPA::ltiutils::enrolluser($role,$cdom,$cnum,$sec,$start,$end);
- if ($enrollresult eq 'ok') {
- my (%userroles,%newrole,%newgroups);
- &Apache::lonnet::standard_roleprivs(\%newrole,$role,$cdom,$spec,$cnum,
- $area);
- &Apache::lonnet::set_userprivs(\%userroles,\%newrole,\%newgroups);
- $userroles{'user.role.'.$spec} = $start.'.'.$end;
- &Apache::lonnet::appenv(\%userroles,[$role,'cm']);
- }
+ $enrollresult = &LONCAPA::ltiutils::enrolluser($udom,$uname,$role,$cdom,$cnum,$sec,
+ $start,$end,1);
}
}
return $enrollresult;
More information about the LON-CAPA-cvs
mailing list