--- loncom/auth/lonacc.pm 2012/12/06 22:00:31 1.141 +++ loncom/auth/lonacc.pm 2013/02/05 21:32:45 1.143 @@ -1,7 +1,7 @@ # The LearningOnline Network # Cookie Based Access Handler # -# $Id: lonacc.pm,v 1.141 2012/12/06 22:00:31 raeburn Exp $ +# $Id: lonacc.pm,v 1.143 2013/02/05 21:32:45 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -275,9 +275,9 @@ sub sso_login { my ($r,$handle) = @_; my $lonidsdir=$r->dir_config('lonIDsDir'); - if (!($r->user - && (!defined($env{'user.name'}) && !defined($env{'user.domain'})) - && ($handle eq ''))) { + if (($r->user eq '') || + (defined($env{'user.name'}) && (defined($env{'user.domain'})) + && ($handle ne ''))) { # not an SSO case or already logged in return undef; } @@ -396,9 +396,11 @@ sub handler { } my ($is_balancer,$otherserver); - + if ($handle eq '') { - $r->log_reason("Cookie $handle not valid", $r->filename); + unless (($requrl eq '/adm/switchserver') && (!$r->is_initial_req())) { + $r->log_reason("Cookie $handle not valid", $r->filename); + } } elsif ($handle ne '') { # ------------------------------------------------------ Initialize Environment