Diff for /loncom/auth/lonstatusacc.pm between versions 1.1 and 1.4

version 1.1, 2008/11/28 19:38:11 version 1.4, 2008/12/25 01:52:56
Line 31 Line 31
 package Apache::lonstatusacc;  package Apache::lonstatusacc;
   
 use strict;  use strict;
 use Apache::Constants qw(:common :remotehost);  use Apache::Constants qw(:common :http :remotehost);
 use Apache::lonnet;  use Apache::lonnet;
 use LONCAPA::loncgi;  use LONCAPA::loncgi;
   use LONCAPA::lonauthcgi;
   
 sub handler {  sub handler {
     my $r = shift;      my $r = shift;
     my $reqhost = $r->get_remote_host(REMOTE_NOLOOKUP);      my $reqhost = $r->get_remote_host(REMOTE_NOLOOKUP);
     my $page = 'serverstatus';      my $page = 'serverstatus';
     if ($r->uri eq '/adm/test') {      if (($r->uri eq '/adm/domainstatus') ||
         $page = 'showenv';          ($r->uri eq '/adm/test')) {
         if (&LONCAPA::loncgi::check_cookie_and_load_env()) {          if (&LONCAPA::loncgi::check_cookie_and_load_env($r)) {
             if (&LONCAPA::loncgi::can_view($page)) {              if ($r->uri eq '/adm/domainstatus') {
                 return OK;   
             } elsif (&LONCAPA::loncgi::check_ipbased_access($page,$reqhost)) {  
                 return OK;                  return OK;
               } elsif ($r->uri eq '/adm/test') { 
                   $page = 'showenv'; 
                   if (&LONCAPA::lonauthcgi::can_view($page)) {
                       return OK; 
                   } elsif (&LONCAPA::lonauthcgi::check_ipbased_access($page,$reqhost)) {
                       return OK;
                   } else {
                       $Apache::lonnet::env{'user.error.msg'} =
                           $r->uri.":bre:1:1:Access Denied";
                       return HTTP_NOT_ACCEPTABLE;
                   }
             }              }
           } else {
               return FORBIDDEN;
         }          }
     } elsif ($r->uri ne '/server-status') {      } elsif ($r->uri ne '/server-status') {
         $page = 'lonstatus';          $page = 'lonstatus';
Line 70  sub handler { Line 82  sub handler {
                 }                  }
             }              }
         }          }
     } elsif (&LONCAPA::loncgi::check_ipbased_access($page,$reqhost)) {      } elsif (&LONCAPA::lonauthcgi::check_ipbased_access($page,$reqhost)) {
         return OK;          return OK;
     } else {      } else {
         if (&LONCAPA::loncgi::check_cookie_and_load_env($page)) {          if (&LONCAPA::loncgi::check_cookie_and_load_env($r)) {
             if (&LONCAPA::loncgi::can_view($page)) {              if (&LONCAPA::lonauthcgi::can_view($page)) {
                 return OK;                  return OK;
             }              }
         }          }

Removed from v.1.1  
changed lines
  Added in v.1.4


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>