version 1.13.2.1, 2011/11/14 16:05:44
|
version 1.17, 2013/06/07 16:07:49
|
Line 32 use strict;
|
Line 32 use strict;
|
use Apache::Constants qw(:common); |
use Apache::Constants qw(:common); |
use Apache::loncommon; |
use Apache::loncommon; |
use Apache::lonnet; |
use Apache::lonnet; |
use Apache::loncacc; |
|
use Apache::lonlocal; |
use Apache::lonlocal; |
use LONCAPA(); |
use LONCAPA(); |
use HTML::Entities(); |
use HTML::Entities(); |
Line 46 sub handler {
|
Line 45 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); |
my ($ownername,$ownerdomain,$ownerhome); |
if ($env{'request.editurl'} ne '') { |
if ($env{'request.editurl'} ne '') { |
($ownername,$ownerdomain) = |
($ownername,$ownerdomain,$ownerhome) = |
&Apache::loncacc::constructaccess($env{'request.editurl'},$r->dir_config('lonDefDomain')); |
&Apache::lonnet::constructaccess($env{'request.editurl'}); |
} |
} |
|
|
# Breadcrumbs |
# Breadcrumbs |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
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' => 'Authoring Space', |
'href' => &Apache::loncommon::authorspace(), |
'href' => &Apache::loncommon::authorspace($env{'request.editurl'}), |
}); |
}); |
} 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 68 sub handler {
|
Line 67 sub handler {
|
} |
} |
|
|
# print header |
# print header |
$r->print(&Apache::loncommon::start_page("Failed Access to Construction Space", |
$r->print(&Apache::loncommon::start_page("Failed Access to Authoring Space", |
undef, |
undef, |
{'domain' => $ownerdomain,}). |
{'domain' => $ownerdomain,}). |
&Apache::lonhtmlcommon::breadcrumbs()); |
&Apache::lonhtmlcommon::breadcrumbs()); |
# 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 87 sub handler {
|
Line 85 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 another server.'). |
&mt('The Authoring Space for this resource is located on a different server: [_1]', |
' <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 123 sub handler {
|
Line 121 sub handler {
|
$option = 'decompress'; |
$option = 'decompress'; |
} elsif ($name eq 'qualifiedfilename') { |
} elsif ($name eq 'qualifiedfilename') { |
$qualifiedfilename = $value; |
$qualifiedfilename = $value; |
} elsif ($name = 'versionone') { |
} elsif ($name eq 'versionone') { |
if ($value eq 'priv') { |
if ($value eq 'priv') { |
$option = 'cstr'; |
$option = 'cstr'; |
} |
} |
Line 162 sub handler {
|
Line 160 sub handler {
|
'</p>'); |
'</p>'); |
} else { |
} else { |
if (($action eq 'diff') && ($option eq 'cstr')) { |
if (($action eq 'diff') && ($option eq 'cstr')) { |
$filename =~ s{^/res/$LONCAPA::domain_re/($LONCAPA::username_re)}{/priv/$1}; |
$filename =~ s{^/res/}{/priv/}; |
} |
} |
$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 181 sub handler {
|
Line 179 sub handler {
|
&mt('There is a problem with the filename').' '. |
&mt('There is a problem with the filename').' '. |
'<span class="LC_filename">'.$r->uri.'</span></p>'. |
'<span class="LC_filename">'.$r->uri.'</span></p>'. |
'<p class="LC_warning">'. |
'<p class="LC_warning">'. |
&mt('You may be attempting to edit a versioned file (files in construction space may not include a version number before the extension).'). |
&mt('You may be attempting to edit a versioned file (files in Authoring Space may not include a version number before the extension).'). |
'</p>'); |
'</p>'); |
} else { |
} else { |
$r->print('<p class="LC_error">'. |
$r->print('<p class="LC_error">'. |
Line 193 sub handler {
|
Line 191 sub handler {
|
&mt('There is a problem with the filename').' '. |
&mt('There is a problem with the filename').' '. |
'<span class="LC_filename">'.$env{'request.editurl'}.'</span></p>'. |
'<span class="LC_filename">'.$env{'request.editurl'}.'</span></p>'. |
'<p class="LC_warning">'. |
'<p class="LC_warning">'. |
&mt('You may be attempting to edit a versioned file (files in construction space may not include a version number before the extension).'). |
&mt('You may be attempting to edit a versioned file (files in Authoring Space may not include a version number before the extension).'). |
'</p>'); |
'</p>'); |
} else { |
} else { |
$r->print('<p class="LC_error">' |
$r->print('<p class="LC_error">' |
.&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 ($realownername) = |
my ($realownerdom,$realownername) = |
($env{'request.editurl'}=~m{(?:~|priv/|home/)($LONCAPA::username_re)}); |
($env{'request.editurl'}=~m{^/priv/($LONCAPA::domain_re)/($LONCAPA::username_re)}); |
my $realownerhome= |
my $realownerhome= |
&Apache::lonnet::homeserver($realownername, |
&Apache::lonnet::homeserver($realownername,$realownerdom); |
$r->dir_config('lonDefDomain')); |
|
unless ($realownerhome eq 'no_host') { |
unless ($realownerhome eq 'no_host') { |
my $plainname=&Apache::loncommon::plainname($realownername,$r->dir_config('lonDefDomain')); |
my $plainname=&Apache::loncommon::plainname($realownername,$realownerdom); |
my $user=$realownername.':'.$r->dir_config('lonDefDomain'); |
my $user=$realownername.':'.$realownerdom; |
my $userlink=&Apache::loncommon::aboutmewrapper( |
my $userlink=&Apache::loncommon::aboutmewrapper( |
$plainname.' ('.$user.')' |
$plainname.' ('.$user.')' |
,$realownername |
,$realownername |
,$r->dir_config('lonDefDomain')); |
,$realownerdom); |
$r->print('<p>' |
$r->print('<p>' |
.&mt('Contact [_1] for access.',$userlink) |
.&mt('Contact [_1] for access.',$userlink) |
.'</p>'); |
.'</p>'); |