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

raeburn raeburn at source.lon-capa.org
Fri Dec 16 10:31:11 EST 2016


raeburn		Fri Dec 16 15:31:11 2016 EDT

  Modified files:              
    /loncom/auth	switchserver.pm 
  Log:
  - If requested role is not an active role assisgned to the user, delete role
    form item and allow switch to the otherserver, instead of returning a 403.
  
  
Index: loncom/auth/switchserver.pm
diff -u loncom/auth/switchserver.pm:1.34 loncom/auth/switchserver.pm:1.35
--- loncom/auth/switchserver.pm:1.34	Thu Jan 22 22:45:06 2015
+++ loncom/auth/switchserver.pm	Fri Dec 16 15:31:11 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Switch Servers Handler
 #
-# $Id: switchserver.pm,v 1.34 2015/01/22 22:45:06 raeburn Exp $
+# $Id: switchserver.pm,v 1.35 2016/12/16 15:31:11 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -112,12 +112,12 @@
     my $skip_canhost_check = '';
     if ($env{'form.role'}) {
         if (!exists($env{'user.role.'.$env{'form.role'}})) {
-            return FORBIDDEN;
+            delete($env{'form.role'});
         } else {
             my $now = time;
             my ($start,$end) = split(/\./,$env{'user.role.'.$env{'form.role'}});
             if (($start && $start > $now) || ($end && $end < $now)) {
-                return FORBIDDEN;
+                delete($env{'form.role'});
             } elsif ($env{'form.role'} eq 'au./'.$env{'user.domain'}.'/') {
                 if (&Apache::lonnet::homeserver($env{'user.name'},$env{'user.domain'}) eq $env{'form.otherserver'}) {
                     $skip_canhost_check = 1;




More information about the LON-CAPA-cvs mailing list