version 1.333, 2006/06/07 01:49:43
|
version 1.337, 2006/08/25 17:22:59
|
Line 1847 sub update_resource_handler {
|
Line 1847 sub update_resource_handler {
|
my $reply=&reply("unsub:$fname","$clientname"); |
my $reply=&reply("unsub:$fname","$clientname"); |
&devalidate_meta_cache($fname); |
&devalidate_meta_cache($fname); |
unlink("$fname"); |
unlink("$fname"); |
|
unlink("$fname.meta"); |
} else { |
} else { |
my $transname="$fname.in.transfer"; |
my $transname="$fname.in.transfer"; |
my $remoteurl=&reply("sub:$fname","$clientname"); |
my $remoteurl=&reply("sub:$fname","$clientname"); |
Line 3335 sub put_course_id_handler {
|
Line 3336 sub put_course_id_handler {
|
# institutional code - optional supplied code to filter |
# institutional code - optional supplied code to filter |
# the dump. Only courses with an institutional code |
# the dump. Only courses with an institutional code |
# that match the supplied code will be returned. |
# that match the supplied code will be returned. |
# owner - optional supplied username of owner to filter |
# owner - optional supplied username and domain of owner to |
# the dump. Only courses for which the course |
# filter the dump. Only courses for which the course |
# owner matches the supplied username will be |
# owner matches the supplied username and/or domain |
# returned. Implicit assumption that owner |
# will be returned. Pre-2.2.0 legacy entries from |
# is a user in the domain in which the |
# nohist_courseiddump will only contain usernames. |
# course database is defined. |
|
# $client - The socket open on the client. |
# $client - The socket open on the client. |
# Returns: |
# Returns: |
# 1 - Continue processing. |
# 1 - Continue processing. |
Line 3363 sub dump_course_id_handler {
|
Line 3363 sub dump_course_id_handler {
|
} else { |
} else { |
$instcodefilter='.'; |
$instcodefilter='.'; |
} |
} |
|
my ($ownerunamefilter,$ownerdomfilter); |
if (defined($ownerfilter)) { |
if (defined($ownerfilter)) { |
$ownerfilter=&unescape($ownerfilter); |
$ownerfilter=&unescape($ownerfilter); |
|
if ($ownerfilter ne '.' && defined($ownerfilter)) { |
|
if ($ownerfilter =~ /^([^:]*):([^:]*)$/) { |
|
$ownerunamefilter = $1; |
|
$ownerdomfilter = $2; |
|
} else { |
|
$ownerunamefilter = $ownerfilter; |
|
$ownerdomfilter = ''; |
|
} |
|
} |
} else { |
} else { |
$ownerfilter='.'; |
$ownerfilter='.'; |
} |
} |
|
|
if (defined($coursefilter)) { |
if (defined($coursefilter)) { |
$coursefilter=&unescape($coursefilter); |
$coursefilter=&unescape($coursefilter); |
} else { |
} else { |
Line 3404 sub dump_course_id_handler {
|
Line 3415 sub dump_course_id_handler {
|
} |
} |
unless ($ownerfilter eq '.' || !defined($ownerfilter)) { |
unless ($ownerfilter eq '.' || !defined($ownerfilter)) { |
my $unescapeOwner = &unescape($owner); |
my $unescapeOwner = &unescape($owner); |
unless (eval('$unescapeOwner=~/\Q$ownerfilter\E/i')) { |
if (($ownerunamefilter ne '') && ($ownerdomfilter ne '')) { |
$match = 0; |
if ($unescapeOwner =~ /:/) { |
|
if (eval('$unescapeOwner !~ |
|
/\Q$ownerunamefilter\E:\Q$ownerdomfilter\E$/i')) { |
|
$match = 0; |
|
} |
|
} else { |
|
if (eval('$unescapeOwner!~/\Q$ownerunamefilter\E/i')) { |
|
$match = 0; |
|
} |
|
} |
|
} elsif ($ownerunamefilter ne '') { |
|
if ($unescapeOwner =~ /:/) { |
|
if (eval('$unescapeOwner!~/\Q$ownerunamefilter\E:[^:]+$/i')) { |
|
$match = 0; |
|
} |
|
} else { |
|
if (eval('$unescapeOwner!~/\Q$ownerunamefilter\E/i')) { |
|
$match = 0; |
|
} |
|
} |
|
} elsif ($ownerdomfilter ne '') { |
|
if ($unescapeOwner =~ /:/) { |
|
if (eval('$unescapeOwner!~/^[^:]+:\Q$ownerdomfilter\E/')) { |
|
$match = 0; |
|
} |
|
} else { |
|
if ($ownerdomfilter ne $udom) { |
|
$match = 0; |
|
} |
|
} |
} |
} |
} |
} |
unless ($coursefilter eq '.' || !defined($coursefilter)) { |
unless ($coursefilter eq '.' || !defined($coursefilter)) { |
Line 4043 sub enrollment_enabled_handler {
|
Line 4083 sub enrollment_enabled_handler {
|
my $userinput = $cmd.":".$tail; # For logging purposes. |
my $userinput = $cmd.":".$tail; # For logging purposes. |
|
|
|
|
my $cdom = split(/:/, $tail); # Domain we're asking about. |
my ($cdom) = split(/:/, $tail, 2); # Domain we're asking about. |
|
|
my $outcome = &localenroll::run($cdom); |
my $outcome = &localenroll::run($cdom); |
&Reply($client, "$outcome\n", $userinput); |
&Reply($client, "$outcome\n", $userinput); |
|
|
Line 4099 sub validate_course_owner_handler {
|
Line 4140 sub validate_course_owner_handler {
|
my $userinput = "$cmd:$tail"; |
my $userinput = "$cmd:$tail"; |
my ($inst_course_id, $owner, $cdom) = split(/:/, $tail); |
my ($inst_course_id, $owner, $cdom) = split(/:/, $tail); |
|
|
|
$owner = &unescape($owner); |
my $outcome = &localenroll::new_course($inst_course_id,$owner,$cdom); |
my $outcome = &localenroll::new_course($inst_course_id,$owner,$cdom); |
&Reply($client, "$outcome\n", $userinput); |
&Reply($client, "$outcome\n", $userinput); |
|
|
Line 5279 sub make_new_child {
|
Line 5321 sub make_new_child {
|
my $remotereq=<$client>; |
my $remotereq=<$client>; |
chomp($remotereq); |
chomp($remotereq); |
Debug("Got init: $remotereq"); |
Debug("Got init: $remotereq"); |
my $inikeyword = split(/:/, $remotereq); |
|
if ($remotereq =~ /^init/) { |
if ($remotereq =~ /^init/) { |
&sethost("sethost:$perlvar{'lonHostID'}"); |
&sethost("sethost:$perlvar{'lonHostID'}"); |
# |
# |
Line 5712 sub get_chat {
|
Line 5754 sub get_chat {
|
my @entries=(); |
my @entries=(); |
my $namespace = 'nohist_chatroom'; |
my $namespace = 'nohist_chatroom'; |
my $namespace_inroom = 'nohist_inchatroom'; |
my $namespace_inroom = 'nohist_inchatroom'; |
if (defined($group)) { |
if ($group ne '') { |
$namespace .= '_'.$group; |
$namespace .= '_'.$group; |
$namespace_inroom .= '_'.$group; |
$namespace_inroom .= '_'.$group; |
} |
} |
Line 5744 sub chat_add {
|
Line 5786 sub chat_add {
|
my $time=time; |
my $time=time; |
my $namespace = 'nohist_chatroom'; |
my $namespace = 'nohist_chatroom'; |
my $logfile = 'chatroom.log'; |
my $logfile = 'chatroom.log'; |
if (defined($group)) { |
if ($group ne '') { |
$namespace .= '_'.$group; |
$namespace .= '_'.$group; |
$logfile = 'chatroom_'.$group.'.log'; |
$logfile = 'chatroom_'.$group.'.log'; |
} |
} |