Diff for /loncom/interface/loncreateuser.pm between versions 1.406.2.20 and 1.406.2.20.2.4

version 1.406.2.20, 2021/12/13 20:53:06 version 1.406.2.20.2.4, 2023/09/04 16:16:19
Line 244  sub build_tools_display { Line 244  sub build_tools_display {
                    'aboutme'    => "Personal Information Page",                     'aboutme'    => "Personal Information Page",
                    'webdav'     => "WebDAV access to Authoring Spaces (if SSL and author/co-author)",                     'webdav'     => "WebDAV access to Authoring Spaces (if SSL and author/co-author)",
                    'portfolio'  => "Personal User Portfolio",                     'portfolio'  => "Personal User Portfolio",
                      'timezone'   => "Can set Time Zone",
                    'avai'       => "Available",                     'avai'       => "Available",
                    'cusa'       => "availability",                     'cusa'       => "availability",
                    'chse'       => "Change setting",                     'chse'       => "Change setting",
Line 255  sub build_tools_display { Line 256  sub build_tools_display {
                    'textbook'   => 'Can request creation of textbook courses',                     'textbook'   => 'Can request creation of textbook courses',
                    'requestauthor'  => 'Can request author space',                     'requestauthor'  => 'Can request author space',
     );      );
       $isadv = &Apache::lonnet::is_advanced_user($ccdomain,$ccuname);
     if ($context eq 'requestcourses') {      if ($context eq 'requestcourses') {
         %userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname,          %userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname,
                       'requestcourses.official','requestcourses.unofficial',                        'requestcourses.official','requestcourses.unofficial',
Line 267  sub build_tools_display { Line 269  sub build_tools_display {
         $colspan = ' colspan="2"';          $colspan = ' colspan="2"';
         %domconfig =          %domconfig =
             &Apache::lonnet::get_dom('configuration',['requestcourses'],$ccdomain);              &Apache::lonnet::get_dom('configuration',['requestcourses'],$ccdomain);
         $isadv = &Apache::lonnet::is_advanced_user($ccdomain,$ccuname);  
     } elsif ($context eq 'requestauthor') {      } elsif ($context eq 'requestauthor') {
         %userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname,          %userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname,
                                                     'requestauthor');                                                      'requestauthor');
Line 281  sub build_tools_display { Line 282  sub build_tools_display {
     } else {      } else {
         %userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname,          %userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname,
                           'tools.aboutme','tools.portfolio','tools.blog',                            'tools.aboutme','tools.portfolio','tools.blog',
                           'tools.webdav');                            'tools.webdav','tools.timezone');
         @usertools = ('aboutme','blog','webdav','portfolio');          @usertools = ('aboutme','blog','webdav','portfolio','timezone');
     }      }
     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);              $currdisp,$custdisp,$custradio);
         $cust_off = 'checked="checked" ';          $cust_off = 'checked="checked" ';
         $tool_on = 'checked="checked" ';          $tool_on = 'checked="checked" ';
         $curr_access =            $curr_access =
             &Apache::lonnet::usertools_access($ccuname,$ccdomain,$item,undef,              &Apache::lonnet::usertools_access($ccuname,$ccdomain,$item,undef,
                                               $context);                                                $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 1592  ENDNOTOOLSPRIV Line 1594  ENDNOTOOLSPRIV
                 if ($newuser) {                  if ($newuser) {
                     $r->print(' onclick="auth_check()" \>'."\n");                      $r->print(' onclick="auth_check()" \>'."\n");
                 } else {                  } else {
                     $r->print('onclick="this.form.submit()" \>'."\n");                      $r->print(' onclick="this.form.submit()" \>'."\n");
                 }                  }
             } else {              } else {
                 $r->print('</fieldset></div>'.                  $r->print('</fieldset></div>'.
Line 2493  sub personal_data_display { Line 2495  sub personal_data_display {
         }          }
         $rowcount ++;          $rowcount ++;
         $output .= &Apache::lonhtmlcommon::row_closure(1);          $output .= &Apache::lonhtmlcommon::row_closure(1);
         my $upassone = '<input type="password" name="upass'.$now.'" size="20" autocomplete="off" />';          my $upassone = '<input type="password" name="upass'.$now.'" size="20" autocomplete="new-password" />';
         my $upasstwo = '<input type="password" name="upasscheck'.$now.'" size="20" autocomplete="off" />';          my $upasstwo = '<input type="password" name="upasscheck'.$now.'" size="20" autocomplete="new-password" />';
         $output .= &Apache::lonhtmlcommon::row_title(&mt('Password').'<b>*</b>',          $output .= &Apache::lonhtmlcommon::row_title(&mt('Password').'<b>*</b>',
                                                     'LC_pick_box_title',                                                      'LC_pick_box_title',
                                                     'LC_oddrow_value')."\n".                                                      'LC_oddrow_value')."\n".
Line 2849  sub update_user_data { Line 2851  sub update_user_data {
   
     my (%alerts,%rulematch,%inst_results,%curr_rules);      my (%alerts,%rulematch,%inst_results,%curr_rules);
     my @userinfo = ('firstname','middlename','lastname','generation','permanentemail','id');      my @userinfo = ('firstname','middlename','lastname','generation','permanentemail','id');
     my @usertools = ('aboutme','blog','webdav','portfolio');      my @usertools = ('aboutme','blog','webdav','portfolio','timezone');
     my @requestcourses = ('official','unofficial','community','textbook');      my @requestcourses = ('official','unofficial','community','textbook');
     my @requestauthor = ('requestauthor');      my @requestauthor = ('requestauthor');
     my ($othertitle,$usertypes,$types) =       my ($othertitle,$usertypes,$types) = 
Line 3025  sub update_user_data { Line 3027  sub update_user_data {
         my %userenv = &Apache::lonnet::get          my %userenv = &Apache::lonnet::get
             ('environment',['firstname','middlename','lastname','generation',              ('environment',['firstname','middlename','lastname','generation',
              'id','permanentemail','portfolioquota','authorquota','inststatus',               'id','permanentemail','portfolioquota','authorquota','inststatus',
              'tools.aboutme','tools.blog','tools.webdav','tools.portfolio',               'tools.aboutme','tools.blog','tools.webdav',
                'tools.portfolio','tools.timezone',
              'requestcourses.official','requestcourses.unofficial',               'requestcourses.official','requestcourses.unofficial',
              'requestcourses.community','requestcourses.textbook',               'requestcourses.community','requestcourses.textbook',
              'reqcrsotherdom.official','reqcrsotherdom.unofficial',               'reqcrsotherdom.official','reqcrsotherdom.unofficial',
Line 3358  sub update_user_data { Line 3361  sub update_user_data {
                             &Apache::lonnet::appenv(\%newenvhash);                              &Apache::lonnet::appenv(\%newenvhash);
                         }                          }
                     }                      }
                       if ($changed{'aboutme'}) {
                           &Apache::loncommon::devalidate_aboutme_cache($env{'form.ccuname'},
                                                                        $env{'form.ccdomain'});
                       }
                 }                  }
             }              }
             if (keys(%namechanged) > 0) {              if (keys(%namechanged) > 0) {
Line 3527  sub display_userinfo { Line 3534  sub display_userinfo {
          'webdav'         => 'WebDAV Availability',           'webdav'         => 'WebDAV Availability',
          'aboutme'        => 'Personal Information Page Availability',           'aboutme'        => 'Personal Information Page Availability',
          'portfolio'      => 'Portfolio Availability',           'portfolio'      => 'Portfolio Availability',
            'timezone'       => 'Can set own Time Zone',
          'official'       => 'Can Request Official Courses',           'official'       => 'Can Request Official Courses',
          'unofficial'     => 'Can Request Unofficial Courses',           'unofficial'     => 'Can Request Unofficial Courses',
          'community'      => 'Can Request Communities',           'community'      => 'Can Request Communities',
Line 4670  sub handler { Line 4678  sub handler {
                 if (&Apache::lonnet::auto_run($cnum,$cdom) && (($permission->{'cusr'}) || ($permission->{'view'}))) {                  if (&Apache::lonnet::auto_run($cnum,$cdom) && (($permission->{'cusr'}) || ($permission->{'view'}))) {
                     push(@allhelp,'Course_Automated_Enrollment');                      push(@allhelp,'Course_Automated_Enrollment');
                 }                  }
                 if ($permission->{'selfenrolladmin'}) {                  if (($permission->{'selfenrolladmin'}) || ($permission->{'selfenrollview'})) {
                     push(@allhelp,'Course_Approve_Selfenroll');                      push(@allhelp,'Course_Approve_Selfenroll');
                 }                  }
             }              }
Line 5210  sub handler { Line 5218  sub handler {
                      '<span class="LC_error">'.&mt('You do not have permission to modify dates or sections for users').'</span>');                        '<span class="LC_error">'.&mt('You do not have permission to modify dates or sections for users').'</span>'); 
         }          }
     } elsif ($env{'form.action'} eq 'selfenroll') {      } elsif ($env{'form.action'} eq 'selfenroll') {
         if ($permission->{selfenrolladmin}) {          my %currsettings;
             my %currsettings = (          if ($permission->{selfenrolladmin} || $permission->{selfenrollview}) {
               %currsettings = (
                 selfenroll_types              => $env{'course.'.$cid.'.internal.selfenroll_types'},                  selfenroll_types              => $env{'course.'.$cid.'.internal.selfenroll_types'},
                 selfenroll_registered         => $env{'course.'.$cid.'.internal.selfenroll_registered'},                  selfenroll_registered         => $env{'course.'.$cid.'.internal.selfenroll_registered'},
                 selfenroll_section            => $env{'course.'.$cid.'.internal.selfenroll_section'},                  selfenroll_section            => $env{'course.'.$cid.'.internal.selfenroll_section'},
Line 5227  sub handler { Line 5236  sub handler {
                 default_enrollment_end_date   => $env{'course.'.$cid.'.default_enrollment_end_date'},                  default_enrollment_end_date   => $env{'course.'.$cid.'.default_enrollment_end_date'},
                 uniquecode                    => $env{'course.'.$cid.'.internal.uniquecode'},                  uniquecode                    => $env{'course.'.$cid.'.internal.uniquecode'},
             );              );
           }
           if ($permission->{selfenrolladmin}) {
             push(@{$brcrum},              push(@{$brcrum},
                     {href => '/adm/createuser?action=selfenroll',                      {href => '/adm/createuser?action=selfenroll',
                      text => "Configure Self-enrollment",                       text => "Configure Self-enrollment",
Line 5247  sub handler { Line 5258  sub handler {
                 $r->print('<h3>'.&mt('Self-enrollment with a student role').'</h3>'."\n");                  $r->print('<h3>'.&mt('Self-enrollment with a student role').'</h3>'."\n");
                 &update_selfenroll_config($r,$cid,$cdom,$cnum,$context,$crstype,\%currsettings);                  &update_selfenroll_config($r,$cid,$cdom,$cnum,$context,$crstype,\%currsettings);
             }              }
           } elsif ($permission->{selfenrollview}) {
               push(@{$brcrum},
                       {href => '/adm/createuser?action=selfenroll',
                        text => "View Self-enrollment configuration",
                        help => 'Course_Self_Enrollment'});
               $args = { bread_crumbs           => $brcrum,
                         bread_crumbs_component => 'Self-enrollment Settings'};
               $r->print(&header(undef,$args));
               $r->print('<h3>'.&mt('Self-enrollment with a student role').'</h3>'."\n");
               &print_selfenroll_menu($r,'course',$cid,$cdom,$cnum,\%currsettings,'',1);
         } else {          } else {
             $r->print(&header(undef,{'no_nav_bar' => 1}).              $r->print(&header(undef,{'no_nav_bar' => 1}).
                      '<span class="LC_error">'.&mt('You do not have permission to configure self-enrollment').'</span>');                       '<span class="LC_error">'.&mt('You do not have permission to configure self-enrollment').'</span>');
Line 5290  sub handler { Line 5311  sub handler {
                      '<span class="LC_error">'.&mt('You do not have permission to view change logs').'</span>');                       '<span class="LC_error">'.&mt('You do not have permission to view change logs').'</span>');
         }          }
     } elsif ($env{'form.action'} eq 'helpdesk') {      } elsif ($env{'form.action'} eq 'helpdesk') {
         if (($permission->{'owner'}) || ($permission->{'co-owner'})) {          if (($permission->{'owner'} || $permission->{'co-owner'}) &&
               ($permission->{'cusr'} || $permission->{'view'})) {
             if ($env{'form.state'} eq 'process') {              if ($env{'form.state'} eq 'process') {
                 if ($permission->{'owner'}) {                  if ($permission->{'owner'}) {
                     &update_helpdeskaccess($r,$permission,$brcrum);                      &update_helpdeskaccess($r,$permission,$brcrum);
Line 5717  sub print_main_menu { Line 5739  sub print_main_menu {
              icon => 'helpdesk-access.png',               icon => 'helpdesk-access.png',
              #help => 'Course_Helpdesk_Access',               #help => 'Course_Helpdesk_Access',
              url => '/adm/createuser?action=helpdesk',               url => '/adm/createuser?action=helpdesk',
              permission => ($permission->{'owner'} || $permission->{'co-owner'}),               permission => (($permission->{'owner'} || $permission->{'co-owner'}) &&
                               ($permission->{'view'} || $permission->{'cusr'})),
              linktitle => 'Helpdesk access options',               linktitle => 'Helpdesk access options',
             },              },
             {              {
Line 5752  sub print_main_menu { Line 5775  sub print_main_menu {
                      icon => 'selfenrl-queue.png',                       icon => 'selfenrl-queue.png',
                      #help => 'Course_Approve_Selfenroll',                       #help => 'Course_Approve_Selfenroll',
                      url => '/adm/createuser?action=selfenrollqueue',                       url => '/adm/createuser?action=selfenrollqueue',
                      permission => $permission->{'selfenrolladmin'},                       permission => $permission->{'selfenrolladmin'} || $permission->{'selfenrollview'},
                      linktitle =>'Approve or reject enrollment requests.',                       linktitle =>'Approve or reject enrollment requests.',
                     },                      },
             );              );
Line 5779  sub print_main_menu { Line 5802  sub print_main_menu {
                  icon => 'self_enroll.png',                   icon => 'self_enroll.png',
                  #help => 'Course_Self_Enrollment',                   #help => 'Course_Self_Enrollment',
                  url => '/adm/createuser?action=selfenroll',                   url => '/adm/createuser?action=selfenroll',
                  permission => $permission->{'selfenrolladmin'},                   permission => $permission->{'selfenrolladmin'} || $permission->{'selfenrollview'},
                  linktitle => 'Configure user self-enrollment.',                   linktitle => 'Configure user self-enrollment.',
                 },                  },
             );              );
Line 6028  ENDSCRIPT Line 6051  ENDSCRIPT
                  '// ]]>'."\n".                   '// ]]>'."\n".
                  '</script>'."\n".                   '</script>'."\n".
                  '<h3>'.$lt->{'selfenroll'}.'</h3>'."\n";                   '<h3>'.$lt->{'selfenroll'}.'</h3>'."\n";
        my $visactions = &cat_visibility($cdom);
     my $visactions = &cat_visibility();  
     my ($cathash,%cattype);      my ($cathash,%cattype);
     my %domconfig = &Apache::lonnet::get_dom('configuration',['coursecategories'],$cdom);      my %domconfig = &Apache::lonnet::get_dom('configuration',['coursecategories'],$cdom);
     if (ref($domconfig{'coursecategories'}) eq 'HASH') {      if (ref($domconfig{'coursecategories'}) eq 'HASH') {
Line 6574  sub visible_in_stdcat { Line 6596  sub visible_in_stdcat {
 }  }
   
 sub cat_visibility {  sub cat_visibility {
       my ($cdom) = @_;
     my %visactions = &Apache::lonlocal::texthash(      my %visactions = &Apache::lonlocal::texthash(
                    vis => 'This course/community currently appears in the Course/Community Catalog for this domain.',                     vis => 'This course/community currently appears in the Course/Community Catalog for this domain.',
                    gen => 'Courses can be both self-cataloging, based on an institutional code (e.g., fs08phy231), or can be assigned categories from a hierarchy defined for the domain.',                     gen => 'Courses can be both self-cataloging, based on an institutional code (e.g., fs08phy231), or can be assigned categories from a hierarchy defined for the domain.',
Line 6586  sub cat_visibility { Line 6609  sub cat_visibility {
                    dc_chgconf => 'Ask a domain coordinator to change the Catalog type for this domain.',                     dc_chgconf => 'Ask a domain coordinator to change the Catalog type for this domain.',
                    dc_setcode => 'Ask a domain coordinator to assign a six character code to the course',                     dc_setcode => 'Ask a domain coordinator to assign a six character code to the course',
                    dc_unhide  => 'Ask a domain coordinator to change the "Exclude from course catalog" setting.',                     dc_unhide  => 'Ask a domain coordinator to change the "Exclude from course catalog" setting.',
                    dc_addinst => 'Ask a domain coordinator to enable display the catalog of "Official courses (with institutional codes)".',                     dc_addinst => 'Ask a domain coordinator to enable catalog display of "Official courses (with institutional codes)".',
                    dc_instcode => 'Ask a domain coordinator to assign an institutional code (if this is an official course).',                     dc_instcode => 'Ask a domain coordinator to assign an institutional code (if this is an official course).',
                    dc_catalog  => 'Ask a domain coordinator to enable or create at least one course category in the domain.',                     dc_catalog  => 'Ask a domain coordinator to enable or create at least one course category in the domain.',
                    dc_categories => 'Ask a domain coordinator to create a hierarchy of categories and sub categories for courses in the domain.',                     dc_categories => 'Ask a domain coordinator to create a hierarchy of categories and sub categories for courses in the domain.',
                    dc_chgcat => 'Ask a domain coordinator to change the category assigned to the course, as the one currently assigned is no longer used in the domain',                     dc_chgcat => 'Ask a domain coordinator to change the category assigned to the course, as the one currently assigned is no longer used in the domain',
                    dc_addcat => 'Ask a domain coordinator to assign a category to the course.',                     dc_addcat => 'Ask a domain coordinator to assign a category to the course.',
     );      );
       if ($env{'request.role'} eq "dc./$cdom/") {
           $visactions{'dc_chgconf'} = &mt('Use: "Main menu" [_1] "Set domain configuration" [_1] "Cataloging of courses/communities" to change the Catalog type for this domain.','&raquo;');
           $visactions{'dc_setcode'} = &mt('Use: "Main menu" [_1] "Set domain configuration" [_1] "Cataloging of courses/communities" to assign a six character code to the course.','&raquo;');
           $visactions{'dc_unhide'} = &mt('Use: "Main menu" [_1] "Set domain configuration" [_1] "Cataloging of courses/communities" to change the "Exclude from course catalog" setting.','&raquo;');
           $visactions{'dc_addinst'} = &mt('Use: "Main menu" [_1] "Set domain configuration" [_1] "Cataloging of courses/communities" to enable catalog display of "Official courses (with institutional codes)".','&raquo;');
           $visactions{'dc_instcode'} = &mt('Use: "Main menu" [_1] "View or modify a course or community" [_1] "View/Modify course owner, institutional code ... " to assign an institutional code (if this is an official course).','&raquo;');
           $visactions{'dc_catalog'} = &mt('Use: "Main menu" [_1] "Set domain configuration" [_1] "Cataloging of courses/communities" to enable or create at least one course category in the domain.','&raquo;');
           $visactions{'dc_categories'} = &mt('Use: "Main menu" [_1] "Set domain configuration" [_1] "Cataloging of courses/communities" to create a hierarchy of categories and sub categories for courses in the domain.','&raquo;');
           $visactions{'dc_chgcat'} = &mt('Use: "Main menu" [_1] "View or modify a course or community" [_1] "View/Modify catalog settings for course" to change the category assigned to the course, as the one currently assigned is no longer used in the domain.','&raquo;');
           $visactions{'dc_addcat'} = &mt('Use: "Main menu" [_1] "View or modify a course or community" [_1] "View/Modify catalog settings for course" to assign a category to the course.','&raquo;');
       }
     $visactions{'unhide'} = &mt('Use [_1]Categorize course[_2] to change the "Exclude from course catalog" setting.','<a href="/adm/courseprefs?phase=display&actions=courseinfo">','</a>"');      $visactions{'unhide'} = &mt('Use [_1]Categorize course[_2] to change the "Exclude from course catalog" setting.','<a href="/adm/courseprefs?phase=display&actions=courseinfo">','</a>"');
     $visactions{'chgcat'} = &mt('Use [_1]Categorize course[_2] to change the category assigned to the course, as the one currently assigned is no longer used in the domain.','"<a href="/adm/courseprefs?phase=display&actions=courseinfo">','</a>"');      $visactions{'chgcat'} = &mt('Use [_1]Categorize course[_2] to change the category assigned to the course, as the one currently assigned is no longer used in the domain.','"<a href="/adm/courseprefs?phase=display&actions=courseinfo">','</a>"');
     $visactions{'addcat'} = &mt('Use [_1]Categorize course[_2] to assign a category to the course.','"<a href="/adm/courseprefs?phase=display&actions=courseinfo">','</a>"');      $visactions{'addcat'} = &mt('Use [_1]Categorize course[_2] to assign a category to the course.','"<a href="/adm/courseprefs?phase=display&actions=courseinfo">','</a>"');
Line 9548  sub update_selfenroll_config { Line 9582  sub update_selfenroll_config {
     } else {      } else {
         $r->print(&mt('No changes were made to the existing self-enrollment settings in this course.'));          $r->print(&mt('No changes were made to the existing self-enrollment settings in this course.'));
     }      }
     my $visactions = &cat_visibility();      my $visactions = &cat_visibility($cdom);
     my ($cathash,%cattype);      my ($cathash,%cattype);
     my %domconfig = &Apache::lonnet::get_dom('configuration',['coursecategories'],$cdom);      my %domconfig = &Apache::lonnet::get_dom('configuration',['coursecategories'],$cdom);
     if (ref($domconfig{'coursecategories'}) eq 'HASH') {      if (ref($domconfig{'coursecategories'}) eq 'HASH') {

Removed from v.1.406.2.20  
changed lines
  Added in v.1.406.2.20.2.4


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