[LON-CAPA-cvs] cvs: loncom /auth lonauth.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Thu, 20 Feb 2003 06:49:24 -0000
albertel Thu Feb 20 01:49:24 2003 EDT
Modified files:
/loncom/auth lonauth.pm
Log:
- apparently late night coding brings out the whitespace anal-retentive Guy
Index: loncom/auth/lonauth.pm
diff -u loncom/auth/lonauth.pm:1.40 loncom/auth/lonauth.pm:1.41
--- loncom/auth/lonauth.pm:1.40 Wed Feb 19 20:35:27 2003
+++ loncom/auth/lonauth.pm Thu Feb 20 01:49:23 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network
# User Authentication Module
#
-# $Id: lonauth.pm,v 1.40 2003/02/20 01:35:27 www Exp $
+# $Id: lonauth.pm,v 1.41 2003/02/20 06:49:23 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -110,15 +110,16 @@
# -------------------------------------- Any accessibility options to remember?
if (($FORM{'interface'}) && ($FORM{'remember'} eq 'true')) {
- foreach ('imagesuppress','appletsuppress',
- 'embedsuppress','fontenhance','blackwhite') {
- if ($FORM{$_} eq 'true') {
- &Apache::lonnet::put('environment',{$_ => 'on'},$domain,$username);
- } else {
- &Apache::lonnet::del('environment',[$_],$domain,$username);
- }
- }
- }
+ foreach ('imagesuppress','appletsuppress',
+ 'embedsuppress','fontenhance','blackwhite') {
+ if ($FORM{$_} eq 'true') {
+ &Apache::lonnet::put('environment',{$_ => 'on'},
+ $domain,$username);
+ } else {
+ &Apache::lonnet::del('environment',[$_],$domain,$username);
+ }
+ }
+ }
# ------------------------------------------------------------- Get environment
my $userenv;
@@ -134,47 +135,45 @@
}
# --------------------------------------------------------- Write first profile
- {
- my $idf=Apache::File->new(">$lonids/$cookie.id");
- unless (flock($idf,LOCK_EX)) {
- &Apache::lonnet::logthis("<font color=blue>WARNING: ".
- 'Could not obtain exclusive lock in lonauth: '.$!);
- $idf->close();
- return 'error: '.$!;
- }
- if ($userenv ne '') { print $idf "$userenv\n"; }
- print $idf "user.name=$username\n";
- print $idf "user.domain=$domain\n";
- print $idf "user.home=$authhost\n";
- print $idf "browser.type=$clientbrowser\n";
- print $idf "browser.version=$clientversion\n";
- print $idf "browser.mathml=$clientmathml\n";
- print $idf "browser.unicode=$clientunicode\n";
- print $idf "browser.os=$clientos\n";
- print $idf "request.course.fn=\n";
- 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";
- if ($FORM{'interface'}) {
- $FORM{'interface'}=~s/\W//gs;
- print $idf "browser.interface=$FORM{'interface'}\n";
- $ENV{'browser.interface'}=$FORM{'interface'};
- foreach
- ('imagesuppress','appletsuppress',
- 'embedsuppress','fontenhance','blackwhite') {
- if (($FORM{$_} eq 'true') ||
- ($userenv{$_} eq 'on')) {
- print $idf "browser.$_=on\n";
- }
-
- }
- }
- if ($userroles ne '') { print $idf "$userroles"; }
+ {
+ my $idf=Apache::File->new(">$lonids/$cookie.id");
+ unless (flock($idf,LOCK_EX)) {
+ &Apache::lonnet::logthis("<font color=blue>WARNING: ".
+ 'Could not obtain exclusive lock in lonauth: '.$!);
$idf->close();
- }
- $ENV{'request.role'}='cm';
- $ENV{'browser.type'}=$clientbrowser;
+ return 'error: '.$!;
+ }
+ if ($userenv ne '') { print $idf "$userenv\n"; }
+ print $idf "user.name=$username\n";
+ print $idf "user.domain=$domain\n";
+ print $idf "user.home=$authhost\n";
+ print $idf "browser.type=$clientbrowser\n";
+ print $idf "browser.version=$clientversion\n";
+ print $idf "browser.mathml=$clientmathml\n";
+ print $idf "browser.unicode=$clientunicode\n";
+ print $idf "browser.os=$clientos\n";
+ print $idf "request.course.fn=\n";
+ 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";
+ if ($FORM{'interface'}) {
+ $FORM{'interface'}=~s/\W//gs;
+ print $idf "browser.interface=$FORM{'interface'}\n";
+ $ENV{'browser.interface'}=$FORM{'interface'};
+ foreach ('imagesuppress','appletsuppress',
+ 'embedsuppress','fontenhance','blackwhite') {
+ if (($FORM{$_} eq 'true') ||
+ ($userenv{$_} eq 'on')) {
+ print $idf "browser.$_=on\n";
+ }
+ }
+ }
+ if ($userroles ne '') { print $idf "$userroles"; }
+ $idf->close();
+ }
+ $ENV{'request.role'}='cm';
+ $ENV{'browser.type'}=$clientbrowser;
# -------------------------------------------------------------------- Log this
&Apache::lonnet::log($domain,$username,$authhost,