Diff for /loncom/publisher/lonunauthorized.pm between versions 1.13 and 1.13.2.1

version 1.13, 2011/11/14 15:51:55 version 1.13.2.1, 2011/11/14 16:05:44
Line 46  sub handler { Line 46  sub handler {
 # ------------------------------------------------------------ Print the screen  # ------------------------------------------------------------ Print the screen
 # 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,$ownerhome);      my ($ownername,$ownerdomain);
     if ($env{'request.editurl'} ne '') {      if ($env{'request.editurl'} ne '') {
         ($ownername,$ownerdomain,$ownerhome) =           ($ownername,$ownerdomain) = 
             &Apache::loncacc::constructaccess($env{'request.editurl'});              &Apache::loncacc::constructaccess($env{'request.editurl'},$r->dir_config('lonDefDomain'));
     }      }
   
     # Breadcrumbs      # Breadcrumbs
Line 57  sub handler { Line 57  sub handler {
     if ($env{'request.role'} =~ /^(au|ca|aa)/) {       if ($env{'request.role'} =~ /^(au|ca|aa)/) { 
         &Apache::lonhtmlcommon::add_breadcrumb({          &Apache::lonhtmlcommon::add_breadcrumb({
             'text' => 'Construction Space',              'text' => 'Construction Space',
             'href' => &Apache::loncommon::authorspace($env{'request.editurl'}),              'href' => &Apache::loncommon::authorspace(),
         });          });
     } elsif (($env{'request.course.id'}) &&       } elsif (($env{'request.course.id'}) && 
              (&Apache::lonnet::allowed('mdc',$env{'request.course.id'}))) {               (&Apache::lonnet::allowed('mdc',$env{'request.course.id'}))) {
Line 75  sub handler { Line 75  sub handler {
 # figure out what went wrong  # figure out what went wrong
   
     if ($ownerdomain) {      if ($ownerdomain) {
           my $ownerhome=&Apache::lonnet::homeserver($ownername,$ownerdomain);
         if ($ownerhome eq 'no_host') {          if ($ownerhome eq 'no_host') {
             $r->print('<p class="LC_error">'.              $r->print('<p class="LC_error">'.
                       &mt('Unable to determine home server for this resource: [_1]',                        &mt('Unable to determine home server for this resource: [_1]',
Line 86  sub handler { Line 87  sub handler {
                 my $switchlink = '/adm/switchserver?otherserver='.$ownerhome.                  my $switchlink = '/adm/switchserver?otherserver='.$ownerhome.
                                  '&origurl='.&HTML::Entities::encode($env{'request.editurl'},'<>&"');                                   '&origurl='.&HTML::Entities::encode($env{'request.editurl'},'<>&"');
         $r->print('<p class="LC_warning">'.          $r->print('<p class="LC_warning">'.
                           &mt('The construction space for this resource is located on a different server: [_1]',                            &mt('The construction space for this resource is located on another server.').
                           '<b><tt>'.&Apache::lonnet::hostname($ownerhome).'</b></tt>').                            ' <b><tt>'.&Apache::lonnet::hostname($ownerhome).'</b></tt>'.
                           '</p>'.                            '</p>'.
                           '<p class="LC_error"><a href="'.$switchlink.'">'.                            '<p class="LC_error"><a href="'.$switchlink.'">'.
                           &mt('Switch Server').'</a>'.                            &mt('Switch Server').'</a>'.
Line 161  sub handler { Line 162  sub handler {
                                   '</p>');                                    '</p>');
                     } else {                      } else {
                         if (($action eq 'diff') && ($option eq 'cstr')) {                          if (($action eq 'diff') && ($option eq 'cstr')) {
                             $filename =~ s{^/res/}{/priv/};                              $filename =~ s{^/res/$LONCAPA::domain_re/($LONCAPA::username_re)}{/priv/$1};
                         }                          }
                         $r->print('<p class="LC_error">'.                          $r->print('<p class="LC_error">'.
                                   $deniedactions{$action}.'</p><p class="LC_warning">'.                                    $deniedactions{$action}.'</p><p class="LC_warning">'.
Line 199  sub handler { Line 200  sub handler {
                  .&mt('You do not have authoring privileges for this resource').' '                   .&mt('You do not have authoring privileges for this resource').' '
                  .'<span class="LC_filename">'.$env{'request.editurl'}.'</span>'                   .'<span class="LC_filename">'.$env{'request.editurl'}.'</span>'
                  .'</p>');                   .'</p>');
         my ($realownerdom,$realownername) =          my ($realownername) =
     ($env{'request.editurl'}=~m{^/priv/($LONCAPA::domain_re)/($LONCAPA::username_re)});      ($env{'request.editurl'}=~m{(?:~|priv/|home/)($LONCAPA::username_re)});
         my $realownerhome=          my $realownerhome=
     &Apache::lonnet::homeserver($realownername,$realownerdom);      &Apache::lonnet::homeserver($realownername,
                                           $r->dir_config('lonDefDomain'));
         unless ($realownerhome eq 'no_host') {          unless ($realownerhome eq 'no_host') {
             my $plainname=&Apache::loncommon::plainname($realownername,$realownerdom);              my $plainname=&Apache::loncommon::plainname($realownername,$r->dir_config('lonDefDomain'));
             my $user=$realownername.':'.$realownerdom;              my $user=$realownername.':'.$r->dir_config('lonDefDomain');
             my $userlink=&Apache::loncommon::aboutmewrapper(              my $userlink=&Apache::loncommon::aboutmewrapper(
                              $plainname.' ('.$user.')'                               $plainname.' ('.$user.')'
                             ,$realownername                              ,$realownername
                             ,$realownerdom);                              ,$r->dir_config('lonDefDomain'));
     $r->print('<p>'      $r->print('<p>'
                      .&mt('Contact [_1] for access.',$userlink)                       .&mt('Contact [_1] for access.',$userlink)
                      .'</p>');                       .'</p>');

Removed from v.1.13  
changed lines
  Added in v.1.13.2.1


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>
500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.