version 1.1054, 2010/03/13 19:47:33
|
version 1.1055, 2010/03/15 05:10:03
|
Line 3104 sub courseiddump {
|
Line 3104 sub courseiddump {
|
return %returnhash; |
return %returnhash; |
} |
} |
|
|
|
sub courselastaccess { |
|
my ($cdom,$cnum,$hostidref) = @_; |
|
my %returnhash; |
|
if ($cdom && $cnum) { |
|
my $chome = &homeserver($cnum,$cdom); |
|
if ($chome ne 'no_host') { |
|
my $rep = &reply('courselastaccess:'.$cdom.':'.$cnum,$chome); |
|
&extract_lastaccess(\%returnhash,$rep); |
|
} |
|
} else { |
|
if (!$cdom) { $cdom=''; } |
|
my %libserv = &all_library(); |
|
foreach my $tryserver (keys(%libserv)) { |
|
if (ref($hostidref) eq 'ARRAY') { |
|
next unless (grep(/^\Q$tryserver\E$/,@{$hostidref})); |
|
} |
|
if (($cdom eq '') || (&host_domain($tryserver) eq $cdom)) { |
|
my $rep = &reply('courselastaccess:'.&host_domain($tryserver).':',$tryserver); |
|
&extract_lastaccess(\%returnhash,$rep); |
|
} |
|
} |
|
} |
|
return %returnhash; |
|
} |
|
|
|
sub extract_lastaccess { |
|
my ($returnhash,$rep) = @_; |
|
if (ref($returnhash) eq 'HASH') { |
|
unless ($rep eq 'unknown_command' || $rep eq 'no_such_host' || |
|
$rep eq 'con_lost' || $rep eq 'rejected' || $rep eq 'refused' || |
|
$rep eq '') { |
|
my @pairs=split(/\&/,$rep); |
|
foreach my $item (@pairs) { |
|
my ($key,$value)=split(/\=/,$item,2); |
|
$key = &unescape($key); |
|
next if ($key =~ /^error: 2 /); |
|
$returnhash->{$key} = &thaw_unescape($value); |
|
} |
|
} |
|
} |
|
return; |
|
} |
|
|
# ---------------------------------------------------------- DC e-mail |
# ---------------------------------------------------------- DC e-mail |
|
|
sub dcmailput { |
sub dcmailput { |