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

www lon-capa-cvs@mail.lon-capa.org
Wed, 03 Jul 2002 20:54:49 -0000


www		Wed Jul  3 16:54:49 2002 EDT

  Modified files:              
    /loncom/auth	lonacc.pm 
  Log:
  Bug 573.
  Only calls login screen for resources with embstyle ssi, or /adm/roles,
  or /adm/logout
  
  
Index: loncom/auth/lonacc.pm
diff -u loncom/auth/lonacc.pm:1.33 loncom/auth/lonacc.pm:1.34
--- loncom/auth/lonacc.pm:1.33	Sat Jun 15 15:45:26 2002
+++ loncom/auth/lonacc.pm	Wed Jul  3 16:54:49 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Cookie Based Access Handler
 #
-# $Id: lonacc.pm,v 1.33 2002/06/15 19:45:26 www Exp $
+# $Id: lonacc.pm,v 1.34 2002/07/03 20:54:49 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -216,10 +216,17 @@
         $ENV{'request.filename'} = $r->filename;
         return OK;
     }
-# ----------------------------------------------- Store where they wanted to go
-    
-    $ENV{'request.firsturl'}=$requrl;
-    return FORBIDDEN;
+# -------------------------------------------------------------- Not authorized
+    $requrl=~/\.(\w+)$/;
+    if ((&Apache::loncommon::fileembstyle($1) eq 'ssi') ||
+        ($requrl=~/^\/adm\/(roles|logout)/)) {
+# -------------------------- Store where they wanted to go and get login screen
+       $ENV{'request.firsturl'}=$requrl;
+       return FORBIDDEN;
+   } else {
+# --------------------------------------------------------------------- Goodbye
+       return HTTP_BAD_REQUEST;
+   }
 }
 
 1;