version 1.1382, 2018/08/14 18:29:33
|
version 1.1387, 2018/11/01 04:33:11
|
Line 230 sub get_server_distarch {
|
Line 230 sub get_server_distarch {
|
} |
} |
|
|
sub get_servercerts_info { |
sub get_servercerts_info { |
my ($lonhost,$context) = @_; |
my ($lonhost,$hostname,$context) = @_; |
|
return if ($lonhost eq ''); |
|
if ($hostname eq '') { |
|
$hostname = &hostname($lonhost); |
|
} |
|
return if ($hostname eq ''); |
my ($rep,$uselocal); |
my ($rep,$uselocal); |
if (grep { $_ eq $lonhost } ¤t_machine_ids()) { |
if (context eq 'install') { |
|
$uselocal = 1; |
|
} elsif (grep { $_ eq $lonhost } ¤t_machine_ids()) { |
$uselocal = 1; |
$uselocal = 1; |
} |
} |
if (($context ne 'cgi') && ($uselocal)) { |
if (($context ne 'cgi') && ($context ne 'install') && ($uselocal)) { |
my $distro = (split(/\:/,&get_server_distarch($lonhost)))[0]; |
my $distro = (split(/\:/,&get_server_distarch($lonhost)))[0]; |
if ($distro eq '') { |
if ($distro eq '') { |
$uselocal = 0; |
$uselocal = 0; |
Line 250 sub get_servercerts_info {
|
Line 257 sub get_servercerts_info {
|
} |
} |
} |
} |
if ($uselocal) { |
if ($uselocal) { |
$rep = LONCAPA::Lond::server_certs(\%perlvar); |
$rep = LONCAPA::Lond::server_certs(\%perlvar,$lonhost,$hostname); |
} else { |
} else { |
$rep=&reply('servercerts',$lonhost); |
$rep=&reply('servercerts',$lonhost); |
} |
} |
my ($result,%returnhash); |
my ($result,%returnhash); |
if (defined($lonhost)) { |
|
if (!defined(&hostname($lonhost))) { |
|
return; |
|
} |
|
} |
|
if (($rep=~/^(refused|rejected|error)/) || ($rep eq 'con_lost') || |
if (($rep=~/^(refused|rejected|error)/) || ($rep eq 'con_lost') || |
($rep eq 'unknown_cmd')) { |
($rep eq 'unknown_cmd')) { |
$result = $rep; |
$result = $rep; |
Line 3197 sub ssi {
|
Line 3199 sub ssi {
|
|
|
$request->header(Cookie => $ENV{'HTTP_COOKIE'}); |
$request->header(Cookie => $ENV{'HTTP_COOKIE'}); |
my $lonhost = $perlvar{'lonHostID'}; |
my $lonhost = $perlvar{'lonHostID'}; |
my $response= &LONCAPA::LWPReq::makerequest($lonhost,$request,'',\%perlvar); |
my $islocal; |
|
if (($env{'request.course.id'}) && |
|
($form{'grade_courseid'} eq $env{'request.course.id'}) && |
|
($form{'grade_username'} ne '') && ($form{'grade_domain'} ne '') && |
|
($form{'grade_symb'} ne '') && |
|
(&Apache::lonnet::allowed('mgr',$env{'request.course.id'}. |
|
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'')))) { |
|
$islocal = 1; |
|
} |
|
my $response= &LONCAPA::LWPReq::makerequest($lonhost,$request,'',\%perlvar, |
|
'','','',$islocal); |
|
|
if (wantarray) { |
if (wantarray) { |
return ($response->content, $response); |
return ($response->content, $response); |
Line 5231 sub set_first_access {
|
Line 5243 sub set_first_access {
|
} |
} |
$cachedkey=''; |
$cachedkey=''; |
my $firstaccess=&get_first_access($type,$symb,$map); |
my $firstaccess=&get_first_access($type,$symb,$map); |
if (!$firstaccess) { |
if ($firstaccess) { |
|
&logthis("First access time already set ($firstaccess) when attempting ". |
|
"to set new value (type: $type, extent: $res) for $uname:$udom ". |
|
"in $courseid"); |
|
return 'already_set'; |
|
} else { |
my $start = time; |
my $start = time; |
my $putres = &put('firstaccesstimes',{"$courseid\0$res"=>$start}, |
my $putres = &put('firstaccesstimes',{"$courseid\0$res"=>$start}, |
$udom,$uname); |
$udom,$uname); |
Line 5247 sub set_first_access {
|
Line 5264 sub set_first_access {
|
if (($cachedtime) && (abs($start-$cachedtime) < 5)) { |
if (($cachedtime) && (abs($start-$cachedtime) < 5)) { |
$cachedtimes{"$courseid\0$res"} = $start; |
$cachedtimes{"$courseid\0$res"} = $start; |
} |
} |
|
} elsif ($putres ne 'refused') { |
|
&logthis("Result: $putres when attempting to set first access time ". |
|
"(type: $type, extent: $res) for $uname:$udom in $courseid"); |
} |
} |
return $putres; |
return $putres; |
} |
} |