--- loncom/auth/switchserver.pm 2017/02/25 20:00:36 1.36 +++ loncom/auth/switchserver.pm 2017/08/08 20:10:55 1.37 @@ -1,7 +1,7 @@ # The LearningOnline Network # Switch Servers Handler # -# $Id: switchserver.pm,v 1.36 2017/02/25 20:00:36 raeburn Exp $ +# $Id: switchserver.pm,v 1.37 2017/08/08 20:10:55 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -129,8 +129,12 @@ sub handler { $skip_canhost_check = 1; } } elsif ($env{'form.role'} =~ m{^[ac]a\./($match_domain)/($match_username)$}) { - if (&Apache::lonnet::homeserver($2,$1) eq $env{'form.otherserver'}) { - $skip_canhost_check = 1; + my ($audom,$auname) = ($1,$2); + if (&Apache::lonnet::homeserver($auname,$audom) eq $env{'form.otherserver'}) { + if ((&Apache::lonnet::will_trust('othcoau',$audom,$env{'user.domain'})) && + (&Apache::lonnet::will_trust('coremau',$env{'user.domain'},$audom))) { + $skip_canhost_check = 1; + } } } }