version 1.413, 2009/04/11 14:47:46
|
version 1.417, 2009/07/25 15:25:10
|
Line 54 use LONCAPA::lonssl;
|
Line 54 use LONCAPA::lonssl;
|
use Fcntl qw(:flock); |
use Fcntl qw(:flock); |
use Apache::lonnet; |
use Apache::lonnet; |
|
|
my $DEBUG = 1; # Non zero to enable debug log entries. |
my $DEBUG = 0; # Non zero to enable debug log entries. |
|
|
my $status=''; |
my $status=''; |
my $lastlog=''; |
my $lastlog=''; |
Line 4343 sub dump_domainroles_handler {
|
Line 4343 sub dump_domainroles_handler {
|
my ($start,$end) = split(/:/,&unescape($value)); |
my ($start,$end) = split(/:/,&unescape($value)); |
my ($trole,$uname,$udom,$runame,$rudom,$rsec) = split(/:/,&unescape($key)); |
my ($trole,$uname,$udom,$runame,$rudom,$rsec) = split(/:/,&unescape($key)); |
unless ($startfilter eq '.' || !defined($startfilter)) { |
unless ($startfilter eq '.' || !defined($startfilter)) { |
if ($start >= $startfilter) { |
if ((defined($start)) && ($start >= $startfilter)) { |
$match = 0; |
$match = 0; |
} |
} |
} |
} |
unless ($endfilter eq '.' || !defined($endfilter)) { |
unless ($endfilter eq '.' || !defined($endfilter)) { |
if ($end <= $endfilter) { |
if ((defined($end)) && ($end <= $endfilter)) { |
$match = 0; |
$match = 0; |
} |
} |
} |
} |
Line 4641 sub enrollment_enabled_handler {
|
Line 4641 sub enrollment_enabled_handler {
|
} |
} |
®ister_handler("autorun", \&enrollment_enabled_handler, 0, 1, 0); |
®ister_handler("autorun", \&enrollment_enabled_handler, 0, 1, 0); |
|
|
|
# |
|
# Validate an institutional code use for a LON-CAPA course. |
|
# |
|
# Formal Parameters: |
|
# $cmd - The command request that got us dispatched. |
|
# $tail - The tail of the command. In this case, |
|
# this is a colon separated set of words that will be split |
|
# into: |
|
# $inst_course_id - The institutional cod3 from the |
|
# institutions point of view. |
|
# $cdom - The domain from the institutions |
|
# point of view. |
|
# $client - Socket open on the client. |
|
# Returns: |
|
# 1 - Indicating processing should continue. |
|
# |
|
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); |
|
&Reply($client, \$outcome, $userinput); |
|
|
|
return 1; |
|
} |
|
®ister_handler("autovalidateinstcode", \&validate_instcode_handler, 0, 1, 0); |
|
|
# Get the official sections for which auto-enrollment is possible. |
# Get the official sections for which auto-enrollment is possible. |
# Since the admin people won't know about 'unofficial sections' |
# Since the admin people won't know about 'unofficial sections' |
# we cannot auto-enroll on them. |
# we cannot auto-enroll on them. |
Line 4928 sub get_institutional_defaults_handler {
|
Line 4955 sub get_institutional_defaults_handler {
|
®ister_handler("autoinstcodedefaults", |
®ister_handler("autoinstcodedefaults", |
\&get_institutional_defaults_handler,0,1,0); |
\&get_institutional_defaults_handler,0,1,0); |
|
|
|
sub get_possible_instcodes_handler { |
|
my ($cmd, $tail, $client) = @_; |
|
my $userinput = "$cmd:$tail"; |
|
|
|
my $reply; |
|
my $cdom = $tail; |
|
my (@codetitles,%cat_titles,%cat_order,@code_order); |
|
my $formatreply = &localenroll::possible_instcodes($cdom, |
|
\@codetitles, |
|
\%cat_titles, |
|
\%cat_order, |
|
\@code_order); |
|
if ($formatreply eq 'ok') { |
|
my $result = join('&',map {&escape($_);} (@codetitles)).':'; |
|
$result .= join('&',map {&escape($_);} (@code_order)).':'; |
|
foreach my $key (keys(%cat_titles)) { |
|
$result .= &escape($key).'='.&Apache::lonnet::freeze_escape($cat_titles{$key}).'&'; |
|
} |
|
$result =~ s/\&$//; |
|
$result .= ':'; |
|
foreach my $key (keys(%cat_order)) { |
|
$result .= &escape($key).'='.&Apache::lonnet::freeze_escape($cat_order{$key}).'&'; |
|
} |
|
$result =~ s/\&$//; |
|
&Reply($client,\$result,$userinput); |
|
} else { |
|
&Reply($client, "format_error\n", $userinput); |
|
} |
|
return 1; |
|
} |
|
®ister_handler("autopossibleinstcodes", |
|
\&get_possible_instcodes_handler,0,1,0); |
|
|
sub get_institutional_user_rules { |
sub get_institutional_user_rules { |
my ($cmd, $tail, $client) = @_; |
my ($cmd, $tail, $client) = @_; |
my $userinput = "$cmd:$tail"; |
my $userinput = "$cmd:$tail"; |