[LON-CAPA-cvs] cvs: loncom /auth lonauth.pm lonlogin.pm /html/adm loginproblems.html

www lon-capa-cvs@mail.lon-capa.org
Sun, 02 Mar 2003 02:16:53 -0000


www		Sat Mar  1 21:16:53 2003 EDT

  Modified files:              
    /loncom/auth	lonauth.pm lonlogin.pm 
    /loncom/html/adm	loginproblems.html 
  Log:
  Bug #1285
  loncron cleans login tokens after a day.
  * lonauth now give better error messages
  * lonlogin refreshes the login page after a day 
    (so the "expired" error should never happen anyway)
  * loginproblems was adapted
  
  
Index: loncom/auth/lonauth.pm
diff -u loncom/auth/lonauth.pm:1.42 loncom/auth/lonauth.pm:1.43
--- loncom/auth/lonauth.pm:1.42	Wed Feb 26 09:10:38 2003
+++ loncom/auth/lonauth.pm	Sat Mar  1 21:16:53 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # User Authentication Module
 #
-# $Id: lonauth.pm,v 1.42 2003/02/26 14:10:38 www Exp $
+# $Id: lonauth.pm,v 1.43 2003/03/02 02:16:53 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -196,6 +196,7 @@
     my $startupremote=&Apache::lonmenu::startupremote($lowerurl);
     my $setflags=&Apache::lonmenu::setflags();
     my $maincall=&Apache::lonmenu::maincall();
+    my $bodytag=&Apache::loncommon::bodytag('Successful Login');
 # ------------------------------------------------- Output for successful login
 
     $r->send_cgi_header(<<ENDHEADER);
@@ -209,7 +210,7 @@
 <title>Successful Login to the LearningOnline Network with CAPA</title>
 $startupremote
 </head>
-<body bgcolor="#FFFFFF">
+$bodytag
 $setflags
 $windowinfo
 <h1>Welcome!</h1>
@@ -227,6 +228,7 @@
 
 sub failed {
     my ($r,$message) = @_;
+    my $bodytag=&Apache::loncommon::bodytag('Unsuccessful Login');
     $r->send_cgi_header(<<ENDFHEADER);
 Content-type: text/html
 
@@ -237,9 +239,12 @@
 <title>Unsuccessful Login to the LearningOnline Network with CAPA</title>
 </head>
 <html>
-<body bgcolor="#FFFFFF">
+$bodytag
 <h1>Sorry ...</h1>
-<h2>$message to use the Learning<i>Online</i> Network with CAPA</h2>
+<p><b>$message</b></p>
+<p>Please <a href="/adm/login?username=$FORM{'uname'}&domain=$FORM{'udom'}">login</a> again.</p>
+<p>
+<a href="/adm/loginproblems.html">Problems?</a></p>
 </body>
 </html>
 ENDFAILED
@@ -264,7 +269,7 @@
     } 
 
     if ((!$FORM{'uname'}) || (!$FORM{'upass'}) || (!$FORM{'udom'})) {
-	failed($r,'Username, password and domain need to be specified');
+	failed($r,'Username, password and domain need to be specified.');
         return OK;
     }
     $FORM{'uname'} =~ s/\W//g;
@@ -280,7 +285,7 @@
                                       $FORM{'serverid'});
 
     if (($tmpinfo=~/^error/) || ($tmpinfo eq 'con_lost')) {
-	failed($r,'Login token missing, inaccessible or expired');
+	failed($r,'Information needed to verify your login information is missing, inaccessible or expired.');
         return OK;
     }
     
@@ -312,7 +317,7 @@
 # --------------------------------------------------------------------- Failed?
 
     if ($authhost eq 'no_host') {
-	failed($r,'Username and/or password could not be authenticated');
+	failed($r,'Username and/or password could not be authenticated.');
         return OK;
     }
 
Index: loncom/auth/lonlogin.pm
diff -u loncom/auth/lonlogin.pm:1.36 loncom/auth/lonlogin.pm:1.37
--- loncom/auth/lonlogin.pm:1.36	Wed Feb 19 20:35:27 2003
+++ loncom/auth/lonlogin.pm	Sat Mar  1 21:16:53 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Login Screen
 #
-# $Id: lonlogin.pm,v 1.36 2003/02/20 01:35:27 www Exp $
+# $Id: lonlogin.pm,v 1.37 2003/03/02 02:16:53 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -76,6 +76,7 @@
     my $lonhost = $r->dir_config('lonHostID');
     my $tabdir  = $r->dir_config('lonTabDir');
     my $include = $r->dir_config('lonIncludes');
+    my $expire  = $r->dir_config('lonExpire');
 
 # --------------------------------------------- Default values for login fields
 
@@ -160,6 +161,7 @@
     $r->print(<<ENDHEADER);
 <html>
 <head>
+<meta HTTP-EQUIV="Refresh" CONTENT="$expire; url=/adm/roles" />
 <title>The LearningOnline Network with CAPA Login</title>
 </head>
 ENDHEADER
Index: loncom/html/adm/loginproblems.html
diff -u loncom/html/adm/loginproblems.html:1.4 loncom/html/adm/loginproblems.html:1.5
--- loncom/html/adm/loginproblems.html:1.4	Wed Feb 19 20:35:27 2003
+++ loncom/html/adm/loginproblems.html	Sat Mar  1 21:16:53 2003
@@ -56,8 +56,11 @@
 This means that the server you attempted to login to is currently not 
 available. For example, it might be undergoing maintenance. Please click on
 any of the other server, giving preference to the ones that say "preferred."
-<h2>I get "Login token missing, inaccessible or expired"</h2>
-This is a very rare problem. If it occurs, please wait for 20 minutes, reload 
+<h2>I get "Information needed to verify your login information is missing, inaccessible or expired"</h2>
+LON-CAPA does internal encryption of password information submitted from the 
+login screen, but only keeps the decryption information for a day. Simply pull
+up the login screen again. 
+If that does not solve the problem, please wait for 20 minutes, reload 
 the login page, and try again. If after 20 minutes LON-CAPA still gives you 
 the same message, please email the Server Administrator listed on the login 
 page. The Server Administrator can verify your situation and re-enable logins.