version 1.255, 2010/07/30 20:35:16
|
version 1.256.2.1, 2010/08/12 23:40:49
|
Line 57 course they should act on, etc. Both in
|
Line 57 course they should act on, etc. Both in
|
handler determines via C<lonnet>'s C<&allowed> function that a certain |
handler determines via C<lonnet>'s C<&allowed> function that a certain |
action is not allowed, C<lonroles> is used as error handler. This |
action is not allowed, C<lonroles> is used as error handler. This |
allows the user to select another role which may have permission to do |
allows the user to select another role which may have permission to do |
what they were trying to do. |
what they were trying to do. C<lonroles> can also be accessed via the |
|
B<CRS> button in the Remote Control. |
|
|
=begin latex |
=begin latex |
|
|
Line 144 use HTML::Entities;
|
Line 145 use HTML::Entities;
|
|
|
|
|
sub redirect_user { |
sub redirect_user { |
my ($r,$title,$url,$msg) = @_; |
my ($r,$title,$url,$msg,$launch_nav) = @_; |
$msg = $title if (! defined($msg)); |
$msg = $title if (! defined($msg)); |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::no_cache($r); |
&Apache::loncommon::no_cache($r); |
$r->send_http_header; |
$r->send_http_header; |
|
my $swinfo=&Apache::lonmenu::rawconfig(); |
|
my $navwindow; |
|
if ($launch_nav eq 'on') { |
|
$navwindow.=&Apache::lonnavdisplay::launch_win('now',undef,undef, |
|
($url =~ m-^/adm/whatsnew-)); |
|
} else { |
|
$navwindow.=&Apache::lonnavmaps::close(); |
|
} |
|
|
# Breadcrumbs |
# Breadcrumbs |
my $brcrum = [{'href' => $url, |
my $brcrum = [{'href' => $url, |
Line 163 sub redirect_user {
|
Line 172 sub redirect_user {
|
$url=~s/ /\%20/g; |
$url=~s/ /\%20/g; |
$r->print(<<ENDREDIR); |
$r->print(<<ENDREDIR); |
$start_page |
$start_page |
|
<script type="text/javascript"> |
|
// <![CDATA[ |
|
$swinfo |
|
// ]]> |
|
</script> |
|
$navwindow |
<p>$msg</p> |
<p>$msg</p> |
$end_page |
$end_page |
ENDREDIR |
ENDREDIR |
Line 329 sub handler {
|
Line 344 sub handler {
|
my @ids = &Apache::lonnet::current_machine_ids(); |
my @ids = &Apache::lonnet::current_machine_ids(); |
unless ($loncaparev eq '' && $home && grep(/^\Q$home\E$/,@ids)) { |
unless ($loncaparev eq '' && $home && grep(/^\Q$home\E$/,@ids)) { |
my %curr_reqd_hash = &Apache::lonnet::userenvironment($cdom,$cnum,'internal.releaserequired'); |
my %curr_reqd_hash = &Apache::lonnet::userenvironment($cdom,$cnum,'internal.releaserequired'); |
if ($curr_reqd_hash{'internal.releaserequired'} && |
if ($curr_reqd_hash{'internal.releaserequired'} ne '') { |
$curr_reqd_hash{'internal.releaserequired'} > $loncaparev) { |
|
my ($switchserver,$switchwarning) = |
my ($switchserver,$switchwarning) = |
&check_release_required($loncaparev,$cdom.'_'.$cnum,$trolecode,$curr_reqd_hash{'internal.releaserequired'}); |
&check_release_required($loncaparev,$cdom.'_'.$cnum,$trolecode,$curr_reqd_hash{'internal.releaserequired'}); |
&Apache::loncommon::content_type($r,'text/html'); |
if ($switchwarning ne '' || $switchserver ne '') { |
&Apache::loncommon::no_cache($r); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
&Apache::loncommon::no_cache($r); |
my $end_page=&Apache::loncommon::end_page(); |
$r->send_http_header; |
$r->print(&Apache::loncommon::start_page('Selected course unavailable on this server'). |
my $end_page=&Apache::loncommon::end_page(); |
'<p class="LC_warning">'); |
$r->print(&Apache::loncommon::start_page('Selected course unavailable on this server'). |
if ($switchwarning) { |
'<p class="LC_warning">'); |
$r->print($switchwarning.'<br /><a href="/adm/roles">'); |
if ($switchwarning) { |
if (&Apache::loncommon::show_course()) { |
$r->print($switchwarning.'<br /><a href="/adm/roles">'); |
$r->print(&mt('Display courses')); |
if (&Apache::loncommon::show_course()) { |
} else { |
$r->print(&mt('Display courses')); |
$r->print(&mt('Display roles')); |
} else { |
|
$r->print(&mt('Display roles')); |
|
} |
|
$r->print('</a>'); |
|
} elsif ($switchserver) { |
|
$r->print(&mt('This course requires a newer version of LON-CAPA than is installed on this server.'). |
|
'<br />'. |
|
'<a href="/adm/switchserver?'.$switchserver.'">'. |
|
&mt('Switch Server'). |
|
'</a>'); |
} |
} |
$r->print('</a>'); |
$r->print('</p>'.&Apache::loncommon::end_page()); |
} elsif ($switchserver) { |
return OK; |
$r->print(&mt('This course requires a newer version of LON-CAPA than is installed on this server.'). |
|
'<br />'. |
|
'<a href="/adm/switchserver?'.$switchserver.'">'. |
|
&mt('Switch Server'). |
|
'</a>'); |
|
} |
} |
$r->print('</p>'.&Apache::loncommon::end_page()); |
|
return OK; |
|
} |
} |
} |
} |
} |
} |
Line 541 ENDENTERKEY
|
Line 557 ENDENTERKEY
|
} |
} |
&redirect_user($r, &mt('Entering [_1]', |
&redirect_user($r, &mt('Entering [_1]', |
$env{'course.'.$courseid.'.description'}), |
$env{'course.'.$courseid.'.description'}), |
$dest, $msg); |
$dest, $msg, |
|
$env{'environment.remotenavmap'}); |
return OK; |
return OK; |
} |
} |
if (&Apache::lonnet::allowed('whn', |
if (&Apache::lonnet::allowed('whn', |
Line 554 ENDENTERKEY
|
Line 571 ENDENTERKEY
|
unless ($startpage eq 'firstres') { |
unless ($startpage eq 'firstres') { |
$msg = &mt('Entering [_1] ...', |
$msg = &mt('Entering [_1] ...', |
$env{'course.'.$courseid.'.description'}); |
$env{'course.'.$courseid.'.description'}); |
&redirect_user($r, &mt('New in course'), |
&redirect_user($r,&mt('New in course'), |
'/adm/whatsnew?refpage=start', $msg); |
'/adm/whatsnew?refpage=start',$msg, |
|
$env{'environment.remotenavmap'}); |
return OK; |
return OK; |
} |
} |
} |
} |
Line 567 ENDENTERKEY
|
Line 585 ENDENTERKEY
|
} |
} |
$msg = &mt('Entering [_1] ...', |
$msg = &mt('Entering [_1] ...', |
$env{'course.'.$courseid.'.description'}); |
$env{'course.'.$courseid.'.description'}); |
&redirect_user($r, &mt('Entering [_1]', |
&redirect_user($r,&mt('Entering [_1]', |
$env{'course.'.$courseid.'.description'}), |
$env{'course.'.$courseid.'.description'}), |
$furl, $msg); |
$furl,$msg, |
|
$env{'environment.remotenavmap'}); |
} |
} |
return OK; |
return OK; |
} |
} |
Line 1813 course they should act on, etc. Both in
|
Line 1832 course they should act on, etc. Both in
|
handler determines via C<lonnet>'s C<&allowed> function that a certain |
handler determines via C<lonnet>'s C<&allowed> function that a certain |
action is not allowed, C<lonroles> is used as error handler. This |
action is not allowed, C<lonroles> is used as error handler. This |
allows the user to select another role which may have permission to do |
allows the user to select another role which may have permission to do |
what they were trying to do. |
what they were trying to do. C<lonroles> can also be accessed via the |
|
B<CRS> button in the Remote Control. |
|
|
=begin latex |
=begin latex |
|
|