Diff for /loncom/interface/loncreateuser.pm between versions 1.91 and 1.95

version 1.91, 2004/12/07 00:49:27 version 1.95, 2005/01/11 20:49:05
Line 73  my $authformint; Line 73  my $authformint;
 my $authformfsys;  my $authformfsys;
 my $authformloc;  my $authformloc;
   
 BEGIN {  sub initialize_authen_forms {
     $ENV{'SERVER_NAME'}=~/(\w+\.\w+)$/;      my ($krbdefdom)=( $ENV{'SERVER_NAME'}=~/(\w+\.\w+)$/);
     my $krbdefdom=$1;      $krbdefdom= uc($krbdefdom);
     $krbdefdom=~tr/a-z/A-Z/;  
     my %param = ( formname => 'document.cu',      my %param = ( formname => 'document.cu',
                   kerb_def_dom => $krbdefdom                     kerb_def_dom => $krbdefdom 
                   );                    );
Line 397  ENDFORMINFO Line 396  ENDFORMINFO
                     'lg'   => "Login Data"                      'lg'   => "Login Data"
        );         );
  my $genhelp=&Apache::loncommon::help_open_topic('Generation');   my $genhelp=&Apache::loncommon::help_open_topic('Generation');
           &initialize_authen_forms();
  $r->print(<<ENDNEWUSER);   $r->print(<<ENDNEWUSER);
 $dochead  $dochead
 <h1>$lt{'cnu'}</h1>  <h1>$lt{'cnu'}</h1>
Line 674  END Line 674  END
  $currentauth=~/^localauth:/   $currentauth=~/^localauth:/
  ) { # bad authentication scheme   ) { # bad authentication scheme
     if (&Apache::lonnet::allowed('mau',$ENV{'request.role.domain'})) {      if (&Apache::lonnet::allowed('mau',$ENV{'request.role.domain'})) {
                   &initialize_authen_forms();
  my %lt=&Apache::lonlocal::texthash(   my %lt=&Apache::lonlocal::texthash(
                                'err'   => "ERROR",                                 'err'   => "ERROR",
        'uuas'  => "This user has an unrecognized authentication scheme",         'uuas'  => "This user has an unrecognized authentication scheme",
Line 715  ENDBADAUTH Line 716  ENDBADAUTH
         } else { # Authentication type is valid          } else { # Authentication type is valid
     my $authformcurrent='';      my $authformcurrent='';
     my $authform_other='';      my $authform_other='';
               &initialize_authen_forms();
     if ($currentauth=~/^krb(4|5):/) {      if ($currentauth=~/^krb(4|5):/) {
  $authformcurrent=$authformkrb;   $authformcurrent=$authformkrb;
  $authform_other="<p>$authformint</p>\n".   $authform_other="<p>$authformint</p>\n".
Line 1280  sub commit_standardrole { Line 1282  sub commit_standardrole {
                &mt('Add to classlist').': <b>ok</b><br />';                 &mt('Add to classlist').': <b>ok</b><br />';
         }          }
     } else {      } else {
         $output = (&mt('Assigning').' '.$three.' in '.$url.          $output = &mt('Assigning').' '.$three.' in '.$url.
                ($start?', '.&mt('starting').' '.localtime($start):'').                 ($start?', '.&mt('starting').' '.localtime($start):'').
                ($end?', '.&mt('ending').' '.localtime($end):'').': <b>'.                 ($end?', '.&mt('ending').' '.localtime($end):'').': <b>'.
                &Apache::lonnet::assignrole(                 &Apache::lonnet::assignrole(
                    $ENV{'form.ccdomain'},$ENV{'form.ccuname'},                     $ENV{'form.ccdomain'},$ENV{'form.ccuname'},
                    $url,$three,$end,$start).                     $url,$three,$end,$start).
                    '</b><br>');                     '</b><br>';
     }      }
     return $output;      return $output;
 }  }
Line 1611  sub course_level_table { Line 1613  sub course_level_table {
  $bgcol=substr($bgcol.$bgcol.$bgcol.'ffffff',2,6);   $bgcol=substr($bgcol.$bgcol.$bgcol.'ffffff',2,6);
  my ($domain,$cnum)=split(/\//,$thiscourse);   my ($domain,$cnum)=split(/\//,$thiscourse);
         my %sections_count = ();          my %sections_count = ();
         my $num_sections = &Apache::loncommon::get_sections($domain,$cnum,\%sections_count);          my $num_sections = 0;
           if (defined($ENV{'request.course.id'})) {
               if ($ENV{'request.course.id'} eq $domain.'_'.$cnum) {
                   $num_sections = &Apache::loncommon::get_sections($domain,$cnum,\%sections_count);
               }
           }
  foreach  ('st','ta','ep','ad','in','cc') {   foreach  ('st','ta','ep','ad','in','cc') {
     if (&Apache::lonnet::allowed('c'.$_,$thiscourse)) {      if (&Apache::lonnet::allowed('c'.$_,$thiscourse)) {
  my $plrole=&Apache::lonnet::plaintext($_);   my $plrole=&Apache::lonnet::plaintext($_);
Line 1706  sub course_sections { Line 1713  sub course_sections {
     my ($num_sections,$sections_count,$role) = @_;      my ($num_sections,$sections_count,$role) = @_;
     my $output = '';      my $output = '';
     my @sections = (sort {$a <=> $b} keys %{$sections_count});      my @sections = (sort {$a <=> $b} keys %{$sections_count});
     $output = '<select name="currsec_'.$role.'" ';      if ($num_sections == 1) {
     my $multiple = 4;          $output = '<select name="currsec_'.$role.'" >'."\n".
     if ($num_sections <4) { $multiple = $num_sections; }                    '  <option value="">Select</option>'."\n".
     $output .= '"multiple size="'.$multiple.'" >'."\n";                    '  <option value="">No section</option>'."\n".
     foreach (@sections) {                    '  <option value="'.$sections[0].'" >'.$sections[0].'</option>'."\n";
         $output .= '<option value="'.$_.'" />'.$_."\n";      } else {
           $output = '<select name="currsec_'.$role.'" ';
           my $multiple = 4;
           if ($num_sections <4) { $multiple = $num_sections; }
           $output .= '"multiple" size="'.$multiple.'">'."\n";
           foreach (@sections) {
               $output .= '<option value="'.$_.'">'.$_."</option>\n";
           }
     }      }
     $output .= '</select>';       $output .= '</select>'; 
     return $output;      return $output;

Removed from v.1.91  
changed lines
  Added in v.1.95


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