--- loncom/interface/loncreateuser.pm 2004/11/30 00:21:24 1.89 +++ loncom/interface/loncreateuser.pm 2004/12/28 22:30:28 1.94 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.89 2004/11/30 00:21:24 raeburn Exp $ +# $Id: loncreateuser.pm,v 1.94 2004/12/28 22:30:28 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -73,10 +73,9 @@ my $authformint; my $authformfsys; my $authformloc; -BEGIN { - $ENV{'SERVER_NAME'}=~/(\w+\.\w+)$/; - my $krbdefdom=$1; - $krbdefdom=~tr/a-z/A-Z/; +sub initialize_authen_forms { + my ($krbdefdom)=( $ENV{'SERVER_NAME'}=~/(\w+\.\w+)$/); + $krbdefdom= uc($krbdefdom); my %param = ( formname => 'document.cu', kerb_def_dom => $krbdefdom ); @@ -211,7 +210,7 @@ sub print_user_modification_page { return; } var userrole = document.cu.role.options[document.cu.role.selectedIndex].value - var section; + var section=""; var numsections = 0; for (var i=0; i "Login Data" ); my $genhelp=&Apache::loncommon::help_open_topic('Generation'); + &initialize_authen_forms(); $r->print(<$lt{'cnu'} @@ -674,6 +674,7 @@ END $currentauth=~/^localauth:/ ) { # bad authentication scheme if (&Apache::lonnet::allowed('mau',$ENV{'request.role.domain'})) { + &initialize_authen_forms(); my %lt=&Apache::lonlocal::texthash( 'err' => "ERROR", 'uuas' => "This user has an unrecognized authentication scheme", @@ -715,6 +716,7 @@ ENDBADAUTH } else { # Authentication type is valid my $authformcurrent=''; my $authform_other=''; + &initialize_authen_forms(); if ($currentauth=~/^krb(4|5):/) { $authformcurrent=$authformkrb; $authform_other="

$authformint

\n". @@ -1280,13 +1282,13 @@ sub commit_standardrole { &mt('Add to classlist').': ok
'; } } else { - $output = (&mt('Assigning').' '.$three.' in '.$url. + $output = &mt('Assigning').' '.$three.' in '.$url. ($start?', '.&mt('starting').' '.localtime($start):''). ($end?', '.&mt('ending').' '.localtime($end):'').': '. &Apache::lonnet::assignrole( $ENV{'form.ccdomain'},$ENV{'form.ccuname'}, $url,$three,$end,$start). - '
'); + '
'; } return $output; } @@ -1611,7 +1613,12 @@ sub course_level_table { $bgcol=substr($bgcol.$bgcol.$bgcol.'ffffff',2,6); my ($domain,$cnum)=split(/\//,$thiscourse); 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') { if (&Apache::lonnet::allowed('c'.$_,$thiscourse)) { my $plrole=&Apache::lonnet::plaintext($_); @@ -1706,12 +1713,19 @@ sub course_sections { my ($num_sections,$sections_count,$role) = @_; my $output = ''; my @sections = (sort {$a <=> $b} keys %{$sections_count}); - $output = ''."\n". + ' '."\n". + ' '."\n". + ' '."\n"; + } else { + $output = ''; return $output;