--- loncom/publisher/lonunauthorized.pm 2006/04/06 22:15:19 1.5 +++ loncom/publisher/lonunauthorized.pm 2007/03/02 23:18:19 1.7 @@ -1,7 +1,7 @@ # The LearningOnline Network # Unauthorized to access construction space # -# $Id: lonunauthorized.pm,v 1.5 2006/04/06 22:15:19 albertel Exp $ +# $Id: lonunauthorized.pm,v 1.7 2007/03/02 23:18:19 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -34,6 +34,7 @@ use Apache::loncommon; use Apache::lonnet; use Apache::loncacc; use Apache::lonlocal; +use LONCAPA(); sub handler { my $r = shift; @@ -59,26 +60,27 @@ sub handler { my $ownerhome=&Apache::lonnet::homeserver($ownername,$ownerdomain); unless ($ownerhome eq 'no_host') { $r->print( - "

".&mt('Please log into')." ".$Apache::lonnet::hostname{$ownerhome}. + "

".&mt('Please log into')." ".&Apache::lonnet::hostname($ownerhome). " ".&mt('to edit.')."

"); } } else { $r->print( "

". &mt("You do not have authoring privileges for this resource")."

"); - my ($realownername)=($env{'request.editurl'}=~/\/(?:\~|priv\/|home\/)(\w+)/); + my ($realownername)= + ($env{'request.editurl'}=~m{/(?:~|priv/|home/)($LONCAPA::username_re)}); my $realownerhome= - &Apache::lonnet::homeserver( - $realownername,$r->dir_config('lonDefDomain')); + &Apache::lonnet::homeserver($realownername, + $r->dir_config('lonDefDomain')); unless ($realownerhome eq 'no_host') { - $r->print("

".&mt('Contact')." ". + $r->print("

".&mt('Contact')." ". &Apache::loncommon::aboutmewrapper( &Apache::loncommon::plainname($realownername, $r->dir_config('lonDefDomain')).' ('. $realownername.&mt(' at '). $r->dir_config('lonDefDomain').')', $realownername,$r->dir_config('lonDefDomain')). - ' for access.'); + ' for access.

'); } }