--- loncom/cgi/lonmodulecheck.pl 2013/02/02 00:22:34 1.1 +++ loncom/cgi/lonmodulecheck.pl 2014/05/10 13:58:15 1.5 @@ -3,7 +3,7 @@ $|=1; # Compares checksums for most installed files with expected values # and reports discrepancies. # -# $Id: lonmodulecheck.pl,v 1.1 2013/02/02 00:22:34 raeburn Exp $ +# $Id: lonmodulecheck.pl,v 1.5 2014/05/10 13:58:15 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -37,6 +37,7 @@ use LONCAPA::Configuration(); use LONCAPA::loncgi(); use LONCAPA::lonauthcgi(); use LONCAPA::Checksumming(); +use LONCAPA; my $perlvar=&LONCAPA::Configuration::read_conf('loncapa.conf'); my ($londaemons,$lonlib,$lonincludes,$lontabdir,$lonhost); @@ -57,7 +58,9 @@ if ($londaemons ne '' && $lonlib ne '' & sub main { my ($londaemons,$lonlib,$lonincludes,$lontabdir,$lonhost) = @_; - if (!&LONCAPA::lonauthcgi::check_ipbased_access('checksums')) { + if (&LONCAPA::lonauthcgi::check_ipbased_access('checksums')) { + &LONCAPA::loncgi::check_cookie_and_load_env(); + } else { if (!&LONCAPA::loncgi::check_cookie_and_load_env()) { &Apache::lonlocal::get_language_handle(); print(&LONCAPA::loncgi::missing_cookie_msg()); @@ -71,7 +74,6 @@ sub main { } } - &Apache::lonlocal::get_language_handle(); &print_differences($londaemons,$lonlib,$lonincludes,$lontabdir,$lonhost); return; } @@ -79,22 +81,20 @@ sub main { sub print_differences { my ($londaemons,$lonlib,$lonincludes,$lontabdir,$lonhost) = @_; my $machine_dom = &Apache::lonnet::host_domain($lonhost); - my $loncaparev = &Apache::lonnet::get_server_loncaparev($machine_dom); + my $loncaparev = &Apache::lonnet::get_server_loncaparev($machine_dom,$lonhost); my ($version,$timestamp) = split(/\-/,$loncaparev); - print(&Apache::loncommon::start_page('LON-CAPA code integrity checking')); + &Apache::lonlocal::get_language_handle(); + print(&Apache::loncommon::start_page('Code integrity check')); if ($loncaparev =~ /CVS_HEAD/) { - print(&Apache::lonlocal::mt('Code checking unavailable for LON-CAPA CVS HEAD'). - "\n"); + print('

'. + &Apache::lonlocal::mt('Code checking unavailable for LON-CAPA CVS HEAD'). + '

'); } else { - print('

'. - &Apache::lonlocal::mt('Code integrity check -- LONCAPA version: [_1]', + print('

'. + &Apache::lonlocal::mt('Code integrity check -- LON-CAPA version: [_1]', $version). - '

'); - my $distro; - if (open(my $disth,"$londaemons/distprobe |")) { - $distro = <$disth>; - close($disth); - } + ''); + my $distro = &LONCAPA::distro(); if ($distro) { my ($serversums,$serverversions) = &LONCAPA::Checksumming::get_checksums($distro,$londaemons,$lonlib,