[LON-CAPA-cvs] cvs: loncom /auth lonauth.pm

www lon-capa-cvs@mail.lon-capa.org
Tue, 15 Nov 2005 17:55:04 -0000


www		Tue Nov 15 12:55:04 2005 EDT

  Modified files:              
    /loncom/auth	lonauth.pm 
  Log:
  Guy is so right: much better display of time zone.
  
  
Index: loncom/auth/lonauth.pm
diff -u loncom/auth/lonauth.pm:1.71 loncom/auth/lonauth.pm:1.72
--- loncom/auth/lonauth.pm:1.71	Thu Nov 10 14:19:08 2005
+++ loncom/auth/lonauth.pm	Tue Nov 15 12:55:03 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # User Authentication Module
 #
-# $Id: lonauth.pm,v 1.71 2005/11/10 19:19:08 www Exp $
+# $Id: lonauth.pm,v 1.72 2005/11/15 17:55:03 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -40,7 +40,7 @@
 use Apache::lonmenu();
 use Fcntl qw(:flock);
 use Apache::lonlocal;
-use POSIX qw(mktime);
+use POSIX qw(strftime);
 
 my %FORM;
 
@@ -154,17 +154,7 @@
            print $idf "browser.localres=$FORM{'localres'}\n";
         }
         print $idf "server.domain=".$r->dir_config('lonDefDomain')."\n";
-        my $timezone='UTC';
-        my $timediff=POSIX::mktime(localtime())-POSIX::mktime(gmtime());
-        if ($timediff) {
-	    my $hours=int($timediff/3600);
-            my $minutes=abs(int(($timediff-$hours*3600)/60));
-            my $sign="+";
-            if ($timediff<0) {
-		$sign="-";
-	    }
-            $timezone.=$sign.abs($hours).':'.substr("0$minutes",-2);
-	}
+        my $timezone=POSIX::strftime("%Z",localtime(time));
         print $idf "server.timezone=$timezone\n";
 	print $idf "request.course.fn=\n";
 	print $idf "request.course.uri=\n";