--- loncom/auth/lonstatusacc.pm 2008/12/22 21:13:19 1.3 +++ loncom/auth/lonstatusacc.pm 2009/01/15 21:01:37 1.6 @@ -1,7 +1,7 @@ # # LON-CAPA authorization for pages generated by server-status reports # -# $Id: lonstatusacc.pm,v 1.3 2008/12/22 21:13:19 raeburn Exp $ +# $Id: lonstatusacc.pm,v 1.6 2009/01/15 21:01:37 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -34,11 +34,12 @@ use strict; use Apache::Constants qw(:common :http :remotehost); use Apache::lonnet; use LONCAPA::loncgi; +use LONCAPA::lonauthcgi; sub handler { my $r = shift; my $reqhost = $r->get_remote_host(REMOTE_NOLOOKUP); - my $page = 'serverstatus'; + my $page = 'server-status'; if (($r->uri eq '/adm/domainstatus') || ($r->uri eq '/adm/test')) { if (&LONCAPA::loncgi::check_cookie_and_load_env($r)) { @@ -46,9 +47,9 @@ sub handler { return OK; } elsif ($r->uri eq '/adm/test') { $page = 'showenv'; - if (&LONCAPA::loncgi::can_view($page)) { + if (&LONCAPA::lonauthcgi::can_view($page)) { return OK; - } elsif (&LONCAPA::loncgi::check_ipbased_access($page,$reqhost)) { + } elsif (&LONCAPA::lonauthcgi::check_ipbased_access($page,$reqhost)) { return OK; } else { $Apache::lonnet::env{'user.error.msg'} = @@ -81,13 +82,13 @@ sub handler { } } } - } elsif (&LONCAPA::loncgi::check_ipbased_access($page,$reqhost)) { + } + if (&LONCAPA::lonauthcgi::check_ipbased_access($page,$reqhost)) { return OK; - } else { - if (&LONCAPA::loncgi::check_cookie_and_load_env($r)) { - if (&LONCAPA::loncgi::can_view($page)) { - return OK; - } + } + if (&LONCAPA::loncgi::check_cookie_and_load_env($r)) { + if (&LONCAPA::lonauthcgi::can_view($page)) { + return OK; } } $r->log_reason("Invalid request for server status from $reqhost",