version 1.708, 2024/01/08 18:17:50
|
version 1.709, 2024/01/10 20:07:37
|
Line 102 sub authorhosts {
|
Line 102 sub authorhosts {
|
my %outhash=(); |
my %outhash=(); |
my $home=0; |
my $home=0; |
my $other=0; |
my $other=0; |
|
my @ids=&Apache::lonnet::current_machine_ids(); |
foreach my $key (keys(%env)) { |
foreach my $key (keys(%env)) { |
if ($key=~/^user\.role\.(au|ca)\.(.+)$/) { |
if ($key=~/^user\.role\.(au|ca)\.(.+)$/) { |
my $role=$1; |
my $role=$1; |
Line 118 sub authorhosts {
|
Line 119 sub authorhosts {
|
} |
} |
my $allowed=0; |
my $allowed=0; |
my $myhome=&Apache::lonnet::homeserver($ca,$cd); |
my $myhome=&Apache::lonnet::homeserver($ca,$cd); |
my @ids=&Apache::lonnet::current_machine_ids(); |
|
foreach my $id (@ids) { |
foreach my $id (@ids) { |
if ($id eq $myhome) { |
if ($id eq $myhome) { |
$allowed=1; |
$allowed=1; |
Line 263 ENDJS
|
Line 263 ENDJS
|
add_entries => {'onload' => "hide_searching();"}, |
add_entries => {'onload' => "hide_searching();"}, |
}; |
}; |
} |
} |
$r->print(&Apache::loncommon::start_page('Copy '.$crstype.' Content to Authoring Space',$js,$starthash)."\n". |
$r->print(&Apache::loncommon::start_page('Copy uploaded content to Authoring Space',$js,$starthash)."\n". |
&Apache::lonhtmlcommon::breadcrumbs('Copy '.$crstype.' Content to Authoring Space')."\n"); |
&Apache::lonhtmlcommon::breadcrumbs('Copy uploaded content to Authoring Space')."\n"); |
$r->print(&startContentScreen('tools')); |
$r->print(&startContentScreen('tools')); |
my ($home,$other,%outhash)=&authorhosts(); |
my ($home,$other,%outhash)=&authorhosts(); |
unless ($home) { |
unless ($home) { |
Line 5965 sub handler {
|
Line 5965 sub handler {
|
&init_breadcrumbs('versions','Check/Set Resource Versions','Docs_Check_Resource_Versions'); |
&init_breadcrumbs('versions','Check/Set Resource Versions','Docs_Check_Resource_Versions'); |
&checkversions($r,$canedit); |
&checkversions($r,$canedit); |
} elsif ($canedit && $env{'form.dumpcourse'}) { |
} elsif ($canedit && $env{'form.dumpcourse'}) { |
&init_breadcrumbs('dumpcourse','Copy '.&Apache::loncommon::course_type().' Content to Authoring Space'); |
&init_breadcrumbs('dumpcourse','Copy uploaded content to Authoring Space'); |
&dumpcourse($r); |
&dumpcourse($r); |
} elsif ($canedit && $env{'form.exportcourse'}) { |
} elsif ($canedit && $env{'form.exportcourse'}) { |
&init_breadcrumbs('exportcourse','IMS Export'); |
&init_breadcrumbs('exportcourse','IMS Export'); |
Line 9407 sub dump_switchserver_js {
|
Line 9407 sub dump_switchserver_js {
|
); |
); |
my %html_js_lt = &Apache::lonlocal::texthash( |
my %html_js_lt = &Apache::lonlocal::texthash( |
swit => 'Switch server?', |
swit => 'Switch server?', |
duco => 'Copying Content to Authoring Space', |
duco => 'Copying uploaded content to Authoring Space', |
yone => 'You need to switch to a server housing an Authoring Space for which you are author or co-author.', |
yone => 'You need to switch to a server housing an Authoring Space for which you are author or co-author.', |
chos => 'Choose server', |
chos => 'Choose server', |
); |
); |
Line 9548 sub makenewproblem {
|
Line 9548 sub makenewproblem {
|
if ($redirect) { |
if ($redirect) { |
my $rightsfile = 'default.rights'; |
my $rightsfile = 'default.rights'; |
my $sourcerights = "$path/$rightsfile"; |
my $sourcerights = "$path/$rightsfile"; |
|
&Apache::loncommon::crsauthor_rights($rightsfile,$path,$docroot,$coursenum,$coursedom); |
my $targetrights = $docroot."/res/$coursedom/$coursenum/$rightsfile"; |
my $targetrights = $docroot."/res/$coursedom/$coursenum/$rightsfile"; |
my $now = time; |
|
if (!-e $sourcerights) { |
|
my $cid = $coursedom.'_'.$coursenum; |
|
if (open(my $fh,">$sourcerights")) { |
|
print $fh <<END; |
|
<accessrule effect="deny" realm="" type="course" role="" /> |
|
<accessrule effect="allow" realm="$cid" type="course" role="" /> |
|
END |
|
close($fh); |
|
} |
|
} |
|
if (!-e "$sourcerights.meta") { |
|
if (open(my $fh,">$sourcerights.meta")) { |
|
my $author=$env{'environment.firstname'}.' '. |
|
$env{'environment.middlename'}.' '. |
|
$env{'environment.lastname'}.' '. |
|
$env{'environment.generation'}; |
|
$author =~ s/\s+$//; |
|
print $fh <<"END"; |
|
|
|
<abstract></abstract> |
|
<author>$author</author> |
|
<authorspace>$coursenum:$coursedom</authorspace> |
|
<copyright>private</copyright> |
|
<creationdate>$now</creationdate> |
|
<customdistributionfile></customdistributionfile> |
|
<dependencies></dependencies> |
|
<domain>$coursedom</domain> |
|
<highestgradelevel>0</highestgradelevel> |
|
<keywords></keywords> |
|
<language>notset </language> |
|
<lastrevisiondate>$now</lastrevisiondate> |
|
<lowestgradelevel>0</lowestgradelevel> |
|
<mime>rights</mime> |
|
<modifyinguser>$env{'user.name'}:$env{'user.domain'}</modifyinguser> |
|
<notes></notes> |
|
<obsolete></obsolete> |
|
<obsoletereplacement></obsoletereplacement> |
|
<owner>$coursenum:$coursedom</owner> |
|
<rule>deny:::course,allow:$cid::course</rule> |
|
<sourceavail></sourceavail> |
|
<standards></standards> |
|
<subject></subject> |
|
<title>Course Authoring Rights</title> |
|
END |
|
close($fh); |
|
} |
|
} |
|
if ((-e $sourcerights) && (-e "$sourcerights.meta")) { |
if ((-e $sourcerights) && (-e "$sourcerights.meta")) { |
if (!-e "$docroot/res/$coursedom") { |
if (!-e "$docroot/res/$coursedom") { |
mkdir("$docroot/res/$coursedom",0755); |
mkdir("$docroot/res/$coursedom",0755); |