--- loncom/lonnet/perl/lonnet.pm 2003/03/25 22:03:23 1.352 +++ loncom/lonnet/perl/lonnet.pm 2003/03/26 04:57:04 1.353 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.352 2003/03/25 22:03:23 www Exp $ +# $Id: lonnet.pm,v 1.353 2003/03/26 04:57:04 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1069,7 +1069,7 @@ sub flushcourselogs { # Is used in pickcourse # foreach (keys %courseidbuffer) { - &reply('courseidput:'.$hostdom{$_}.':'.$courseidbuffer{$_},$_); + &courseidput($hostdom{$_},$courseidbuffer{$_},$_); } # # File accesses @@ -1185,6 +1185,36 @@ sub get_course_adv_roles { } return sort %returnhash; } + +# ---------------------------------------------------------- Course ID routines +# Deal with domain's nohist_courseid.db files +# + +sub courseidput { + my ($domain,$what,$coursehome)=@_; + return &reply('courseidput:'.$domain.':'.$what,$coursehome); +} + +sub courseiddump { + my ($domfilter,$descfilter,$sincefilter)=@_; + my %returnhash=(); + foreach my $tryserver (keys %libserv) { + if ($hostdom{$tryserver}=~/$domfilter/) { + foreach ( + split(/\&/,&reply('courseiddump:'.$hostdom{$tryserver}.':'. + $sincefilter.':'.&escape($descfilter)))) { + my ($key,$value)=split(/\=/,$_); + if (($key) && ($value)) { + $returnhash{&unescape($key)}=&unescape($value); + } + } + + } + } + return %returnhash; +} + +# # ----------------------------------------------------------- Check out an item sub checkout {