version 1.13, 2011/11/14 15:51:55
|
version 1.13.2.2, 2011/11/30 18:38:58
|
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 122 sub handler {
|
Line 123 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 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>'); |