--- loncom/interface/loncommon.pm 2013/03/20 01:26:15 1.1118
+++ loncom/interface/loncommon.pm 2013/04/11 16:30:37 1.1122
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.1118 2013/03/20 01:26:15 raeburn Exp $
+# $Id: loncommon.pm,v 1.1122 2013/04/11 16:30:37 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2191,7 +2191,7 @@ sub select_level_form {
=pod
-=item * &select_dom_form($defdom,$name,$includeempty,$showdomdesc,$onchange,$incdoms)
+=item * &select_dom_form($defdom,$name,$includeempty,$showdomdesc,$onchange,$incdoms,$excdoms)
Returns a string containing a
ENDPROGBAR
&r_print($r,$content.&LCprogressbar_script($LCcurrentid));
}
@@ -8414,7 +8418,7 @@ sub get_course_users {
active => 'Active',
future => 'Future',
);
- my %nothide;
+ my (%nothide,@possdoms);
if ($hidepriv) {
my %coursehash=&Apache::lonnet::coursedescription($cdom.'_'.$cnum);
foreach my $user (split(/\s*\,\s*/,$coursehash{'nothideprivileged'})) {
@@ -8424,6 +8428,10 @@ sub get_course_users {
$nothide{$user} = 1;
}
}
+ my @possdoms = ($cdom);
+ if ($coursehash{'checkforpriv'}) {
+ push(@possdoms,split(/,/,$coursehash{'checkforpriv'}));
+ }
}
foreach my $person (sort(keys(%coursepersonnel))) {
my $match = 0;
@@ -8459,7 +8467,7 @@ sub get_course_users {
}
if ($uname ne '' && $udom ne '') {
if ($hidepriv) {
- if ((&Apache::lonnet::privileged($uname,$udom)) &&
+ if ((&Apache::lonnet::privileged($uname,$udom,\@possdoms)) &&
(!$nothide{$uname.':'.$udom})) {
next;
}
@@ -10123,7 +10131,7 @@ sub upload_embedded {
$output .= &mt('Unrecognized file extension ([_1]) - rename the file with a proper extension and re-upload.',$1).' ';
next;
} elsif ($fname=~/\.(\d+)\.(\w+)$/) {
- $output .= &mt('File name not allowed - rename the file to remove the number immediately before the file extension([_1]) and re-upload.',$2).' ';
+ $output .= &mt('Filename not allowed - rename the file to remove the number immediately before the file extension([_1]) and re-upload.',$2).' ';
next;
}
$env{'form.embedded_item_'.$i.'.filename'}=$fname;
@@ -10825,8 +10833,8 @@ sub process_decompression {
my ($docudom,$docuname,$file,$destination,$dir_root,$hiddenelem) = @_;
my ($dir,$error,$warning,$output);
if ($file !~ /\.(zip|tar|bz2|gz|tar.gz|tar.bz2|tgz)$/) {
- $error = &mt('File name not a supported archive file type.').
- ' '.&mt('File name should end with one of: [_1].',
+ $error = &mt('Filename not a supported archive file type.').
+ ' '.&mt('Filename should end with one of: [_1].',
'.zip, .tar, .bz2, .gz, .tar.gz, .tar.bz2, .tgz');
} else {
my $docuhome = &Apache::lonnet::homeserver($docuname,$docudom);
@@ -13546,6 +13554,7 @@ sub construct_course {
'pch.users.denied',
'plc.users.denied',
'hidefromcat',
+ 'checkforpriv',
'categories'],
$$crsudom,$$crsunum);
}
@@ -13602,6 +13611,11 @@ sub construct_course {
# do not hide course coordinator from staff listing,
# even if privileged
$cenv{'nothideprivileged'}=$args->{'ccuname'}.':'.$args->{'ccdomain'};
+# add course coordinator's domain to domains to check for privileged users
+# if different to course domain
+ if ($$crsudom ne $args->{'ccdomain'}) {
+ $cenv{'checkforpriv'} = $args->{'ccdomain'};
+ }
# add crosslistings
if ($args->{'crsxlist'}) {
$cenv{'internal.crosslistings'}='';