version 1.28, 2018/04/14 01:50:43
|
version 1.32, 2018/05/08 15:44:11
|
Line 88 sub lti_check {
|
Line 88 sub lti_check {
|
if ($data->{'lti.selfenrollrole'}) { |
if ($data->{'lti.selfenrollrole'}) { |
$lti_env{'request.lti.selfenrollrole'} = $data->{'lti.selfenrollrole'}; |
$lti_env{'request.lti.selfenrollrole'} = $data->{'lti.selfenrollrole'}; |
} |
} |
|
if ($data->{'lti.uri'}) { |
|
$lti_env{'request.lti.uri'} = $data->{'lti.uri'}; |
|
} |
|
if ($data->{'lti.target'}) { |
|
$lti_env{'request.lti.target'} = $data->{'lti.target'}; |
|
} |
|
if ($data->{'lti.sourcecrs'}) { |
|
$lti_env{'request.lti.sourcecrs'} = $data->{'lti.sourcecrs'}; |
|
} |
} |
} |
if ($data->{'lti.passbackid'}) { |
if ($data->{'lti.passbackid'}) { |
$lti_env{'request.lti.passbackid'} = $data->{'lti.passbackid'}; |
$lti_env{'request.lti.passbackid'} = $data->{'lti.passbackid'}; |
Line 388 sub handler {
|
Line 397 sub handler {
|
$form{'lti.reqcrs'} = $data{'lti.reqcrs'}; |
$form{'lti.reqcrs'} = $data{'lti.reqcrs'}; |
$form{'lti.reqrole'} = $data{'lti.reqrole'}; |
$form{'lti.reqrole'} = $data{'lti.reqrole'}; |
$form{'lti.sourcecrs'} = $data{'lti.sourcecrs'}; |
$form{'lti.sourcecrs'} = $data{'lti.sourcecrs'}; |
|
$form{'lti.uri'} = $data{'lti.uri'}; |
if ($data{'lti.passbackid'}) { |
if ($data{'lti.passbackid'}) { |
$form{'lti.passbackid'} = $data{'lti.passbackid'}; |
$form{'lti.passbackid'} = $data{'lti.passbackid'}; |
} |
} |
Line 400 sub handler {
|
Line 410 sub handler {
|
if ($data{'lti.rosterurl'}) { |
if ($data{'lti.rosterurl'}) { |
$form{'lti.rosterurl'} = $data{'lti.rosterurl'}; |
$form{'lti.rosterurl'} = $data{'lti.rosterurl'}; |
} |
} |
|
if ($data{'lti.target'}) { |
|
$form{'lti.target'} = $data{'lti.target'}; |
|
} |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |
&Apache::ltiauth::lti_reqcrs($r,$data{'domain'},\%form,$data{'username'},$data{'domain'}); |
&Apache::ltiauth::lti_reqcrs($r,$data{'domain'},\%form,$data{'username'},$data{'domain'}); |
Line 410 sub handler {
|
Line 423 sub handler {
|
delete($lti_env->{'selfenrollrole'}); |
delete($lti_env->{'selfenrollrole'}); |
} |
} |
if ($data{'lti.selfenrollrole'}) { |
if ($data{'lti.selfenrollrole'}) { |
if (&Apache::ltiauth::lti_enroll($data{'username'},data{'domain'}, |
if (&Apache::ltiauth::lti_enroll($data{'username'},$data{'domain'}, |
$data{'lti.selfenrollrole'}) eq 'ok') { |
$data{'lti.selfenrollrole'}) eq 'ok') { |
my $url = '/adm/roles?selectrole=1&'. |
my $url = '/adm/roles?selectrole=1&'. |
&escape($data{'lti.selfenrollrole'}).'=1'; |
&escape($data{'lti.selfenrollrole'}).'=1'; |
Line 473 sub handler {
|
Line 486 sub handler {
|
my $next_url='/adm/roles?selectrole=1&'.&escape($data{'role'}).'=1'; |
my $next_url='/adm/roles?selectrole=1&'.&escape($data{'role'}).'=1'; |
if ($data{'origurl'} ne '') { |
if ($data{'origurl'} ne '') { |
$next_url .= '&orgurl='.&escape($data{'origurl'}); |
$next_url .= '&orgurl='.&escape($data{'origurl'}); |
|
if ($data{'lti.login'}) { |
|
if (($data{'origurl'} =~ m{/default_\d+\.sequence$}) || |
|
($data{'origurl'} =~ m{^/res/.+\.sequence$})) { |
|
$next_url .= '&navmap=1'; |
|
} |
|
} |
} |
} |
&Apache::lonauth::success($r,$data{'username'},$data{'domain'},$home, |
&Apache::lonauth::success($r,$data{'username'},$data{'domain'},$home, |
$next_url,$extra_env,\%form); |
$next_url,$extra_env,\%form); |