[LON-CAPA-cvs] cvs: loncom /auth lonlogout.pm lonroles.pm /html/res/adm/pages menu.html /interface lonmenu.pm
www
lon-capa-cvs@mail.lon-capa.org
Wed, 29 Jan 2003 15:22:06 -0000
www Wed Jan 29 10:22:06 2003 EDT
Modified files:
/loncom/auth lonlogout.pm lonroles.pm
/loncom/html/res/adm/pages menu.html
/loncom/interface lonmenu.pm
Log:
Bug #1201
* Syllabus link is separate
* Easy "switch server" link to deal with authoring space
* Does not provide buttons to "re-initialize" expired courses
(which of course does not work and bounced you back to "Roles".
Index: loncom/auth/lonlogout.pm
diff -u loncom/auth/lonlogout.pm:1.5 loncom/auth/lonlogout.pm:1.6
--- loncom/auth/lonlogout.pm:1.5 Sat Dec 29 16:09:47 2001
+++ loncom/auth/lonlogout.pm Wed Jan 29 10:22:06 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Logout Handler
#
-# $Id: lonlogout.pm,v 1.5 2001/12/29 21:09:47 www Exp $
+# $Id: lonlogout.pm,v 1.6 2003/01/29 15:22:06 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -76,11 +76,19 @@
# -------------------------------------------------------- Menu script and info
my $windowinfo=&Apache::lonmenu::close();
-
+# ---------------------------------------------------------------- Get handover
+ &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['handover']);
+ my $switch='';
+ if ($ENV{'form.handover'}) {
+ $switch='<meta HTTP-EQUIV="Refresh" CONTENT="0.5; url='.
+ $ENV{'form.handover'}.'">';
+ }
# --------------------------------------------------------------- Screen Output
$r->print(<<ENDDOCUMENT);
<html>
-<head><title>The LearningOnline Network with CAPA Logout</title></head>
+<head><title>The LearningOnline Network with CAPA Logout</title>
+$switch
+</head>
<body bgcolor="#FFFFFF">
$windowinfo
<h1>Goodbye!</h1></body>
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.48 loncom/auth/lonroles.pm:1.49
--- loncom/auth/lonroles.pm:1.48 Wed Jan 15 20:37:26 2003
+++ loncom/auth/lonroles.pm Wed Jan 29 10:22:06 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# User Roles Screen
#
-# $Id: lonroles.pm,v 1.48 2003/01/16 01:37:26 www Exp $
+# $Id: lonroles.pm,v 1.49 2003/01/29 15:22:06 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -241,6 +241,7 @@
foreach $envkey (sort keys %ENV) {
my $button = 1;
+ my $switchserver='';
if ($envkey=~/^user\.role\./) {
my (undef,undef,$role,@pwhere)=split(/\./,$envkey);
next if (!defined($role) || $role eq '');
@@ -278,12 +279,14 @@
$tfont='#003300';
} elsif ($tstatus eq 'future') {
$tbg='#FFFF77';
+ $button=0;
} elsif ($tstatus eq 'will') {
$tbg='#FFAA77';
$tremark.='Active at next login. ';
} elsif ($tstatus eq 'expired') {
$tbg='#FF7777';
$tfont='#330000';
+ $button=0;
} elsif ($tstatus eq 'will_not') {
$tbg='#AAFF77';
$tremark.='Expired after logout. ';
@@ -307,7 +310,11 @@
# First, Co-Authorship roles
if ($role eq 'ca') {
my $home = &Apache::lonnet::homeserver($trest,$tdom);
- $button = 0 if ($home ne $r->dir_config('lonHostID'));
+ if ($home ne $r->dir_config('lonHostID')) {
+ $button=0;
+ $switchserver='http://'.
+ $Apache::lonnet::hostname{$home}.'/priv/'.$trest;
+ }
#next if ($home eq 'no_host');
$home = $Apache::lonnet::hostname{$home};
$ttype='Construction Space';
@@ -318,7 +325,12 @@
# Authors
my $home = &Apache::lonnet::homeserver
($ENV{'user.name'},$ENV{'user.domain'});
- $button = 0 if ($home ne $r->dir_config('lonHostID'));
+ if ($home ne $r->dir_config('lonHostID')) {
+ $button=0;
+ $switchserver='http://'.
+ $Apache::lonnet::hostname{$home}.'/priv/'.
+ $ENV{'user.name'};
+ }
#next if ($home eq 'no_host');
$home = $Apache::lonnet::hostname{$home};
$ttype='Construction Space';
@@ -333,16 +345,18 @@
if ($ENV{'course.'.$tcourseid.'.description'}) {
$twhere=$ENV{'course.'.$tcourseid.'.description'};
unless ($twhere eq 'Currently not available') {
- $twhere=
- &Apache::loncommon::syllabuswrapper($twhere,$trest,$tdom,$tfont);
+ $twhere.=' <font size="-2">'.
+ &Apache::loncommon::syllabuswrapper('Syllabus',$trest,$tdom,$tfont).
+ '</font>';
}
} else {
my %newhash=Apache::lonnet::coursedescription
($tcourseid);
if (%newhash) {
- $twhere=
-&Apache::loncommon::syllabuswrapper($newhash{'description'},$trest,$tdom,
- $tfont);
+ $twhere=$newhash{'description'}.
+ ' <font size="-2">'.
+ &Apache::loncommon::syllabuswrapper('Syllabus',$trest,$tdom,$tfont).
+ '</font>';
} else {
$twhere='Currently not available';
$ENV{'course.'.$tcourseid.'.description'}=$twhere;
@@ -361,7 +375,12 @@
$r->print('<tr bgcolor='.$tbg.'>');
unless ($nochoose) {
if (!$button) {
- $r->print('<td> </td>');
+ if ($switchserver) {
+ $r->print('<td><a href="/adm/logout?handover='.
+ $switchserver.'">Switch Server</a></td>');
+ } else {
+ $r->print('<td> </td>');
+ }
} elsif ($tstatus eq 'is') {
$r->print('<td><input type=submit value=Select name="'.
$trolecode.'"></td>');
Index: loncom/html/res/adm/pages/menu.html
diff -u loncom/html/res/adm/pages/menu.html:1.83 loncom/html/res/adm/pages/menu.html:1.84
--- loncom/html/res/adm/pages/menu.html:1.83 Wed Jan 15 18:59:26 2003
+++ loncom/html/res/adm/pages/menu.html Wed Jan 29 10:22:06 2003
@@ -4,7 +4,7 @@
Remote Control
//
-// $Id: menu.html,v 1.83 2003/01/15 23:59:26 www Exp $
+// $Id: menu.html,v 1.84 2003/01/29 15:22:06 www Exp $
//
// Copyright Michigan State University Board of Trustees
//
@@ -61,6 +61,8 @@
var w_extdisp_flag=-1;
var extdisp;
+var autologout=1;
+
// not used (yet)
// var w_Annotator;
// var w_bmquery;
@@ -157,8 +159,9 @@
if (w_LONcatInfo_flag!=-1 && loncatinfo && !loncatinfo.closed) {
loncatinfo.close();
}
- clientwindow.window.location.href="http://"+clienthost+"/adm/logout";
-
+ if (autologout) {
+ clientwindow.window.location.href="http://"+clienthost+"/adm/logout";
+ }
}
function activate () {
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.30 loncom/interface/lonmenu.pm:1.31
--- loncom/interface/lonmenu.pm:1.30 Wed Jan 15 18:59:26 2003
+++ loncom/interface/lonmenu.pm Wed Jan 29 10:22:06 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.30 2003/01/15 23:59:26 www Exp $
+# $Id: lonmenu.pm,v 1.31 2003/01/29 15:22:06 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -203,6 +203,7 @@
<script>
menu=window.open("/adm/rat/empty.html","$menuname",
"height=350,width=150,scrollbars=no,menubar=no");
+menu.autologout=0;
menu.close();
</script>
ENDCLOSE