--- loncom/interface/loncommon.pm 2006/12/05 01:51:48 1.486 +++ loncom/interface/loncommon.pm 2006/12/05 02:55:51 1.487 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.486 2006/12/05 01:51:48 raeburn Exp $ +# $Id: loncommon.pm,v 1.487 2006/12/05 02:55:51 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -6289,9 +6289,11 @@ sub construct_course { # if specified, key authority is not course, but user # only active if keyaccess is yes if ($args->{'keyauth'}) { - $args->{'keyauth'}=~s/[^\w\@]//g; - if ($args->{'keyauth'}) { - $cenv{'keyauth'}=$args->{'keyauth'}; + my ($user,$domain) = split(':',$args->{'keyauth'}); + $user = &LONCAPA::clean_username($user); + $domain = &LONCAPA::clean_username($domain); + if ($user ne '' && $domain ne ''); + $cenv{'keyauth'}=$user.':'.$domain; } }