version 1.6, 2018/04/14 02:30:07
|
version 1.9, 2018/05/15 04:33:17
|
Line 324 sub sign_params {
|
Line 324 sub sign_params {
|
if ($sigmethod eq '') { |
if ($sigmethod eq '') { |
$sigmethod = 'HMAC-SHA1'; |
$sigmethod = 'HMAC-SHA1'; |
} |
} |
|
srand( time() ^ ($$ + ($$ << 15)) ); # Seed rand. |
my $nonce = Digest::SHA::sha1_hex(sprintf("%06x%06x",rand(0xfffff0),rand(0xfffff0))); |
my $nonce = Digest::SHA::sha1_hex(sprintf("%06x%06x",rand(0xfffff0),rand(0xfffff0))); |
my $request = Net::OAuth->request("request token")->new( |
my $request = Net::OAuth->request("request token")->new( |
consumer_key => $key, |
consumer_key => $key, |
Line 481 sub lti_provider_scope {
|
Line 482 sub lti_provider_scope {
|
$scope = 'map'; |
$scope = 'map'; |
$realuri = $tail; |
$realuri = $tail; |
} else { |
} else { |
$scope = 'resource'; |
|
my ($map,$resid,$url) = &Apache::lonnet::decode_symb($tail); |
my ($map,$resid,$url) = &Apache::lonnet::decode_symb($tail); |
$realuri = &Apache::lonnet::clutter($url); |
$realuri = &Apache::lonnet::clutter($url); |
if (($url =~ /\.sequence$/) && |
if ($url =~ /\.sequence$/) { |
($env{'course.'.$env{'request.course.id'}.'.type'} ne 'Placement')) { |
$scope = 'map'; |
$realuri .= '?navmap=1'; |
|
} else { |
} else { |
|
$scope = 'resource'; |
|
$realuri .= '?symb='.$tail; |
|
} |
|
} |
|
} elsif ($tail =~ m{^/res/$match_domain/$match_username/.+\.(?:sequence|page)(|___\d+___.+)$}) { |
|
my $rest = $1; |
|
if ($rest eq '') { |
|
$scope = 'map'; |
|
$realuri = $tail; |
|
} else { |
|
my ($map,$resid,$url) = &Apache::lonnet::decode_symb($tail); |
|
$realuri = &Apache::lonnet::clutter($url); |
|
if ($url =~ /\.sequence$/) { |
|
$scope = 'map'; |
|
} else { |
|
$scope = 'resource'; |
$realuri .= '?symb='.$tail; |
$realuri .= '?symb='.$tail; |
} |
} |
} |
} |
Line 516 sub lti_provider_scope {
|
Line 531 sub lti_provider_scope {
|
if ((&Apache::lonnet::EXT('resource.0.encrypturl',$symb) =~ /^yes$/i) && |
if ((&Apache::lonnet::EXT('resource.0.encrypturl',$symb) =~ /^yes$/i) && |
(!$env{'request.role.adv'})) { |
(!$env{'request.role.adv'})) { |
$realuri = &Apache::lonenc::encrypted(&Apache::lonnet::clutter($url)); |
$realuri = &Apache::lonenc::encrypted(&Apache::lonnet::clutter($url)); |
if (($url =~ /\.sequence$/) && |
if ($scope eq 'resource') { |
($env{'course.'.$env{'request.course.id'}.'.type'} ne 'Placement')) { |
|
$realuri .= '?navmap=1'; |
|
} else { |
|
$realuri .= '?symb='.&Apache::lonenc::encrypted($symb); |
$realuri .= '?symb='.&Apache::lonenc::encrypted($symb); |
} |
} |
} else { |
} else { |
$realuri = &Apache::lonnet::clutter($url); |
$realuri = &Apache::lonnet::clutter($url); |
if (($url =~ /\.sequence$/) && |
if ($scope eq 'resource') { |
($env{'course.'.$env{'request.course.id'}.'.type'} ne 'Placement')) { |
|
$realuri .= '?navmap=1'; |
|
} else { |
|
$realuri .= '?symb='.$symb; |
$realuri .= '?symb='.$symb; |
} |
} |
} |
} |