--- loncom/interface/coursecatalog.pm 2006/10/16 19:39:51 1.7 +++ loncom/interface/coursecatalog.pm 2006/12/05 02:55:51 1.11 @@ -42,6 +42,16 @@ sub handler { if ($r->header_only) { return OK; } + my %cookies=CGI::Cookie->parse($r->header_in('Cookie')); + my $lonid=$cookies{'lonID'}; + my $lonidsdir=$r->dir_config('lonIDsDir'); + my $handle; + if ($lonid) { + my $handle=&LONCAPA::clean_handle($lonid->value); + } + if ((-e "$lonidsdir/$handle.id") && ($handle ne '')) { + &Apache::lonnet::transfer_profile_to_env($lonidsdir,$handle); + } &Apache::lonacc::get_posted_cgi($r); &Apache::lonlocal::get_language_handle($r); &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['sortby']); @@ -50,7 +60,7 @@ sub handler { my $domdesc = $Apache::lonnet::domaindescription{$codedom}; &Apache::lonhtmlcommon::clear_breadcrumbs(); - if ($env{'form.coursenum'} ne '') { + if ($env{'form.coursenum'} ne '' && &user_is_known()) { &course_details($r,$codedom,$formname,$domdesc); } else { &course_selector($r,$codedom,$formname,$domdesc); @@ -369,7 +379,9 @@ sub print_course_listing { $output = &mt('No courses match the criteria you selected.'); return $output; } - $output = &mt('Note for students: If you are officially enrolled in a course but the course is not listed in your LON-CAPA courses, click the "Show more details" link for the specific course and check the default access dates and/or automated enrollment settings.

'); + if (&user_is_known()) { + $output = &mt('Note for students: If you are officially enrolled in a course but the course is not listed in your LON-CAPA courses, click the "Show more details" link for the specific course and check the default access dates and/or automated enrollment settings.

'); + } } $output .= &Apache::loncommon::start_data_table(). &Apache::loncommon::start_data_table_header_row(); @@ -389,13 +401,15 @@ sub print_course_listing { } $output .= ''; } - if ($env{'form.coursenum'} eq '') { - $output .= ' '; - } else { - $output .= + if (&user_is_known()) { + if ($env{'form.coursenum'} eq '') { + $output .= ' '; + } else { + $output .= ''.&mt('Default Access Dates for Students').''. ''.&mt('Student Counts').''. ''.&mt('Auto-enrollment of
registered students').''; + } } &Apache::loncommon::end_data_table_header_row(); my %courseinfo = &build_courseinfo_hash(%courses); @@ -441,6 +455,7 @@ sub build_courseinfo_hash { } my $cleandesc=&HTML::Entities::encode($descr,'<>&"'); $cleandesc=~s/'/\\'/g; + $cleandesc =~ s/^\s+//; my ($cdom,$cnum)=split(/\_/,$course); my ($desc,$instcode,$owner,$ttype) = split(/:/,$courses{$course}); @@ -573,13 +588,15 @@ sub courseinfo_row { } $output .= ''. ''.$ownerlast.''; - if ($env{'form.coursenum'} eq '') { - $output .= "".&mt('Show more details').''; - } else { - $output .= + if (&user_is_known()) { + if ($env{'form.coursenum'} eq '') { + $output .= "".&mt('Show more details').''; + } else { + $output .= ''.$accessdates.''. ''.$counts.''. ''.$autoenrollment.''; + } } return $output; } @@ -741,39 +758,44 @@ function courseSet() { } } else { - for (var k=0; k -1) { + for (var k=0; k