version 1.6, 2007/04/17 23:18:42
|
version 1.7, 2008/11/28 20:50:25
|
Line 30 $|=1;
|
Line 30 $|=1;
|
|
|
use lib '/home/httpd/lib/perl/'; |
use lib '/home/httpd/lib/perl/'; |
use Apache::lonnet; |
use Apache::lonnet; |
|
use LONCAPA::loncgi; |
|
|
my $testhost=$ENV{'QUERY_STRING'}; |
print("Content-type: text/plain\n\n"); |
$testhost=~s/\W//g; |
|
|
|
print("Content-type: text/plain\n\n". |
&main(); |
&Apache::lonnet::reply('ping',$testhost)."\n"); |
|
|
sub main { |
|
if (!&LONCAPA::loncgi::check_ipbased_access('ping')) { |
|
if (!&LONCAPA::loncgi::check_cookie_and_load_env()) { |
|
return; |
|
} |
|
|
|
if (!&LONCAPA::loncgi::can_view('ping')) { |
|
return; |
|
} |
|
} |
|
|
|
my $testhost=$ENV{'QUERY_STRING'}; |
|
$testhost=~s/\W//g; |
|
|
|
print &Apache::lonnet::reply('ping',$testhost)."\n"; |
|
return; |
|
} |