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

raeburn raeburn at source.lon-capa.org
Mon May 5 19:17:12 EDT 2014


raeburn		Mon May  5 23:17:12 2014 EDT

  Modified files:              
    /loncom/auth	lonacc.pm 
  Log:
  - SSO authenticated user without existing LON-CAPA account:
    Handle as SSO user if either lonSSOUserUnknownRedirect is defined or
    domain configuration permits self-creation of LC account by sso user. 
  
  
Index: loncom/auth/lonacc.pm
diff -u loncom/auth/lonacc.pm:1.154 loncom/auth/lonacc.pm:1.155
--- loncom/auth/lonacc.pm:1.154	Mon Mar 10 02:07:01 2014
+++ loncom/auth/lonacc.pm	Mon May  5 23:17:12 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Cookie Based Access Handler
 #
-# $Id: lonacc.pm,v 1.154 2014/03/10 02:07:01 raeburn Exp $
+# $Id: lonacc.pm,v 1.155 2014/05/05 23:17:12 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -386,10 +386,8 @@
 	    $r->set_handlers('PerlHandler'=> undef);
 	}
 	return OK;
-    } elsif (defined($r->dir_config('lonSSOUserUnknownRedirect'))) {
+    } else {
 	&Apache::lonnet::logthis(" SSO authorized unknown user $user ");
-        $r->subprocess_env->set('SSOUserUnknown' => $user);
-        $r->subprocess_env->set('SSOUserDomain' => $domain);
         my @cancreate;
         my %domconfig =
             &Apache::lonnet::get_dom('configuration',['usercreation'],$domain);
@@ -403,15 +401,18 @@
                 }
             }
         }
-        if (grep(/^sso$/, at cancreate)) {
-            $r->set_handlers('PerlHandler'=>
-                     [\&Apache::createaccount::handler]);
-            $r->handler('perl-script');
-        } else {
-	    $r->internal_redirect($r->dir_config('lonSSOUserUnknownRedirect'));
-            $r->set_handlers('PerlHandler'=> undef);
+        if ((grep(/^sso$/, at cancreate)) || (defined($r->dir_config('lonSSOUserUnknownRedirect')))) {
+            $r->subprocess_env->set('SSOUserUnknown' => $user);
+            $r->subprocess_env->set('SSOUserDomain' => $domain);
+            if (grep(/^sso$/, at cancreate)) {
+                $r->set_handlers('PerlHandler'=> [\&Apache::createaccount::handler]);
+                $r->handler('perl-script');
+            } else {
+	        $r->internal_redirect($r->dir_config('lonSSOUserUnknownRedirect'));
+                $r->set_handlers('PerlHandler'=> undef);
+            }
+	    return OK;
         }
-	return OK;
     }
     return undef;
 }




More information about the LON-CAPA-cvs mailing list