[LON-CAPA-cvs] cvs: loncom /auth lonacc.pm /interface loncommon.pm

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 25 Jan 2005 00:28:00 -0000


albertel		Mon Jan 24 19:28:00 2005 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
    /loncom/auth	lonacc.pm 
  Log:
  - setup the browser.* attributes for public users
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.246 loncom/interface/loncommon.pm:1.247
--- loncom/interface/loncommon.pm:1.246	Fri Jan 14 16:15:09 2005
+++ loncom/interface/loncommon.pm	Mon Jan 24 19:27:59 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.246 2005/01/14 21:15:09 matthew Exp $
+# $Id: loncommon.pm,v 1.247 2005/01/25 00:27:59 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1241,9 +1241,11 @@
 ###############################################################
 ###############################################################
 sub decode_user_agent {
+    my ($r)=@_;
     my @browsertype=split(/\&/,$Apache::lonnet::perlvar{"lonBrowsDet"});
     my %mathcap=split(/\&/,$$Apache::lonnet::perlvar{"lonMathML"});
     my $httpbrowser=$ENV{"HTTP_USER_AGENT"};
+    if (!$httpbrowser && $r) { $httpbrowser=$r->header_in('User-Agent'); }
     my $clientbrowser='unknown';
     my $clientversion='0';
     my $clientmathml='';
Index: loncom/auth/lonacc.pm
diff -u loncom/auth/lonacc.pm:1.58 loncom/auth/lonacc.pm:1.59
--- loncom/auth/lonacc.pm:1.58	Tue Dec 28 15:28:55 2004
+++ loncom/auth/lonacc.pm	Mon Jan 24 19:28:00 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Cookie Based Access Handler
 #
-# $Id: lonacc.pm,v 1.58 2004/12/28 20:28:55 albertel Exp $
+# $Id: lonacc.pm,v 1.59 2005/01/25 00:28:00 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -174,6 +174,15 @@
         $ENV{'request.state'} = "published";
         $ENV{'request.publicaccess'} = 1;
         $ENV{'request.filename'} = $r->filename;
+	my ($httpbrowser,  $clientbrowser, $clientversion,
+	    $clientmathml, $clientunicode, $clientos) =
+		&Apache::loncommon::decode_user_agent($r);
+	$ENV{'browser.type'}=$clientbrowser;
+        $ENV{'browser.version'}=$clientversion;
+        $ENV{'browser.mathml'}=$clientmathml;
+        $ENV{'browser.unicode'}=$clientunicode;
+        $ENV{'browser.os'}=$clientos;
+
         return OK;
     }
 # -------------------------------------------------------------- Not authorized