Diff for /loncom/publisher/lonunauthorized.pm between versions 1.1 and 1.10

version 1.1, 2002/09/10 14:41:05 version 1.10, 2011/06/07 18:05:08
Line 33  use Apache::Constants qw(:common); Line 33  use Apache::Constants qw(:common);
 use Apache::loncommon;  use Apache::loncommon;
 use Apache::lonnet;  use Apache::lonnet;
 use Apache::loncacc;  use Apache::loncacc;
   use Apache::lonlocal;
   use LONCAPA();
   
 sub handler {  sub handler {
     my $r = shift;      my $r = shift;
     $r->content_type('text/html');      &Apache::loncommon::content_type($r,'text/html');
     $r->send_http_header;      $r->send_http_header;
     return OK if $r->header_only;      return OK if $r->header_only;
   
 # ------------------------------------------------------------ Print the screen  # ------------------------------------------------------------ Print the screen
     $r->print(<<ENDDOCUMENT);  
 <html>  
 <head>  
 <title>The LearningOnline Network with CAPA</title>  
 </head>  
 ENDDOCUMENT  
 # Figure out who the user is and what they wanted to access  # Figure out who the user is and what they wanted to access
   
     my ($ownername,$ownerdomain)=      my ($ownername,$ownerdomain)=
      &Apache::loncacc::constructaccess($ENV{'request.editurl'},$r->dir_config('lonDefDomain'));       &Apache::loncacc::constructaccess($env{'request.editurl'},$r->dir_config('lonDefDomain'));
 # print header  # print header
     $r->print(&Apache::loncommon::bodytag      $r->print(&Apache::loncommon::start_page("Failed Access to Construction Space",
            ("Failed Access to Construction Space",'','','',$ownerdomain));       undef,
        {'domain' => $ownerdomain,}));
 # figure out what went wrong  # figure out what went wrong
   
     if ($ownerdomain) {      if ($ownerdomain) {
  $r->print('<h1>Choose another server</h1>'.   $r->print('<p class="LC_error">'
  "<p>The constuction space for this resource is located on another server.</p>"                   .&mt('The construction space for this resource is located on another server.')
         );                   .'</p>'
                    .'<p>'
                    .&mt('Choose another server.')
                    .'</p>');
         my $ownerhome=&Apache::lonnet::homeserver($ownername,$ownerdomain);          my $ownerhome=&Apache::lonnet::homeserver($ownername,$ownerdomain);
         unless ($ownerhome eq 'no_host') {          unless ($ownerhome eq 'no_host') {
     $r->print(      $r->print('<p>'
  "<p>Please log into <tt>".$Apache::lonnet::hostname{$ownerhome}.                       .&mt('Please log into [_1] to edit.'
  "</tt> to edit.</p>");                           ,'<tt>'.&Apache::lonnet::hostname($ownerhome).'</tt>')
                        .'</p>');
         }          }
       } elsif (!$env{'request.editurl'}) {
           $r->print('<p class="LC_error">'
                    .&mt('There may be a problem with the filename, e.g., you may be attempting to edit a versioned file (files in construction may not include a version number in front of the extension).')
                    .'</p>');
     } else {      } else {
         $r->print(          $r->print('<p class="LC_error">'
             "<h1>You do not have authoring privileges for this resource</h1>");                   .&mt('You do not have authoring privileges for this resource')
         my ($realownername)=($ENV{'request.editurl'}=~/\/(?:\~|priv\/|home\/)(\w+)/);                   .'</p>');
           my ($realownername)=
       ($env{'request.editurl'}=~m{/(?:~|priv/|home/)($LONCAPA::username_re)});
         my $realownerhome=          my $realownerhome=
       &Apache::lonnet::homeserver(      &Apache::lonnet::homeserver($realownername,
         $realownername,$r->dir_config('lonDefDomain'));   $r->dir_config('lonDefDomain'));
         unless ($realownerhome eq 'no_host') {          unless ($realownerhome eq 'no_host') {
            $r->print("<p>Contact ".              my $plainname=&Apache::loncommon::plainname($realownername,$r->dir_config('lonDefDomain'));
     &Apache::loncommon::aboutmewrapper(              my $user=$realownername.':'.$r->dir_config('lonDefDomain');
      &Apache::loncommon::plainname($realownername,              my $userlink=&Apache::loncommon::aboutmewrapper(
                                $r->dir_config('lonDefDomain')).'('.                               $plainname.' ('.$user.')'
                                $realownername.' at '.                              ,$realownername
                                $r->dir_config('lonDefDomain').')',                              ,$r->dir_config('lonDefDomain'));
        $realownername,$r->dir_config('lonDefDomain')).      $r->print('<p>'
            ' for access.');                       .&mt('Contact [_1] for access.',$userlink)
                        .'</p>');
         }          }
     }      }
           
     $r->print('</body></html>');      $r->print(&Apache::loncommon::end_page());
     return OK;      return OK;
 }   } 
   

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


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