--- loncom/publisher/lonunauthorized.pm 2004/01/29 00:44:43 1.3 +++ loncom/publisher/lonunauthorized.pm 2006/12/06 22:22:39 1.6 @@ -1,7 +1,7 @@ # The LearningOnline Network # Unauthorized to access construction space # -# $Id: lonunauthorized.pm,v 1.3 2004/01/29 00:44:43 www Exp $ +# $Id: lonunauthorized.pm,v 1.6 2006/12/06 22:22:39 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; @@ -42,19 +43,14 @@ sub handler { return OK if $r->header_only; # ------------------------------------------------------------ Print the screen - $r->print(< - -The LearningOnline Network with CAPA - -ENDDOCUMENT # Figure out who the user is and what they wanted to access 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 - $r->print(&Apache::loncommon::bodytag - ("Failed Access to Construction Space",'','','',$ownerdomain)); + $r->print(&Apache::loncommon::start_page("Failed Access to Construction Space", + undef, + {'domain' => $ownerdomain,})); # figure out what went wrong if ($ownerdomain) { @@ -71,23 +67,24 @@ ENDDOCUMENT $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.

'); } } - $r->print(''); + $r->print(&Apache::loncommon::end_page()); return OK; }