Diff for /loncom/interface/loncreateuser.pm between versions 1.406.2.18 and 1.406.2.20.2.1

version 1.406.2.18, 2020/05/02 20:57:12 version 1.406.2.20.2.1, 2022/09/19 19:36:29
Line 71  use Apache::longroup; Line 71  use Apache::longroup;
 use Apache::lonuserutils;  use Apache::lonuserutils;
 use Apache::loncoursequeueadmin;  use Apache::loncoursequeueadmin;
 use LONCAPA qw(:DEFAULT :match);  use LONCAPA qw(:DEFAULT :match);
   use HTML::Entities;
   
 my $loginscript; # piece of javascript used in two separate instances  my $loginscript; # piece of javascript used in two separate instances
 my $authformnop;  my $authformnop;
Line 243  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 280  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,
Line 2381  sub modify_login_block { Line 2383  sub modify_login_block {
 }  }
   
 sub personal_data_display {  sub personal_data_display {
     my ($ccuname,$ccdomain,$newuser,$context,$inst_results,$rolesarray,      my ($ccuname,$ccdomain,$newuser,$context,$inst_results,$rolesarray,$now,
         $now,$captchaform,$emailusername,$usertype,$usernameset,$condition,$excluded) = @_;          $captchaform,$emailusername,$usertype,$usernameset,$condition,$excluded,$showsubmit) = @_;
     my ($output,%userenv,%canmodify,%canmodify_status);      my ($output,%userenv,%canmodify,%canmodify_status);
     my @userinfo = ('firstname','middlename','lastname','generation',      my @userinfo = ('firstname','middlename','lastname','generation',
                     'permanentemail','id');                      'permanentemail','id');
Line 2507  sub personal_data_display { Line 2509  sub personal_data_display {
         if ($usernameset eq 'free') {          if ($usernameset eq 'free') {
             my $onclick = "toggleUsernameDisp(this,'selfcreateusername');";              my $onclick = "toggleUsernameDisp(this,'selfcreateusername');";
             $output .= &Apache::lonhtmlcommon::row_title($lt{'username'},undef,'LC_oddrow_value')."\n".              $output .= &Apache::lonhtmlcommon::row_title($lt{'username'},undef,'LC_oddrow_value')."\n".
                        &mt('Use e-mail address: ').                         '<span class="LC_nobreak">'.&mt('Use e-mail address: ').
                        '<label><input type="radio" name="emailused" value="1" checked="checked" onclick="'.$onclick.'" />'.&mt('Yes').'</label>'."\n".                         '<label><input type="radio" name="emailused" value="1" checked="checked" onclick="'.$onclick.'" />'.
                        ('&nbsp;'x2).                         &mt('Yes').'</label>'.('&nbsp;'x2).
                        '<label><input type="radio" name="emailused" value="0" onclick="'.$onclick.'" />'.&mt('No').'</label>'."\n".                         '<label><input type="radio" name="emailused" value="0" onclick="'.$onclick.'" />'.
                          &mt('No').'</label></span>'."\n".
                        '<div id="selfcreateusername" style="display: none; font-size: smaller">'.                         '<div id="selfcreateusername" style="display: none; font-size: smaller">'.
                        '<br /><span class="LC_nobreak">'.&mt('Preferred username').                         '<br /><span class="LC_nobreak">'.&mt('Preferred username').
                        '&nbsp;<input type="text" name="username" value="" size="20" autocomplete="off"/>'.                         '&nbsp;<input type="text" name="username" value="" size="20" autocomplete="off"/>'.
Line 2618  sub personal_data_display { Line 2621  sub personal_data_display {
                        &Apache::lonhtmlcommon::row_closure(1)                         &Apache::lonhtmlcommon::row_closure(1)
             $rowcount ++;              $rowcount ++;
         }          }
         my $submit_text = &mt('Create account');          if ($showsubmit) {
         $output .= &Apache::lonhtmlcommon::row_title()."\n".              my $submit_text = &mt('Create account');
                    '<br /><input type="submit" name="createaccount" value="'.              $output .= &Apache::lonhtmlcommon::row_title()."\n".
                    $submit_text.'" />'.                         '<br /><input type="submit" name="createaccount" value="'.
                    '<input type="hidden" name="type" value="'.$usertype.'" />'.                         $submit_text.'" />';
                    &Apache::lonhtmlcommon::row_closure(1);              if ($usertype ne '') {
                   $output .= '<input type="hidden" name="type" value="'.$usertype.'" />'.
                              &Apache::lonhtmlcommon::row_closure(1);
               }
           }
     }      }
     $output .= &Apache::lonhtmlcommon::end_pick_box();      $output .= &Apache::lonhtmlcommon::end_pick_box();
     if (wantarray) {      if (wantarray) {
Line 2843  sub update_user_data { Line 2850  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 2973  sub update_user_data { Line 2980  sub update_user_data {
                                           $env{'form.ccdomain'},$env{'form.ccuname'});                                            $env{'form.ccdomain'},$env{'form.ccuname'});
             }               } 
         }          }
         $r->print('<br />'.&mt('Home server').': '.$uhome.' '.          $r->print('<br />'.&mt('Home Server').': '.$uhome.' '.
                   &Apache::lonnet::hostname($uhome));                    &Apache::lonnet::hostname($uhome));
     } elsif (($env{'form.login'} ne 'nochange') &&      } elsif (($env{'form.login'} ne 'nochange') &&
              ($env{'form.login'} ne ''        )) {               ($env{'form.login'} ne ''        )) {
Line 2988  sub update_user_data { Line 2995  sub update_user_data {
                       &Apache::lonnet::modifyuserauth(                        &Apache::lonnet::modifyuserauth(
        $env{'form.ccdomain'},$env{'form.ccuname'},         $env{'form.ccdomain'},$env{'form.ccuname'},
                        $amode,$genpwd));                         $amode,$genpwd));
             $r->print('<br />'.&mt('Home server').': '.&Apache::lonnet::homeserver              $r->print('<br />'.&mt('Home Server').': '.&Apache::lonnet::homeserver
   ($env{'form.ccuname'},$env{'form.ccdomain'}));    ($env{'form.ccuname'},$env{'form.ccdomain'}));
  } else {   } else {
     # Okay, this is a non-fatal error.      # Okay, this is a non-fatal error.
Line 3019  sub update_user_data { Line 3026  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 3521  sub display_userinfo { Line 3529  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 7387  sub role_display_filter { Line 7396  sub role_display_filter {
                &mt('Context:').'</b><br /><select name="chgcontext">';                 &mt('Context:').'</b><br /><select name="chgcontext">';
     my @posscontexts;      my @posscontexts;
     if ($context eq 'course') {      if ($context eq 'course') {
         @posscontexts = ('any','automated','updatenow','createcourse','course','domain','selfenroll','requestcourses');          @posscontexts = ('any','automated','updatenow','createcourse','course','domain','selfenroll','requestcourses','chgtype');
     } elsif ($context eq 'domain') {      } elsif ($context eq 'domain') {
         @posscontexts = ('any','domain','requestauthor','domconfig','server');          @posscontexts = ('any','domain','requestauthor','domconfig','server');
     } else {      } else {
         @posscontexts = ('any','author','domain');          @posscontexts = ('any','author','domain');
     }       }
     foreach my $chgtype (@posscontexts) {      foreach my $chgtype (@posscontexts) {
         my $selstr = '';          my $selstr = '';
         if ($curr->{'chgcontext'} eq $chgtype) {          if ($curr->{'chgcontext'} eq $chgtype) {
Line 7436  sub rolechg_contexts { Line 7445  sub rolechg_contexts {
         %lt = &Apache::lonlocal::texthash (          %lt = &Apache::lonlocal::texthash (
                                              any          => 'Any',                                               any          => 'Any',
                                              automated    => 'Automated Enrollment',                                               automated    => 'Automated Enrollment',
                                                chgtype      => 'Enrollment Type/Lock Change',
                                              updatenow    => 'Roster Update',                                               updatenow    => 'Roster Update',
                                              createcourse => 'Course Creation',                                               createcourse => 'Course Creation',
                                              course       => 'User Management in course',                                               course       => 'User Management in course',

Removed from v.1.406.2.18  
changed lines
  Added in v.1.406.2.20.2.1


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