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

version 1.472, 2023/11/04 00:06:00 version 1.476, 2024/02/29 16:28:35
Line 245  function toggleCustom(form,item,name) { Line 245  function toggleCustom(form,item,name) {
         if (radioname) {          if (radioname) {
             if (radioname.length > 0) {              if (radioname.length > 0) {
                 var setvis;                  var setvis;
                   var RegExp = /^customtext_(aboutme|blog|portfolio|portaccess|timezone|webdav)\$/;
                 for (var i=0; i<radioname.length; i++) {                  for (var i=0; i<radioname.length; i++) {
                     if (radioname[i].checked == true) {                      if (radioname[i].checked == true) {
                         if (radioname[i].value == 1) {                          if (radioname[i].value == 1) {
                             divid.style.display = 'block';                              if (RegExp.test(item)) {
                                   divid.style.display = 'inline';
                               } else {
                                   divid.style.display = 'block';
                               }
                             setvis = 1;                              setvis = 1;
                         }                          }
                         break;                          break;
Line 273  sub build_tools_display { Line 278  sub build_tools_display {
     my ($ccuname,$ccdomain,$context) = @_;      my ($ccuname,$ccdomain,$context) = @_;
     my (@usertools,%userenv,$output,@options,%validations,%reqtitles,%reqdisplay,      my (@usertools,%userenv,$output,@options,%validations,%reqtitles,%reqdisplay,
         $colspan,$isadv,%domconfig,@defaulteditors,@customeditors,@custommanagers,          $colspan,$isadv,%domconfig,@defaulteditors,@customeditors,@custommanagers,
         @possmanagers,$editorsty,$customsty);          @possmanagers);
     my %lt = &Apache::lonlocal::texthash (      my %lt = &Apache::lonlocal::texthash (
                    'blog'       => "Personal User Blog",                     'blog'       => "Personal User Blog",
                    'aboutme'    => "Personal Information Page",                     'aboutme'    => "Personal Information Page",
                    '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 co-authors",                     'managers'   => "Co-authors who can add/revoke roles",
                    '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 337  sub build_tools_display { Line 342  sub build_tools_display {
     }      }
     foreach my $item (@usertools) {      foreach my $item (@usertools) {
         my ($custom_access,$curr_access,$cust_on,$cust_off,$tool_on,$tool_off,          my ($custom_access,$curr_access,$cust_on,$cust_off,$tool_on,$tool_off,
             $currdisp,$custdisp,$custradio,$onclick);              $currdisp,$custdisp,$custradio,$onclick,$customsty,$editorsty);
         $cust_off = 'checked="checked" ';          $cust_off = 'checked="checked" ';
         $tool_on = 'checked="checked" ';          $tool_on = 'checked="checked" ';
         $curr_access =          unless (($context eq 'authordefaults') && ($item ne 'webdav')) {
             &Apache::lonnet::usertools_access($ccuname,$ccdomain,$item,undef,              $curr_access =
                                               $context,\%userenv,'',                  &Apache::lonnet::usertools_access($ccuname,$ccdomain,$item,undef,
                                               {'is_adv' => $isadv});                                                    $context,\%userenv,'',
                                                     {'is_adv' => $isadv});
           }
         if ($context eq 'requestauthor') {          if ($context eq 'requestauthor') {
             if ($userenv{$context} ne '') {              if ($userenv{$context} ne '') {
                 $cust_on = ' checked="checked" ';                  $cust_on = ' checked="checked" ';
Line 474  sub build_tools_display { Line 481  sub build_tools_display {
                    '  </tr>'."\n".                     '  </tr>'."\n".
                    &Apache::loncommon::start_data_table_row()."\n";                     &Apache::loncommon::start_data_table_row()."\n";
         if (($context eq 'requestcourses') || ($context eq 'requestauthor')) {          if (($context eq 'requestcourses') || ($context eq 'requestauthor')) {
             my ($curroption,$currlimit,$customsty);              my ($curroption,$currlimit);
             my $envkey = $context.'.'.$item;              my $envkey = $context.'.'.$item;
             if ($context eq 'requestauthor') {              if ($context eq 'requestauthor') {
                 $envkey = $context;                  $envkey = $context;
             }              }
             if ($userenv{$envkey} ne '') {              if ($userenv{$envkey} ne '') {
                 $curroption = $userenv{$envkey};                  $curroption = $userenv{$envkey};
                 $customsty = ' style="display:block"';  
             } else {              } else {
                 $customsty = ' style="display:none"';  
                 my (@inststatuses);                  my (@inststatuses);
                 if ($context eq 'requestcourses') {                  if ($context eq 'requestcourses') {
                     $curroption =                      $curroption =
Line 3781  sub update_user_data { Line 3786  sub update_user_data {
                     }                      }
                     if (($env{'user.name'} eq $env{'form.ccuname'}) &&                      if (($env{'user.name'} eq $env{'form.ccuname'}) &&
                         ($env{'user.domain'} eq $env{'form.ccdomain'})) {                          ($env{'user.domain'} eq $env{'form.ccdomain'})) {
                         my %newenvhash;                          my (%newenvhash,$got_domdefs,%domdefaults,$got_userenv,
                               %userenv);
                           my @fromenv = keys(%changed);
                           push(@fromenv,'inststatus');
                         foreach my $key (keys(%changed)) {                          foreach my $key (keys(%changed)) {
                             if (($key eq 'official') || ($key eq 'unofficial') ||                              if (($key eq 'official') || ($key eq 'unofficial') ||
                                 ($key eq 'community') || ($key eq 'textbook') ||                                  ($key eq 'community') || ($key eq 'textbook') ||
Line 3791  sub update_user_data { Line 3799  sub update_user_data {
                                 if ($changeHash{'requestcourses.'.$key}) {                                  if ($changeHash{'requestcourses.'.$key}) {
                                     $newenvhash{'environment.canrequest.'.$key} = 1;                                      $newenvhash{'environment.canrequest.'.$key} = 1;
                                 } else {                                  } else {
                                       unless ($got_domdefs) {
                                           %domdefaults =
                                               &Apache::lonnet::get_domain_defaults($env{'user.domain'});
                                           $got_domdefs = 1;
                                       }
                                       unless ($got_userenv) {
                                           %userenv =
                                               &Apache::lonnet::userenvironment($env{'user.domain'},
                                                                                $env{'user.name'},@fromenv);
                                           $got_userenv = 1;
                                       }
                                     $newenvhash{'environment.canrequest.'.$key} =                                      $newenvhash{'environment.canrequest.'.$key} =
           &Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'},            &Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'},
                                             $key,'reload','requestcourses');                                              $key,'reload','requestcourses',\%userenv,\%domdefaults);
                                 }                                  }
                             } elsif ($key eq 'requestauthor') {                              } elsif ($key eq 'requestauthor') {
                                 $newenvhash{'environment.'.$key} = $changeHash{$key};                                  $newenvhash{'environment.'.$key} = $changeHash{$key};
                                 if ($changeHash{$key}) {                                  if ($changeHash{$key}) {
                                     $newenvhash{'environment.canrequest.author'} = 1;                                      $newenvhash{'environment.canrequest.author'} = 1;
                                 } else {                                  } else {
                                       unless ($got_domdefs) {
                                           %domdefaults =
                                              &Apache::lonnet::get_domain_defaults($env{'user.domain'});
                                           $got_domdefs = 1;
                                       }
                                       unless ($got_userenv) {
                                           %userenv =
                                               &Apache::lonnet::userenvironment($env{'user.domain'},
                                                                                $env{'user.name'},@fromenv);
                                           $got_userenv = 1;
                                       }
                                     $newenvhash{'environment.canrequest.author'} =                                      $newenvhash{'environment.canrequest.author'} =
           &Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'},            &Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'},
                                             $key,'reload','requestauthor');                                              $key,'reload','requestauthor',\%userenv,\%domdefaults);
                                 }                                  }
                             } elsif ($key eq 'editors') {                              } elsif ($key eq 'editors') {
                                 $newenvhash{'environment.author'.$key} = $changeHash{'author'.$key};                                  $newenvhash{'environment.author'.$key} = $changeHash{'author'.$key};
                                 if ($key eq 'editors') {                                  if ($env{'form.customeditors'}) {
                                     if ($env{'form.customeditors'}) {                                      $newenvhash{'environment.editors'} = $changeHash{'author'.$key};
                                         $newenvhash{'environment.editors'} = $changeHash{'author'.$key};                                  } else {
                                       unless ($got_domdefs) {
                                           %domdefaults =
                                               &Apache::lonnet::get_domain_defaults($env{'user.domain'});
                                           $got_domdefs = 1;
                                       }
                                       if ($domdefaults{'editors'} ne '') {
                                           $newenvhash{'environment.editors'} = $domdefaults{'editors'};
                                     } else {                                      } else {
                                         $newenvhash{'environment.editors'} =                                          $newenvhash{'environment.editors'} = 'edit,xml';
           &Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'},  
                                             $key,'reload','authordefaults');  
                                     }                                      }
                                 }                                  }
                             } elsif ($key ne 'quota') {                              } elsif ($key ne 'quota') {
Line 3822  sub update_user_data { Line 3857  sub update_user_data {
                                     $newenvhash{'environment.availabletools.'.$key} =                                      $newenvhash{'environment.availabletools.'.$key} =
                                         $changeHash{'tools.'.$key};                                          $changeHash{'tools.'.$key};
                                 } else {                                  } else {
                                       unless ($got_domdefs) {
                                           %domdefaults =
                                              &Apache::lonnet::get_domain_defaults($env{'user.domain'});
                                           $got_domdefs = 1;
                                       }
                                       unless ($got_userenv) {
                                           %userenv =
                                               &Apache::lonnet::userenvironment($env{'user.domain'},
                                                                                $env{'user.name'},@fromenv);
                                           $got_userenv = 1;
                                       }
                                     $newenvhash{'environment.availabletools.'.$key} =                                      $newenvhash{'environment.availabletools.'.$key} =
           &Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'},            &Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'},
                                             $key,'reload','tools');                                              $key,'reload','tools',\%userenv,\%domdefaults);
                                 }                                  }
                             }                              }
                         }                          }
Line 4025  sub display_userinfo { Line 4071  sub display_userinfo {
          'prvs'           => 'Previous Value:',           'prvs'           => 'Previous Value:',
          '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 co-authors",           'managers'       => "Co-authors who can add/revoke roles",
          '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 6350  sub handler { Line 6396  sub handler {
         if (($permission->{cusr}) && ($context eq 'author')) {          if (($permission->{cusr}) && ($context eq 'author')) {
             push(@{$brcrum},              push(@{$brcrum},
                      {href => '/adm/createuser?action=camanagers',                       {href => '/adm/createuser?action=camanagers',
                       text => 'Co-authors who manage',                        text => 'Co-author Managers',
                       help => 'Author_Manage_Coauthors'});                        help => 'Author_Manage_Coauthors'});
             if ($env{'form.state'} eq 'process') {              if ($env{'form.state'} eq 'process') {
                 push(@{$brcrum},                  push(@{$brcrum},
Line 6919  sub print_main_menu { Line 6965  sub print_main_menu {
             },              },
             {              {
              linktext => 'Co-author Managers',               linktext => 'Co-author Managers',
              icon => 'helpdesk-access.png',               icon => 'camanager.png',
              #help => 'Coauthor_Management',               #help => 'Coauthor_Management',
              url => '/adm/createuser?action=camanagers',               url => '/adm/createuser?action=camanagers',
              permission => $permission->{'author'},               permission => $permission->{'author'},
              linktitle => 'Assign/Revoke right to manage co-author roles',               linktitle => 'Assign/Revoke right to manage co-author roles',
             },              },
             {              {
              linktext => 'Configure Coauthor Listing',               linktext => 'Configure Co-author Listing',
              icon => 'helpdesk-access.png',               icon => 'coauthors.png',
              #help => 'Coauthor_Settings',               #help => 'Coauthor_Settings',
              url => '/adm/createuser?action=calist&forceedit=1',               url => '/adm/createuser?action=calist&forceedit=1',
              permission => ($permission->{'cusr'}),               permission => ($permission->{'cusr'}),

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


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