--- loncom/auth/lonauth.pm 2003/01/31 21:46:36 1.35 +++ loncom/auth/lonauth.pm 2003/02/18 19:12:38 1.38 @@ -1,7 +1,7 @@ # The LearningOnline Network # User Authentication Module # -# $Id: lonauth.pm,v 1.35 2003/01/31 21:46:36 www Exp $ +# $Id: lonauth.pm,v 1.38 2003/02/18 19:12:38 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -30,9 +30,7 @@ # 1/14,2/24,2/28,2/29,3/7,5/29,5/30,5/31,6/1,6/5,6/29, # 7/1,7/10,10/2,10/5,10/9,10/26,10/30,11/10, # 05/28,05/29 Gerd Kortemeyer -# 07/24 Scott Harrison # 07/28,08/03 Gerd Kortemeyer -# 8/15 Scott Harrison # 8/20 Gerd Kortemeyer package Apache::lonauth; @@ -47,6 +45,9 @@ use Crypt::DES; use Apache::lonnet(); use Apache::lonmenu(); use Fcntl qw(:flock); + +my %FORM; + # ------------------------------------------------------------ Successful login sub success { @@ -117,6 +118,9 @@ sub success { $userenv.="environment.$key=$userenv{$key}\n"; } } + if (($userenv{'interface'}) && (!$FORM{'interface'})) { + $FORM{'interface'}=$userenv{'interface'}; + } # --------------------------------------------------------- Write first profile { @@ -140,7 +144,19 @@ sub success { print $idf "request.course.uri=\n"; print $idf "request.course.sec=\n"; print $idf "request.role=cm\n"; - print $idf "request.host=$ENV{'HTTP_HOST'}\n"; + print $idf "request.host=$ENV{'HTTP_HOST'}\n"; + if ($FORM{'interface'}) { + $FORM{'interface'}=~s/\W//gs; + print $idf "browser.interface=$FORM{'interface'}\n"; + $ENV{'browser.interface'}=$FORM{'interface'}; + } + foreach + ('imagesuppress','embedsuppress','fontenhance','blackwhite') { + if (($FORM{$_} eq 'on') || + ($userenv{$_} eq 'on')) { + print $idf "browser.$_=on\n"; + } + } if ($userroles ne '') { print $idf "$userroles"; } $idf->close(); } @@ -225,7 +241,9 @@ sub handler { my $buffer; $r->read($buffer,$r->header_in('Content-length')); my @pairs=split(/&/,$buffer); - my $pair; my $name; my $value; my %FORM; + my $pair; my $name; my $value; + undef %FORM; + %FORM=(); foreach $pair (@pairs) { ($name,$value) = split(/=/,$pair); $value =~ tr/+/ /;