version 1.683, 2005/11/22 00:01:53
|
version 1.686, 2005/12/19 21:03:53
|
Line 40 qw(%perlvar %hostname %badServerCache %i
|
Line 40 qw(%perlvar %hostname %badServerCache %i
|
%courselogs %accesshash %userrolehash %domainrolehash $processmarker $dumpcount |
%courselogs %accesshash %userrolehash %domainrolehash $processmarker $dumpcount |
%coursedombuf %coursenumbuf %coursehombuf %coursedescrbuf %courseinstcodebuf %courseownerbuf |
%coursedombuf %coursenumbuf %coursehombuf %coursedescrbuf %courseinstcodebuf %courseownerbuf |
%domaindescription %domain_auth_def %domain_auth_arg_def |
%domaindescription %domain_auth_def %domain_auth_arg_def |
%domain_lang_def %domain_city %domain_longi %domain_lati $tmpdir $_64bit |
%domain_lang_def %domain_city %domain_longi %domain_lati %domain_primary |
%env); |
$tmpdir $_64bit %env); |
|
|
use IO::Socket; |
use IO::Socket; |
use GDBM_File; |
use GDBM_File; |
Line 1280 sub clean_filename {
|
Line 1280 sub clean_filename {
|
} |
} |
|
|
# --------------- Take an uploaded file and put it into the userfiles directory |
# --------------- Take an uploaded file and put it into the userfiles directory |
# input: name of form element, coursedoc=1 means this is for the course |
# input: $formname - the contents of the file are in $env{"form.$formname"} |
# output: url of file in userspace |
# the desired filenam is in $env{"form.$formname"} |
|
# $coursedoc - if true up to the current course |
|
# if false |
|
# $subdir - directory in userfile to store the file into |
|
# $parser, $allfiles, $codebase - unknown |
|
# |
|
# output: url of file in userspace, or error: <message> |
|
# or /adm/notfound.html if failure to upload occurse |
|
|
|
|
sub userfileupload { |
sub userfileupload { |
Line 1853 sub courseiddump {
|
Line 1860 sub courseiddump {
|
# ---------------------------------------------------------- DC e-mail |
# ---------------------------------------------------------- DC e-mail |
|
|
sub dcmailput { |
sub dcmailput { |
my ($domain,$msgid,$contents,$server)=@_; |
my ($domain,$msgid,$message,$server)=@_; |
my $status = &Apache::lonnet::critical( |
my $status = &Apache::lonnet::critical( |
'dcmailput:'.$domain.':'.&Apache::lonnet::escape($msgid).'='. |
'dcmailput:'.$domain.':'.&Apache::lonnet::escape($msgid).'='. |
&Apache::lonnet::escape($$contents{$server}),$server); |
&Apache::lonnet::escape($message),$server); |
return $status; |
return $status; |
} |
} |
|
|
sub dcmaildump { |
sub dcmaildump { |
my ($dom,$startdate,$enddate,$senders) = @_; |
my ($dom,$startdate,$enddate,$senders) = @_; |
my %returnhash=(); |
my %returnhash=(); |
foreach my $tryserver (keys(%libserv)) { |
if (exists($domain_primary{$dom})) { |
if ($hostdom{$tryserver} eq $dom) { |
my $cmd='dcmaildump:'.$dom.':'.&escape($startdate).':'. |
%{$returnhash{$tryserver}}=(); |
&escape($enddate).':'; |
my $cmd='dcmaildump:'.$dom.':'. |
my @esc_senders=map { &escape($_)} @$senders; |
&escape($startdate).':'.&escape($enddate).':'; |
$cmd.=&escape(join('&',@esc_senders)); |
my @esc_senders=map { &escape($_)} @$senders; |
foreach (split(/\&/,&reply($cmd,$domain_primary{$dom}))) { |
$cmd.=&escape(join('&',@esc_senders)); |
my ($key,$value) = split(/\=/,$_); |
foreach (split(/\&/,&reply($cmd,$tryserver))) { |
if (($key) && ($value)) { |
my ($key,$value) = split(/\=/,$_); |
$returnhash{&unescape($key)} = &unescape($value); |
if (($key) && ($value)) { |
|
$returnhash{$tryserver}{&unescape($key)} = &unescape($value); |
|
} |
|
} |
} |
} |
} |
} |
} |
Line 3718 sub modify_group_roles {
|
Line 3722 sub modify_group_roles {
|
my $role = 'gr/'.&escape($userprivs); |
my $role = 'gr/'.&escape($userprivs); |
my ($uname,$udom) = split(/:/,$user); |
my ($uname,$udom) = split(/:/,$user); |
my $result = &assignrole($udom,$uname,$url,$role,$end,$start); |
my $result = &assignrole($udom,$uname,$url,$role,$end,$start); |
|
if ($result eq 'ok') { |
|
&devalidate_getgroups_cache($udom,$uname,$cdom,$cnum); |
|
} |
|
|
return $result; |
return $result; |
} |
} |
|
|
Line 4801 sub EXT {
|
Line 4809 sub EXT {
|
return $env{'course.'.$courseid.'.'.$spacequalifierrest}; |
return $env{'course.'.$courseid.'.'.$spacequalifierrest}; |
} elsif ($realm eq 'resource') { |
} elsif ($realm eq 'resource') { |
|
|
my $section; |
my ($section,$group); |
|
my @groups = (); |
if (defined($courseid) && $courseid eq $env{'request.course.id'}) { |
if (defined($courseid) && $courseid eq $env{'request.course.id'}) { |
if (!$symbparm) { $symbparm=&symbread(); } |
if (!$symbparm) { $symbparm=&symbread(); } |
} |
} |
Line 4821 sub EXT {
|
Line 4830 sub EXT {
|
if (($env{'user.name'} eq $uname) && |
if (($env{'user.name'} eq $uname) && |
($env{'user.domain'} eq $udom)) { |
($env{'user.domain'} eq $udom)) { |
$section=$env{'request.course.sec'}; |
$section=$env{'request.course.sec'}; |
|
@groups=split(/:/,$env{'request.course.groups'}); |
|
if (@groups > 0) { |
|
@groups = sort(@groups); |
|
$group = $groups[0]; |
|
} |
} else { |
} else { |
if (! defined($usection)) { |
if (! defined($usection)) { |
$section=&getsection($udom,$uname,$courseid); |
$section=&getsection($udom,$uname,$courseid); |
} else { |
} else { |
$section = $usection; |
$section = $usection; |
} |
} |
|
my $grouplist = &get_users_groups($udom,$uname,$courseid); |
|
if ($grouplist) { |
|
@groups = split(/:/,$grouplist); |
|
@groups = sort(@groups); |
|
$group = $groups[0]; |
|
} |
} |
} |
|
|
|
my $grplevel=$courseid.'.['.$group.'].'.$spacequalifierrest; |
|
my $grplevelr=$courseid.'.['.$group.'].'.$symbparm; |
|
my $grplevelm=$courseid.'.['.$group.'].'.$mapparm; |
|
|
my $seclevel=$courseid.'.['.$section.'].'.$spacequalifierrest; |
my $seclevel=$courseid.'.['.$section.'].'.$spacequalifierrest; |
my $seclevelr=$courseid.'.['.$section.'].'.$symbparm; |
my $seclevelr=$courseid.'.['.$section.'].'.$symbparm; |
my $seclevelm=$courseid.'.['.$section.'].'.$mapparm; |
my $seclevelm=$courseid.'.['.$section.'].'.$mapparm; |
Line 4846 sub EXT {
|
Line 4870 sub EXT {
|
if (defined($userreply)) { return $userreply; } |
if (defined($userreply)) { return $userreply; } |
|
|
# ------------------------------------------------ second, check some of course |
# ------------------------------------------------ second, check some of course |
|
my $coursereply; |
|
if (defined($group)) { |
|
$coursereply = &resdata($env{'course.'.$courseid.'.num'}, |
|
$env{'course.'.$courseid.'.domain'}, |
|
'course', |
|
($grplevelr,$grplevelm,$grplevel, |
|
$courselevelr)); |
|
if (defined($coursereply)) { return $coursereply; } |
|
} |
|
|
my $coursereply=&resdata($env{'course.'.$courseid.'.num'}, |
$coursereply=&resdata($env{'course.'.$courseid.'.num'}, |
$env{'course.'.$courseid.'.domain'}, |
$env{'course.'.$courseid.'.domain'}, |
'course', |
'course', |
($seclevelr,$seclevelm,$seclevel, |
($seclevelr,$seclevelm,$seclevel, |
Line 6185 BEGIN {
|
Line 6218 BEGIN {
|
# next if /^\#/; |
# next if /^\#/; |
chomp; |
chomp; |
my ($domain, $domain_description, $def_auth, $def_auth_arg, |
my ($domain, $domain_description, $def_auth, $def_auth_arg, |
$def_lang, $city, $longi, $lati) = split(/:/,$_); |
$def_lang, $city, $longi, $lati, $primary) = split(/:/,$_); |
$domain_auth_def{$domain}=$def_auth; |
$domain_auth_def{$domain}=$def_auth; |
$domain_auth_arg_def{$domain}=$def_auth_arg; |
$domain_auth_arg_def{$domain}=$def_auth_arg; |
$domaindescription{$domain}=$domain_description; |
$domaindescription{$domain}=$domain_description; |
Line 6193 BEGIN {
|
Line 6226 BEGIN {
|
$domain_city{$domain}=$city; |
$domain_city{$domain}=$city; |
$domain_longi{$domain}=$longi; |
$domain_longi{$domain}=$longi; |
$domain_lati{$domain}=$lati; |
$domain_lati{$domain}=$lati; |
|
$domain_primary{$domain}=$primary; |
|
|
# &logthis("Domain.tab: $domain, $domain_auth_def{$domain}, $domain_auth_arg_def{$domain},$domaindescription{$domain}"); |
# &logthis("Domain.tab: $domain, $domain_auth_def{$domain}, $domain_auth_arg_def{$domain},$domaindescription{$domain}"); |
# &logthis("Domain.tab: $domain ".$domaindescription{$domain} ); |
# &logthis("Domain.tab: $domain ".$domaindescription{$domain} ); |