[LON-CAPA-cvs] cvs: loncom / loncapa_apache.conf /cgi archive.pl /interface domainprefs.pm loncreateuser.pm lonmenu.pm /lonnet/perl lonnet.pm

raeburn raeburn at source.lon-capa.org
Sun Aug 23 15:16:31 EDT 2026


raeburn		Sun Aug 23 19:16:31 2026 EDT

  Modified files:              
    /loncom	loncapa_apache.conf 
    /loncom/interface	domainprefs.pm lonmenu.pm loncreateuser.pm 
    /loncom/lonnet/perl	lonnet.pm 
    /loncom/cgi	archive.pl 
  Log:
  - Authoring Space defaults for creation of archive file, which can be
    overridden for a specific Authoring Space, applies to both author and
    co-author manager(s), if any.
  
  
-------------- next part --------------
Index: loncom/loncapa_apache.conf
diff -u loncom/loncapa_apache.conf:1.215.2.25.2.3 loncom/loncapa_apache.conf:1.215.2.25.2.4
--- loncom/loncapa_apache.conf:1.215.2.25.2.3	Thu Sep 10 21:23:00 2020
+++ loncom/loncapa_apache.conf	Fri Sep 11 22:42:00 2020
@@ -2,7 +2,7 @@
 ## loncapa_apache.conf -- Apache HTTP LON-CAPA configuration file
 ##
 
-# $Id: loncapa_apache.conf,v 1.215.2.25.2.3 2020/09/10 21:23:00 raeburn Exp $
+# $Id: loncapa_apache.conf,v 1.215.2.25.2.4 2020/09/11 22:42:00 raeburn Exp $
 
 #
 # LON-CAPA Section (extensions to httpd.conf daemon configuration)
@@ -150,6 +150,10 @@
 ErrorDocument	  500 /adm/errorhandler
 </LocationMatch>
 
+<LocationMatch "^/+uploaded/.+/.+/(portfolio|feedback|docs|groups)/.+">
+   Options +FollowSymLinks -Includes
+</LocationMatch>
+
 <LocationMatch "^/+editupload.*">
 AuthType LONCAPA
 Require valid-user
@@ -1598,10 +1602,6 @@
    DirectoryIndex disabled
 </DirectoryMatch>
 
-<DirectoryMatch "^/home/httpd/lonUsers/*">
-   Options +FollowSymLinks -Includes
-</DirectoryMatch>
-
 # ============================================================= Access Handlers
 
 # ------------------------------------------------- Allow server-status reports
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.462 loncom/interface/domainprefs.pm:1.463
--- loncom/interface/domainprefs.pm:1.462	Thu Aug 20 20:51:47 2026
+++ loncom/interface/domainprefs.pm	Sun Aug 23 19:16:30 2026
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set domain-wide configuration settings
 #
-# $Id: domainprefs.pm,v 1.462 2026/08/20 20:51:47 raeburn Exp $
+# $Id: domainprefs.pm,v 1.463 2026/08/23 19:16:30 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -7868,15 +7868,10 @@
         }
         $datatable .= '</fieldset></td></tr>';
         $itemcount ++;
-        my %defchecked = (
-                                'archive' => 'off',
-                             );
-        my @toggles = ('archive');
         (my $archive,$itemcount) = &radiobutton_prefs($settings,['archive'],
                                                       {'archive' => 'off'},
                                                       \%titles,$itemcount);
         $datatable .= $archive."\n";
-        $itemcount ++;
     }
     $$rowtotal += $itemcount;
     return $datatable;
@@ -7900,7 +7895,7 @@
                none => 'No override set',
                overon => 'Override -- webDAV on',
                overoff => 'Override -- webDAV off',
-               archive => 'Authors can download tar.gz file of Authoring Space',
+               archive => 'Authors and co-author managers can download tar.gz file of Authoring Space',
     );
 }
 
@@ -14008,6 +14003,7 @@
     my @webdavon = &Apache::loncommon::get_env_multiple('form.webdav');
     my %webdav;
     map { $webdav{$_} = 1; } @webdavon;
+    my @offon = ('off','on');
     foreach my $type (@insttypes,'default') {
         my $possquota = $env{'form.authorquota_'.$type};
         if ($possquota =~ /^\d+$/) {
@@ -14024,9 +14020,19 @@
     }
     if (ref($domconfig{'authordefaults'}) eq 'HASH') {
         foreach my $item ('nocodemirror','daxecollapse','domcoordacc','copyright','sourceavail','archive') {
-            if ($domconfig{'authordefaults'}{$item} ne $confhash{$item}) {
-                $changes{$item} = 1;
-             }
+            if (exists($domconfig{'authordefaults'}{$item})) {
+                if ($domconfig{'authordefaults'}{$item} ne $confhash{$item}) {
+                    $changes{$item} = 1;
+                }
+            } else {
+                if (($item eq 'copyright') || ($item eq 'sourceavail')) {
+                    if ($confhash{$item} ne $staticdefaults{$item}) {
+                        $changes{$item} = 1;
+                    }
+                } elsif ($offon[$confhash{$item}] ne $staticdefaults{$item}) {
+                    $changes{$item} = 1;
+                }
+            }
         }
         if (ref($domconfig{'authordefaults'}{'editors'}) eq 'ARRAY') {
             my @diffs =
@@ -14044,7 +14050,6 @@
             }
         }
     } else {
-        my @offon = ('off','on');
         foreach my $item ('nocodemirror','daxecollapse','domcoordacc','archive') {
             if ($offon[$confhash{$item}] ne $staticdefaults{$item}) {
                 $changes{$item} = 1; 
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.574 loncom/interface/lonmenu.pm:1.575
--- loncom/interface/lonmenu.pm:1.574	Thu Apr 16 22:41:05 2026
+++ loncom/interface/lonmenu.pm	Sun Aug 23 19:16:30 2026
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.574 2026/04/16 22:41:05 raeburn Exp $
+# $Id: lonmenu.pm,v 1.575 2026/08/23 19:16:30 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1295,8 +1295,10 @@
 s&7&1&del.png&Delete&dir[_3]&gocstr('/adm/cfile?action=delete','$esc_currdir')&Delete this Directory
 ENDMENUITEMS
                 unless ($crsauthor_cstr) {
-                    if (($env{'environment.canarchive'}) &&
-                        ($uname eq $env{'user.name'}) && ($udom eq $env{'user.domain'})) {
+                    if ((($env{'environment.canarchive'}) &&
+                         ($uname eq $env{'user.name'}) && ($udom eq $env{'user.domain'})) ||
+                        (($env{"environment.internal.manager./$udom/$uname"}) &&
+                         ($env{"environment.internal.archive./$udom/$uname"}))) {
                         $menuitems .= (<<ENDMENUITEMS);
 s&7&7&archive.png&Export&dir[_1]&gocstr('/adm/cfile?action=archive','$esc_currdir')&Export Authoring Space Archive
 ENDMENUITEMS
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.497 loncom/interface/loncreateuser.pm:1.498
--- loncom/interface/loncreateuser.pm:1.497	Tue May 26 01:52:21 2026
+++ loncom/interface/loncreateuser.pm	Sun Aug 23 19:16:30 2026
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Create a user
 #
-# $Id: loncreateuser.pm,v 1.497 2026/05/26 01:52:21 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.498 2026/08/23 19:16:30 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -285,7 +285,7 @@
                    'webdav'     => "WebDAV access to Authoring Spaces (https)",
                    'editors'    => "Available Editors",
                    'managers'   => "Co-authors who can add/revoke roles",
-                   'archive'    => "Managers can download tar.gz file of Authoring Space",
+                   'archive'    => "Author and Managers can download tar.gz file of Authoring Space",
                    'portfolio'  => "Personal User Portfolio",
                    'portaccess' => "Portfolio Shareable",
                    'timezone'   => "Can set Time Zone",
@@ -4187,7 +4187,7 @@
          'chto'           => 'Changed To:',
          'editors'        => "Available Editors in Authoring Space",
          'managers'       => "Co-authors who can add/revoke roles",
-         'archive'        => "Managers can download tar.gz file of Authoring Space",
+         'archive'        => "Author and Managers can download tar.gz file of Authoring Space",
          'edit'           => 'Standard editor (Edit)',
          'xml'            => 'Text editor (EditXML)',
          'daxe'           => 'Daxe editor (Daxe)',
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1549 loncom/lonnet/perl/lonnet.pm:1.1550
--- loncom/lonnet/perl/lonnet.pm:1.1549	Thu Aug 20 20:51:47 2026
+++ loncom/lonnet/perl/lonnet.pm	Sun Aug 23 19:16:30 2026
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1549 2026/08/20 20:51:47 raeburn Exp $
+# $Id: lonnet.pm,v 1.1550 2026/08/23 19:16:30 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -7198,15 +7198,15 @@
             if (($trole eq 'ca') || ($trole eq 'aa')) {
                 (undef,my ($audom,$auname)) = split(/\//,$area);
                 unless ($gotcoauconfig{$area}) {
-                    my @ca_settings = ('authoreditors','coauthorlist','coauthoroptin');
+                    my @ca_settings = ('authoreditors','coauthorlist','coauthoroptin','authorarchive');
                     my %info = &userenvironment($audom,$auname, at ca_settings);
                     $gotcoauconfig{$area} = 1;
                     foreach my $item (@ca_settings) {
                         if (exists($info{$item})) {
                             my $name = $item;
-                            if ($item eq 'authoreditors') {
-                                $name = 'editors';
-                                unless ($info{'authoreditors'}) {
+                            if (($item eq 'authoreditors') || ($item eq 'authorarchive')) {
+                                $name =~ s/^author//;
+                                if ($info{$item} eq '') {
                                     my %domdefs;
                                     if (ref($domdefaults{$audom}) eq 'HASH') {
                                         %domdefs = %{$domdefaults{$audom}};
@@ -7214,10 +7214,14 @@
                                         %domdefs = &get_domain_defaults($audom);
                                         $domdefaults{$audom} = \%domdefs;
                                     }
-                                    if ($domdefs{$name} ne '') {
-                                        $info{'authoreditors'} = $domdefs{$name};
+                                    if ($domdefs{$name} eq '') {
+                                        if ($item eq 'authoreditors') {
+                                            $info{$item} = 'edit,xml';
+                                        } else {
+                                            $info{$item} = '0';
+                                        }
                                     } else {
-                                        $info{'authoreditors'} = 'edit,xml';
+                                        $info{$item} = $domdefs{$name};
                                     }
                                 }
                             }
Index: loncom/cgi/archive.pl
diff -u loncom/cgi/archive.pl:1.4 loncom/cgi/archive.pl:1.5
--- loncom/cgi/archive.pl:1.4	Sun Jun 28 23:51:07 2026
+++ loncom/cgi/archive.pl	Sun Aug 23 19:16:31 2026
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 #
-# $Id: archive.pl,v 1.4 2026/06/28 23:51:07 raeburn Exp $
+# $Id: archive.pl,v 1.5 2026/08/23 19:16:31 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -99,8 +99,10 @@
                     $prefix = $londocroot.$dirurl;
                     $maxdepth = $prefix =~ tr{/}{};
                     $jsdirurl = &js_escape($dirurl);
-                    if (($auname eq $env{'user.name'}) && ($audom eq $env{'user.domain'}) &&
-                        ($env{'environment.canarchive'})) {
+                    if ((($auname eq $env{'user.name'}) && ($audom eq $env{'user.domain'}) &&
+                         ($env{'environment.canarchive'})) ||
+                        (($env{"environment.internal.manager./$audom/$auname"}) &&
+                         ($env{"environment.internal.archive./$audom/$auname"}))) {
                         $allowed = 1;
                         if ($hashref->{'recurse'}) {
                             $recurse = 1;


More information about the LON-CAPA-cvs mailing list