--- loncom/interface/loncreateuser.pm 2024/05/01 21:23:20 1.479 +++ 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.479 2024/05/01 21:23:20 raeburn Exp $ +# $Id: loncreateuser.pm,v 1.480 2024/05/21 02:57:15 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3378,7 +3378,7 @@ sub update_user_data { $changed{'webdav'} = &tool_admin('webdav',$newcustom{'webdav'}, \%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'); @@ -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};