--- loncom/interface/loncreateuser.pm 2024/05/01 21:22:09 1.478 +++ loncom/interface/loncreateuser.pm 2024/05/21 02:57:15 1.480 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.478 2024/05/01 21:22:09 raeburn Exp $ +# $Id: loncreateuser.pm,v 1.480 2024/05/21 02:57:15 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -285,7 +285,7 @@ sub build_tools_display { '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' => "Managers can download tar.gz file of Authoring Space", 'portfolio' => "Personal User Portfolio", 'portaccess' => "Portfolio Shareable", 'timezone' => "Can set Time Zone", @@ -3376,12 +3376,12 @@ sub update_user_data { if ($env{'form.customwebdav'} == 1) { $newcustom{'webdav'} = $env{'form.authordefaults_webdav'}; $changed{'webdav'} = &tool_admin('webdav',$newcustom{'webdav'}, - \%changeHash,'authordefaults'); + \%changeHash,'authordefaults'); } - if ($env{'for.customarchive'} == 1) { + if ($env{'form.customarchive'} == 1) { $newcustom{'archive'} = $env{'form.authordefaults_archive'}; $changed{'archive'} = &tool_admin('archive',$newcustom{'archive'}, - \%changeHash,'authordefaults'); + \%changeHash,'authordefaults'); } } @@ -3867,6 +3867,21 @@ sub update_user_data { $newenvhash{'environment.editors'} = 'edit,xml'; } } + } elsif ($key eq 'archive') { + $newenvhash{'environment.author.'.$key} = + $changeHash{'author.'.$key}; + if ($changeHash{'author.'.$key} ne '') { + $newenvhash{'environment.canarchive'} = + $changeHash{'author.'.$key}; + } else { + unless ($got_domdefs) { + %domdefaults = + &Apache::lonnet::get_domain_defaults($env{'user.domain'}); + $got_domdefs = 1; + } + $newenvhash{'environment.canarchive'} = + $domdefaults{'archive'}; + } } elsif ($key ne 'quota') { $newenvhash{'environment.tools.'.$key} = $changeHash{'tools.'.$key};