--- loncom/lond 2009/08/10 23:32:26 1.420 +++ loncom/lond 2009/08/18 20:08:13 1.422 @@ -2,7 +2,7 @@ # The LearningOnline Network # lond "LON Daemon" Server (port "LOND" 5663) # -# $Id: lond,v 1.420 2009/08/10 23:32:26 raeburn Exp $ +# $Id: lond,v 1.422 2009/08/18 20:08:13 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -59,7 +59,7 @@ my $DEBUG = 0; # Non zero to ena my $status=''; my $lastlog=''; -my $VERSION='$Revision: 1.420 $'; #' stupid emacs +my $VERSION='$Revision: 1.422 $'; #' stupid emacs my $remoteVERSION; my $currenthostid="default"; my $currentdomainid; @@ -4559,27 +4559,30 @@ sub dump_domainroles_handler { $rolesfilter=&unescape($rolesfilter); @roles = split(/\&/,$rolesfilter); } - + my $hashref = &tie_domain_hash($udom, "nohist_domainroles", &GDBM_WRCREAT()); if ($hashref) { my $qresult = ''; while (my ($key,$value) = each(%$hashref)) { my $match = 1; - my ($start,$end) = split(/:/,&unescape($value)); + my ($end,$start) = split(/:/,&unescape($value)); my ($trole,$uname,$udom,$runame,$rudom,$rsec) = split(/:/,&unescape($key)); - unless ($startfilter eq '.' || !defined($startfilter)) { - if ((defined($start)) && ($start >= $startfilter)) { + unless (@roles < 1) { + unless (grep/^\Q$trole\E$/,@roles) { $match = 0; + next; } } - unless ($endfilter eq '.' || !defined($endfilter)) { - if ((defined($end)) && ($end <= $endfilter)) { + unless ($startfilter eq '.' || !defined($startfilter)) { + if ((defined($start)) && ($start >= $startfilter)) { $match = 0; + next; } } - unless (@roles < 1) { - unless (grep/^\Q$trole\E$/,@roles) { + unless ($endfilter eq '.' || !defined($endfilter)) { + if ((defined($end)) && (($end > 0) && ($end <= $endfilter))) { $match = 0; + next; } } if ($match == 1) { @@ -4885,8 +4888,13 @@ sub enrollment_enabled_handler { sub validate_instcode_handler { my ($cmd, $tail, $client) = @_; my $userinput = "$cmd:$tail"; - my ($dom,$instcode,$owner) = split(/:/, $tail); - my $outcome=&localenroll::validate_instcode($dom,$instcode,$owner); + my ($dom,$instcode,$owner,$inststatus,$instseclist) = split(/:/, $tail); + $instcode = &unescape($instcode); + $owner = &unescape($owner); + $inststatus = &unescape($inststatus); + $instseclist = &unescape($instseclist); + my $outcome=&localenroll::validate_instcode($dom,$instcode,$owner, + $inststatus,$instseclist); &Reply($client, \$outcome, $userinput); return 1;