Diff for /loncom/interface/loncreateuser.pm between versions 1.476 and 1.477

version 1.476, 2024/02/29 16:28:35 version 1.477, 2024/05/01 15:18:58
Line 285  sub build_tools_display { Line 285  sub build_tools_display {
                    'webdav'     => "WebDAV access to Authoring Spaces (https)",                     'webdav'     => "WebDAV access to Authoring Spaces (https)",
                    'editors'    => "Available Editors",                     'editors'    => "Available Editors",
                    'managers'   => "Co-authors who can add/revoke roles",                     'managers'   => "Co-authors who can add/revoke roles",
                      'archive'    => "Managers can download tar.gz file of Authoring Space", 
                    'portfolio'  => "Personal User Portfolio",                     'portfolio'  => "Personal User Portfolio",
                    'portaccess' => "Portfolio Shareable",                     'portaccess' => "Portfolio Shareable",
                    'timezone'   => "Can set Time Zone",                     'timezone'   => "Can set Time Zone",
Line 330  sub build_tools_display { Line 331  sub build_tools_display {
             &Apache::lonnet::get_dom('configuration',['quotas','authordefaults'],$ccdomain);              &Apache::lonnet::get_dom('configuration',['quotas','authordefaults'],$ccdomain);
         %userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname,'tools.webdav',          %userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname,'tools.webdav',
                                                     'authoreditors','authormanagers',                                                      'authoreditors','authormanagers',
                                                     'domcoord.author');                                                      'authorarchive','domcoord.author');
         @usertools = ('webdav','editors','managers');          @usertools = ('webdav','editors','managers','archive');
         $colspan = ' colspan="2"';          $colspan = ' colspan="2"';
     } else {      } else {
         %userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname,          %userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname,
Line 345  sub build_tools_display { Line 346  sub build_tools_display {
             $currdisp,$custdisp,$custradio,$onclick,$customsty,$editorsty);              $currdisp,$custdisp,$custradio,$onclick,$customsty,$editorsty);
         $cust_off = 'checked="checked" ';          $cust_off = 'checked="checked" ';
         $tool_on = 'checked="checked" ';          $tool_on = 'checked="checked" ';
         unless (($context eq 'authordefaults') && ($item ne 'webdav')) {          unless (($context eq 'authordefaults') || ($item eq 'webdav')) {
             $curr_access =              $curr_access =
                 &Apache::lonnet::usertools_access($ccuname,$ccdomain,$item,undef,                  &Apache::lonnet::usertools_access($ccuname,$ccdomain,$item,undef,
                                                   $context,\%userenv,'',                                                    $context,\%userenv,'',
Line 357  sub build_tools_display { Line 358  sub build_tools_display {
                 $cust_off = '';                  $cust_off = '';
             }              }
         } elsif ($context eq 'authordefaults') {          } elsif ($context eq 'authordefaults') {
             if ($item eq 'editors') {              if (($item eq 'editors') || ($item eq 'archive')) {
                 if ($userenv{'author'.$item} ne '') {                  if ($userenv{'author'.$item} ne '') {
                     $cust_on = ' checked="checked" ';                      $cust_on = ' checked="checked" ';
                     $cust_off = '';                      $cust_off = '';
Line 3235  sub update_user_data { Line 3236  sub update_user_data {
     my @usertools = ('aboutme','blog','portfolio','portaccess','timezone');      my @usertools = ('aboutme','blog','portfolio','portaccess','timezone');
     my @requestcourses = ('official','unofficial','community','textbook','placement','lti');      my @requestcourses = ('official','unofficial','community','textbook','placement','lti');
     my @requestauthor = ('requestauthor');      my @requestauthor = ('requestauthor');
     my @authordefaults = ('webdav','editors');      my @authordefaults = ('webdav','editors','archive');
     my ($othertitle,$usertypes,$types) =       my ($othertitle,$usertypes,$types) = 
         &Apache::loncommon::sorted_inst_types($env{'form.ccdomain'});          &Apache::loncommon::sorted_inst_types($env{'form.ccdomain'});
     my %canmodify_status =      my %canmodify_status =
Line 3367  sub update_user_data { Line 3368  sub update_user_data {
                     $changed{'webdav'} = &tool_admin('webdav',$newcustom{'webdav'},                      $changed{'webdav'} = &tool_admin('webdav',$newcustom{'webdav'},
                                                   \%changeHash,'authordefaults');                                                    \%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 ($canmodify_status{'inststatus'}) {
                 if (exists($env{'form.inststatus'})) {                  if (exists($env{'form.inststatus'})) {
Line 3434  sub update_user_data { Line 3441  sub update_user_data {
              'id','permanentemail','portfolioquota','authorquota','inststatus',               'id','permanentemail','portfolioquota','authorquota','inststatus',
              'tools.aboutme','tools.blog','tools.webdav',               'tools.aboutme','tools.blog','tools.webdav',
              'tools.portfolio','tools.timezone','tools.portaccess',               'tools.portfolio','tools.timezone','tools.portaccess',
              'authormanagers','authoreditors','requestauthor',               'authormanagers','authoreditors','authorarchive','requestauthor',
              'requestcourses.official','requestcourses.unofficial',               'requestcourses.official','requestcourses.unofficial',
              'requestcourses.community','requestcourses.textbook',               'requestcourses.community','requestcourses.textbook',
              'requestcourses.placement','requestcourses.lti',               'requestcourses.placement','requestcourses.lti',
Line 4072  sub display_userinfo { Line 4079  sub display_userinfo {
          'chto'           => 'Changed To:',           'chto'           => 'Changed To:',
          'editors'        => "Available Editors in Authoring Space",           'editors'        => "Available Editors in Authoring Space",
          'managers'       => "Co-authors who can add/revoke roles",           'managers'       => "Co-authors who can add/revoke roles",
            'archive'        => "Managers can download tar.gz file of Authoring Space",
          'edit'           => 'Standard editor (Edit)',           'edit'           => 'Standard editor (Edit)',
          'xml'            => 'Text editor (EditXML)',           'xml'            => 'Text editor (EditXML)',
          'daxe'           => 'Daxe editor (Daxe)',           'daxe'           => 'Daxe editor (Daxe)',
Line 4105  sub display_userinfo { Line 4113  sub display_userinfo {
                     if ($entry eq 'requestauthor') {                      if ($entry eq 'requestauthor') {
                         @items = ($entry);                          @items = ($entry);
                     } elsif ($entry eq 'authordefaults') {                      } elsif ($entry eq 'authordefaults') {
                         @items = ('webdav','managers','editors');                          @items = ('webdav','managers','editors','archive');
                     } else {                      } else {
                         @items = @{$requestcourses};                          @items = @{$requestcourses};
                     }                      }
Line 4356  sub tool_changes { Line 4364  sub tool_changes {
             } elsif ($tool eq 'webdav') {              } elsif ($tool eq 'webdav') {
                 $envkey = 'tools.webdav';                  $envkey = 'tools.webdav';
                 $newval = $env{'form.'.$context.'_'.$tool};                  $newval = $env{'form.'.$context.'_'.$tool};
               } elsif ($tool eq 'archive') {
                   $envkey = 'authorarchive';
                   $newval = $env{'form.'.$context.'_'.$tool};
             }              }
         } else {          } else {
             $newval = $env{'form.'.$context.'_'.$tool};              $newval = $env{'form.'.$context.'_'.$tool};
Line 4387  sub tool_changes { Line 4398  sub tool_changes {
                 } elsif ($tool eq 'editors') {                  } elsif ($tool eq 'editors') {
                     $oldaccesstext->{$tool} = &mt('can use: [_1]',                      $oldaccesstext->{$tool} = &mt('can use: [_1]',
                                                   join(', ', map { $tooldesc{$_} } split(/,/,$userenv->{$envkey})));                                                    join(', ', map { $tooldesc{$_} } split(/,/,$userenv->{$envkey})));
                 } elsif ($tool eq 'webdav') {                  } elsif (($tool eq 'webdav') || ($tool eq 'archive')) {
                     if ($userenv->{$envkey}) {                      if ($userenv->{$envkey}) {
                         $oldaccesstext->{$tool} = &mt("availability set to 'on'");                          $oldaccesstext->{$tool} = &mt("availability set to 'on'");
                     } else {                      } else {
Line 4433  sub tool_changes { Line 4444  sub tool_changes {
                                     $managers =~ s/,/, /g;                                      $managers =~ s/,/, /g;
                                     $newaccesstext->{$tool} = $managers;                                      $newaccesstext->{$tool} = $managers;
                                 }                                  }
                             } elsif ($tool eq 'webdav') {                              } elsif (($tool eq 'webdav') || ($tool eq 'archive')) {
                                 if ($newval) {                                  if ($newval) {
                                     $newaccesstext->{$tool} = &mt("availability set to 'on'");                                      $newaccesstext->{$tool} = &mt("availability set to 'on'");
                                 } else {                                  } else {
Line 4473  sub tool_changes { Line 4484  sub tool_changes {
                                     $managers =~ s/,/, /g;                                      $managers =~ s/,/, /g;
                                     $newaccesstext->{$tool} = $managers;                                      $newaccesstext->{$tool} = $managers;
                                 }                                  }
                             } elsif ($tool eq 'webdav') {                              } elsif (($tool eq 'webdav') || ($tool eq 'archive')) {
                                 if ($userenv->{$envkey}) {                                  if ($userenv->{$envkey}) {
                                     $newaccesstext->{$tool} = &mt("availability set to 'on'");                                      $newaccesstext->{$tool} = &mt("availability set to 'on'");
                                 } else {                                  } else {
Line 4522  sub tool_changes { Line 4533  sub tool_changes {
                                 $managers =~ s/,/, /g;                                  $managers =~ s/,/, /g;
                                 $newaccesstext->{$tool} = $managers;                                  $newaccesstext->{$tool} = $managers;
                             }                              }
                         } elsif ($tool eq 'webdav') {                          } elsif (($tool eq 'webdav') || ($tool eq 'archive')) {
                             if ($userenv->{$envkey}) {                              if ($userenv->{$envkey}) {
                                 $newaccesstext->{$tool} = &mt("availability set to 'on'");                                  $newaccesstext->{$tool} = &mt("availability set to 'on'");
                             } else {                              } else {
Line 4570  sub tool_changes { Line 4581  sub tool_changes {
                         } elsif ($tool eq 'editors') {                          } elsif ($tool eq 'editors') {
                             $newaccesstext->{$tool} = &mt('can use: [_1]',                              $newaccesstext->{$tool} = &mt('can use: [_1]',
                                                           join(', ', map { $tooldesc{$_} } split(/,/,$newval)));                                                            join(', ', map { $tooldesc{$_} } split(/,/,$newval)));
                         } elsif ($tool eq 'webdav') {                          } elsif (($tool eq 'webdav') || ($tool eq 'archive')) {
                             if ($newval) {                              if ($newval) {
                                 $newaccesstext->{$tool} = &mt("availability set to 'on'");                                  $newaccesstext->{$tool} = &mt("availability set to 'on'");
                             } else {                              } else {
Line 5234  sub tool_admin { Line 5245  sub tool_admin {
             $toolchanged = 1;              $toolchanged = 1;
             if ($tool eq 'requestauthor') {              if ($tool eq 'requestauthor') {
                 $changeHash->{$context} = $settool;                  $changeHash->{$context} = $settool;
             } elsif (($tool eq 'managers') || ($tool eq 'editors')) {              } elsif (($tool eq 'managers') || ($tool eq 'editors') || ($tool eq 'archive')) {
                 $changeHash->{'author'.$tool} = $settool;                  $changeHash->{'author'.$tool} = $settool;
             } elsif ($tool eq 'webdav') {              } elsif ($tool eq 'webdav') {
                 $changeHash->{'tools.'.$tool} = $settool;                  $changeHash->{'tools.'.$tool} = $settool;

Removed from v.1.476  
changed lines
  Added in v.1.477


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>