[LON-CAPA-cvs] cvs: loncom /auth loncacc.pm /interface loncommon.pm lonmenu.pm
www
lon-capa-cvs@mail.lon-capa.org
Thu, 03 Apr 2003 21:32:23 -0000
www Thu Apr 3 16:32:23 2003 EDT
Modified files:
/loncom/auth loncacc.pm
/loncom/interface loncommon.pm lonmenu.pm
Log:
Inline "remote" embedded into page headers (design obviously not decided yet).
Auto-lauch good-ole Remote when entering construction space, there is just
no other way right now, and authors should be more "robust" than the average
user.
Index: loncom/auth/loncacc.pm
diff -u loncom/auth/loncacc.pm:1.25 loncom/auth/loncacc.pm:1.26
--- loncom/auth/loncacc.pm:1.25 Mon Feb 3 13:03:52 2003
+++ loncom/auth/loncacc.pm Thu Apr 3 16:32:23 2003
@@ -2,7 +2,7 @@
# Cookie Based Access Handler for Construction Area
# (lonacc: 5/21/99,5/22,5/29,5/31 Gerd Kortemeyer)
#
-# $Id: loncacc.pm,v 1.25 2003/02/03 18:03:52 harris41 Exp $
+# $Id: loncacc.pm,v 1.26 2003/04/03 21:32:23 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -38,7 +38,7 @@
package Apache::loncacc;
use strict;
-use Apache::Constants qw(:common :http :methods);
+use Apache::Constants qw(:common :http :methods REDIRECT);
use Apache::File;
use CGI::Cookie();
use Fcntl qw(:flock);
@@ -98,6 +98,15 @@
unless (&constructaccess($requrl,$r->dir_config('lonDefDomain'))) {
$r->log_reason("Unauthorized $requrl", $r->filename);
return HTTP_NOT_ACCEPTABLE;
+ }
+# Construction space needs Remote to work
+ if ($ENV{'environment.remote'} eq 'off') {
+ $r->content_type('text/html');
+ $r->header_out(Location =>
+ 'http://'.$r->server->server_hostname.
+ '/adm/remote?action=launch&url='.
+ &Apache::lonnet::escape($requrl));
+ return REDIRECT;
}
# -------------------------------------------------------- Load POST parameters
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.93 loncom/interface/loncommon.pm:1.94
--- loncom/interface/loncommon.pm:1.93 Wed Apr 2 22:08:12 2003
+++ loncom/interface/loncommon.pm Thu Apr 3 16:32:23 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.93 2003/04/03 03:08:12 www Exp $
+# $Id: loncommon.pm,v 1.94 2003/04/03 21:32:23 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1715,6 +1715,8 @@
<body bgcolor="$pgbg" text="$font" alink="$alink" vlink="$vlink" link="$link"
$addentries>
END
+ my $upperleft='<img src="http://'.$ENV{'HTTP_HOST'}.':'.
+ $lonhttpdPort.$img.'" />';
if ($bodyonly) {
return $bodytag;
} elsif ($ENV{'browser.interface'} eq 'textual') {
@@ -1728,18 +1730,17 @@
#
# No-Remote rendering
#
- return $bodytag.&Apache::lonmenu::menubuttons($forcereg,'web',
- $forcereg).
- '<h1>LON-CAPA: '.$title.'</h1>';
- } else {
+ $upperleft=&Apache::lonmenu::menubuttons($forcereg,'web',
+ $forcereg);
+ }
#
-# Remote rendering
+# Top frame rendering
#
- return(<<ENDBODY);
+ return(<<ENDBODY);
$bodytag
<table width="100%" cellspacing="0" border="0" cellpadding="0">
<tr><td bgcolor="$font">
-<img src="http://$ENV{'HTTP_HOST'}:$lonhttpdPort$img" /></td>
+$upperleft</td>
<td bgcolor="$font"><font color='$sidebg'>$messages</font></td>
</tr>
<tr>
@@ -1761,7 +1762,6 @@
<td bgcolor="$tabbg" align="right"><font size="2">$realm</font> </td></tr>
</table><br>
ENDBODY
- }
}
###############################################
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.53 loncom/interface/lonmenu.pm:1.54
--- loncom/interface/lonmenu.pm:1.53 Thu Apr 3 15:25:08 2003
+++ loncom/interface/lonmenu.pm Thu Apr 3 16:32:23 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.53 2003/04/03 20:25:08 www Exp $
+# $Id: lonmenu.pm,v 1.54 2003/04/03 21:32:23 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -67,19 +67,21 @@
return $output."<hr />";
} elsif ($ENV{'environment.remote'} eq 'off') {
# Remote Control is switched off
+ my $escurl=&Apache::lonnet::escape($ENV{'REQUEST_URI'});
my $output=(<<ENDINLINEMENU);
<script>
// BEGIN LON-CAPA Internal
</script>
+<table bgcolor="#AAAAAA" width="100%" border="2"><tr><td>
<a href="/adm/menu" target="_top">Main Menu</a>
-<a href="/adm/remote?action=launch" target="_top">Launch Remote Control</a>
+<a href="/adm/remote?action=launch&url=$escurl" target="_top">Launch Remote Control</a>
<br />
<script>
// END LON-CAPA Internal
</script>
ENDINLINEMENU
if ($registration) { $output.=&innerregister($forcereg,$target); }
- return $output."<hr />";
+ return $output."</td></tr></table>";
} else {
return '';
}