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

version 1.1, 2002/09/10 14:41:05 version 1.4, 2005/04/07 06:56:27
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;
   
 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;
   
Line 50  ENDDOCUMENT Line 51  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::bodytag
            ("Failed Access to Construction Space",'','','',$ownerdomain));             ("Failed Access to Construction Space",'','','',$ownerdomain));
 # figure out what went wrong  # figure out what went wrong
   
     if ($ownerdomain) {      if ($ownerdomain) {
  $r->print('<h1>Choose another server</h1>'.   $r->print('<h1>'.&mt('Choose another server').'</h1><p>'.
  "<p>The constuction space for this resource is located on another server.</p>"  &mt('The constuction space for this resource is located on 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>Please log into <tt>".$Apache::lonnet::hostname{$ownerhome}.   "<p>".&mt('Please log into')." <tt>".$Apache::lonnet::hostname{$ownerhome}.
  "</tt> to edit.</p>");   "</tt> ".&mt('to edit.')."</p>");
         }          }
     } else {      } else {
         $r->print(          $r->print(
             "<h1>You do not have authoring privileges for this resource</h1>");              "<h1>".
         my ($realownername)=($ENV{'request.editurl'}=~/\/(?:\~|priv\/|home\/)(\w+)/);   &mt("You do not have authoring privileges for this resource")."</h1>");
           my ($realownername)=($env{'request.editurl'}=~/\/(?:\~|priv\/|home\/)(\w+)/);
         my $realownerhome=          my $realownerhome=
       &Apache::lonnet::homeserver(        &Apache::lonnet::homeserver(
         $realownername,$r->dir_config('lonDefDomain'));          $realownername,$r->dir_config('lonDefDomain'));
         unless ($realownerhome eq 'no_host') {          unless ($realownerhome eq 'no_host') {
            $r->print("<p>Contact ".             $r->print("<p>".&mt('Contact')." ".
     &Apache::loncommon::aboutmewrapper(      &Apache::loncommon::aboutmewrapper(
      &Apache::loncommon::plainname($realownername,       &Apache::loncommon::plainname($realownername,
                                $r->dir_config('lonDefDomain')).'('.                                 $r->dir_config('lonDefDomain')).' ('.
                                $realownername.' at '.                                 $realownername.&mt(' at ').
                                $r->dir_config('lonDefDomain').')',                                 $r->dir_config('lonDefDomain').')',
        $realownername,$r->dir_config('lonDefDomain')).         $realownername,$r->dir_config('lonDefDomain')).
            ' for access.');             ' for access.');

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


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