[LON-CAPA-cvs] cvs: loncom /auth lonroles.pm
raeburn
raeburn@source.lon-capa.org
Sun, 01 Aug 2010 18:34:19 -0000
raeburn Sun Aug 1 18:34:19 2010 EDT
Modified files:
/loncom/auth lonroles.pm
Log:
- Correction to LON-CAPA version checking in rev 1.255.
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.255 loncom/auth/lonroles.pm:1.256
--- loncom/auth/lonroles.pm:1.255 Fri Jul 30 20:35:16 2010
+++ loncom/auth/lonroles.pm Sun Aug 1 18:34:19 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# User Roles Screen
#
-# $Id: lonroles.pm,v 1.255 2010/07/30 20:35:16 raeburn Exp $
+# $Id: lonroles.pm,v 1.256 2010/08/01 18:34:19 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -329,33 +329,34 @@
my @ids = &Apache::lonnet::current_machine_ids();
unless ($loncaparev eq '' && $home && grep(/^\Q$home\E$/,@ids)) {
my %curr_reqd_hash = &Apache::lonnet::userenvironment($cdom,$cnum,'internal.releaserequired');
- if ($curr_reqd_hash{'internal.releaserequired'} &&
- $curr_reqd_hash{'internal.releaserequired'} > $loncaparev) {
+ if ($curr_reqd_hash{'internal.releaserequired'} ne '') {
my ($switchserver,$switchwarning) =
&check_release_required($loncaparev,$cdom.'_'.$cnum,$trolecode,$curr_reqd_hash{'internal.releaserequired'});
- &Apache::loncommon::content_type($r,'text/html');
- &Apache::loncommon::no_cache($r);
- $r->send_http_header;
- my $end_page=&Apache::loncommon::end_page();
- $r->print(&Apache::loncommon::start_page('Selected course unavailable on this server').
- '<p class="LC_warning">');
- if ($switchwarning) {
- $r->print($switchwarning.'<br /><a href="/adm/roles">');
- if (&Apache::loncommon::show_course()) {
- $r->print(&mt('Display courses'));
- } else {
- $r->print(&mt('Display roles'));
+ if ($switchwarning ne '' || $switchserver ne '') {
+ &Apache::loncommon::content_type($r,'text/html');
+ &Apache::loncommon::no_cache($r);
+ $r->send_http_header;
+ my $end_page=&Apache::loncommon::end_page();
+ $r->print(&Apache::loncommon::start_page('Selected course unavailable on this server').
+ '<p class="LC_warning">');
+ if ($switchwarning) {
+ $r->print($switchwarning.'<br /><a href="/adm/roles">');
+ if (&Apache::loncommon::show_course()) {
+ $r->print(&mt('Display courses'));
+ } 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>');
- } 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('</p>'.&Apache::loncommon::end_page());
+ return OK;
}
- $r->print('</p>'.&Apache::loncommon::end_page());
- return OK;
}
}
}