--- loncom/lond 2013/12/05 13:16:00 1.504 +++ loncom/lond 2014/01/01 17:41:37 1.505 @@ -2,7 +2,7 @@ # The LearningOnline Network # lond "LON Daemon" Server (port "LOND" 5663) # -# $Id: lond,v 1.504 2013/12/05 13:16:00 raeburn Exp $ +# $Id: lond,v 1.505 2014/01/01 17:41:37 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -61,7 +61,7 @@ my $DEBUG = 0; # Non zero to ena my $status=''; my $lastlog=''; -my $VERSION='$Revision: 1.504 $'; #' stupid emacs +my $VERSION='$Revision: 1.505 $'; #' stupid emacs my $remoteVERSION; my $currenthostid="default"; my $currentdomainid; @@ -3837,7 +3837,9 @@ sub put_course_id_hash_handler { # creationcontext - include courses created in specified context # # domcloner - flag to indicate if user can create CCs in course's domain. -# If so, ability to clone course is automatic. +# If so, ability to clone course is automatic. +# hasuniquecode - filter by courses for which a six character unique code has +# been set. # # $client - The socket open on the client. # Returns: @@ -3862,7 +3864,7 @@ sub dump_course_id_handler { my ($udom,$since,$description,$instcodefilter,$ownerfilter,$coursefilter, $typefilter,$regexp_ok,$rtn_as_hash,$selfenrollonly,$catfilter,$showhidden, $caller,$cloner,$cc_clone_list,$cloneonly,$createdbefore,$createdafter, - $creationcontext,$domcloner) =split(/:/,$tail); + $creationcontext,$domcloner,$hasuniquecode) =split(/:/,$tail); my $now = time; my ($cloneruname,$clonerudom,%cc_clone); if (defined($description)) { @@ -3935,6 +3937,9 @@ sub dump_course_id_handler { } else { $creationcontext = '.'; } + unless ($hasuniquecode) { + $hasuniquecode = '.'; + } my $unpack = 1; if ($description eq '.' && $instcodefilter eq '.' && $ownerfilter eq '.' && $typefilter eq '.') { @@ -4023,6 +4028,9 @@ sub dump_course_id_handler { $selfenroll_end = $items->{'selfenroll_end_date'}; $created = $items->{'created'}; $context = $items->{'context'}; + if ($hasuniquecode ne '.') { + next unless ($items->{'uniquecode'}); + } if ($selfenrollonly) { next if (!$selfenroll_types); if (($selfenroll_end > 0) && ($selfenroll_end <= $now)) {