--- loncom/interface/loncreateuser.pm 2024/02/29 16:28:35 1.476 +++ loncom/interface/loncreateuser.pm 2024/05/01 15:18:58 1.477 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.476 2024/02/29 16:28:35 raeburn Exp $ +# $Id: loncreateuser.pm,v 1.477 2024/05/01 15:18:58 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -285,6 +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", 'portfolio' => "Personal User Portfolio", 'portaccess' => "Portfolio Shareable", 'timezone' => "Can set Time Zone", @@ -330,8 +331,8 @@ sub build_tools_display { &Apache::lonnet::get_dom('configuration',['quotas','authordefaults'],$ccdomain); %userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname,'tools.webdav', 'authoreditors','authormanagers', - 'domcoord.author'); - @usertools = ('webdav','editors','managers'); + 'authorarchive','domcoord.author'); + @usertools = ('webdav','editors','managers','archive'); $colspan = ' colspan="2"'; } else { %userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname, @@ -345,7 +346,7 @@ sub build_tools_display { $currdisp,$custdisp,$custradio,$onclick,$customsty,$editorsty); $cust_off = 'checked="checked" '; $tool_on = 'checked="checked" '; - unless (($context eq 'authordefaults') && ($item ne 'webdav')) { + unless (($context eq 'authordefaults') || ($item eq 'webdav')) { $curr_access = &Apache::lonnet::usertools_access($ccuname,$ccdomain,$item,undef, $context,\%userenv,'', @@ -357,7 +358,7 @@ sub build_tools_display { $cust_off = ''; } } elsif ($context eq 'authordefaults') { - if ($item eq 'editors') { + if (($item eq 'editors') || ($item eq 'archive')) { if ($userenv{'author'.$item} ne '') { $cust_on = ' checked="checked" '; $cust_off = ''; @@ -3235,7 +3236,7 @@ sub update_user_data { my @usertools = ('aboutme','blog','portfolio','portaccess','timezone'); my @requestcourses = ('official','unofficial','community','textbook','placement','lti'); my @requestauthor = ('requestauthor'); - my @authordefaults = ('webdav','editors'); + my @authordefaults = ('webdav','editors','archive'); my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($env{'form.ccdomain'}); my %canmodify_status = @@ -3367,6 +3368,12 @@ sub update_user_data { $changed{'webdav'} = &tool_admin('webdav',$newcustom{'webdav'}, \%changeHash,'authordefaults'); } + if ($env{'for.customarchive'} == 1) { + $newcustom{'archive'} = $env{'form.authordefaults_archive'}; + $changed{'archive'} = &tool_admin('archive',$newcustom{'archive'}, + \%changeHash,'authordefaults'); + + } } if ($canmodify_status{'inststatus'}) { if (exists($env{'form.inststatus'})) { @@ -3434,7 +3441,7 @@ sub update_user_data { 'id','permanentemail','portfolioquota','authorquota','inststatus', 'tools.aboutme','tools.blog','tools.webdav', 'tools.portfolio','tools.timezone','tools.portaccess', - 'authormanagers','authoreditors','requestauthor', + 'authormanagers','authoreditors','authorarchive','requestauthor', 'requestcourses.official','requestcourses.unofficial', 'requestcourses.community','requestcourses.textbook', 'requestcourses.placement','requestcourses.lti', @@ -4072,6 +4079,7 @@ sub display_userinfo { '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", 'edit' => 'Standard editor (Edit)', 'xml' => 'Text editor (EditXML)', 'daxe' => 'Daxe editor (Daxe)', @@ -4105,7 +4113,7 @@ sub display_userinfo { if ($entry eq 'requestauthor') { @items = ($entry); } elsif ($entry eq 'authordefaults') { - @items = ('webdav','managers','editors'); + @items = ('webdav','managers','editors','archive'); } else { @items = @{$requestcourses}; } @@ -4356,6 +4364,9 @@ sub tool_changes { } elsif ($tool eq 'webdav') { $envkey = 'tools.webdav'; $newval = $env{'form.'.$context.'_'.$tool}; + } elsif ($tool eq 'archive') { + $envkey = 'authorarchive'; + $newval = $env{'form.'.$context.'_'.$tool}; } } else { $newval = $env{'form.'.$context.'_'.$tool}; @@ -4387,7 +4398,7 @@ sub tool_changes { } elsif ($tool eq 'editors') { $oldaccesstext->{$tool} = &mt('can use: [_1]', join(', ', map { $tooldesc{$_} } split(/,/,$userenv->{$envkey}))); - } elsif ($tool eq 'webdav') { + } elsif (($tool eq 'webdav') || ($tool eq 'archive')) { if ($userenv->{$envkey}) { $oldaccesstext->{$tool} = &mt("availability set to 'on'"); } else { @@ -4433,7 +4444,7 @@ sub tool_changes { $managers =~ s/,/, /g; $newaccesstext->{$tool} = $managers; } - } elsif ($tool eq 'webdav') { + } elsif (($tool eq 'webdav') || ($tool eq 'archive')) { if ($newval) { $newaccesstext->{$tool} = &mt("availability set to 'on'"); } else { @@ -4473,7 +4484,7 @@ sub tool_changes { $managers =~ s/,/, /g; $newaccesstext->{$tool} = $managers; } - } elsif ($tool eq 'webdav') { + } elsif (($tool eq 'webdav') || ($tool eq 'archive')) { if ($userenv->{$envkey}) { $newaccesstext->{$tool} = &mt("availability set to 'on'"); } else { @@ -4522,7 +4533,7 @@ sub tool_changes { $managers =~ s/,/, /g; $newaccesstext->{$tool} = $managers; } - } elsif ($tool eq 'webdav') { + } elsif (($tool eq 'webdav') || ($tool eq 'archive')) { if ($userenv->{$envkey}) { $newaccesstext->{$tool} = &mt("availability set to 'on'"); } else { @@ -4570,7 +4581,7 @@ sub tool_changes { } elsif ($tool eq 'editors') { $newaccesstext->{$tool} = &mt('can use: [_1]', join(', ', map { $tooldesc{$_} } split(/,/,$newval))); - } elsif ($tool eq 'webdav') { + } elsif (($tool eq 'webdav') || ($tool eq 'archive')) { if ($newval) { $newaccesstext->{$tool} = &mt("availability set to 'on'"); } else { @@ -5234,7 +5245,7 @@ sub tool_admin { $toolchanged = 1; if ($tool eq 'requestauthor') { $changeHash->{$context} = $settool; - } elsif (($tool eq 'managers') || ($tool eq 'editors')) { + } elsif (($tool eq 'managers') || ($tool eq 'editors') || ($tool eq 'archive')) { $changeHash->{'author'.$tool} = $settool; } elsif ($tool eq 'webdav') { $changeHash->{'tools.'.$tool} = $settool;