--- loncom/interface/lonmodifycourse.pm 2019/07/26 17:43:54 1.79.2.7 +++ loncom/interface/lonmodifycourse.pm 2019/08/27 15:34:34 1.79.2.8 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # handler for DC-only modifiable course settings # -# $Id: lonmodifycourse.pm,v 1.79.2.7 2019/07/26 17:43:54 raeburn Exp $ +# $Id: lonmodifycourse.pm,v 1.79.2.8 2019/08/27 15:34:34 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -52,6 +52,10 @@ sub get_dc_settable { if (&showcredits($cdom)) { push(@items,'defaultcredits'); } + my %passwdconf = &Apache::lonnet::get_passwdconf($cdom); + if (($passwdconf{'crsownerchg'}) && ($type ne 'Placement')) { + push(@items,'nopasswdchg'); + } return @items; } } @@ -97,6 +101,7 @@ sub get_enrollment_settings { @items = map { 'internal.'.$_; } (@{$internals}); push(@items,@{$accessdates}); } + push(@items,'internal.nopasswdchg'); my %settings = &Apache::lonnet::get('environment',\@items,$cdom,$cnum); my %enrollvar; $enrollvar{'autharg'} = ''; @@ -122,7 +127,7 @@ sub get_enrollment_settings { } elsif ($type eq "authtype" || $type eq "autharg" || $type eq "coursecode" || $type eq "crosslistings" || $type eq "selfenrollmgr" - || $type eq "autodropfailsafe") { + || $type eq "autodropfailsafe" || $type eq 'nopasswdchg') { $enrollvar{$type} = $settings{$item}; } elsif ($type eq 'defaultcredits') { if (&showcredits($cdom)) { @@ -1014,6 +1019,7 @@ sub print_course_modification_page { my @specific_managebydc = split(/,/,$settings{'internal.selfenrollmgrdc'}); my @specific_managebycc = split(/,/,$settings{'internal.selfenrollmgrcc'}); my %domdefaults = &Apache::lonnet::get_domain_defaults($cdom); + my %passwdconf = &Apache::lonnet::get_passwdconf($cdom); my @default_managebydc = split(/,/,$domdefaults{$type.'selfenrolladmdc'}); if ($crstype eq 'Community') { $ccrole = 'co'; @@ -1088,7 +1094,8 @@ sub print_course_modification_page { if ($crstype eq 'Community') { $r->print(&Apache::lonhtmlcommon::row_title( &Apache::loncommon::help_open_topic('Modify_Community_Owner'). - ' '.&mt('Community Owner'))."\n"); + ' '.&mt('Community Owner'))."\n". + $ownertable."\n".&Apache::lonhtmlcommon::row_closure()); } else { $r->print(&Apache::lonhtmlcommon::row_title( &Apache::loncommon::help_open_topic('Modify_Course_Instcode'). @@ -1098,7 +1105,7 @@ sub print_course_modification_page { if (&showcredits($cdom)) { $r->print(&Apache::lonhtmlcommon::row_title( &Apache::loncommon::help_open_topic('Modify_Course_Credithours'). - ' '.&mt('Credits (students)'))."\n". + ' '.&mt('Credits (students)'))."\n". ''. &Apache::lonhtmlcommon::row_closure()); } @@ -1108,8 +1115,21 @@ sub print_course_modification_page { $authenitems."\n". &Apache::lonhtmlcommon::row_closure(). &Apache::lonhtmlcommon::row_title( - &Apache::loncommon::help_open_topic('Modify_Course_Owner'). - ' '.&mt('Course Owner'))."\n"); + &Apache::loncommon::help_open_topic('Modify_Course_Owner'). + ' '.&mt('Course Owner'))."\n". + $ownertable."\n".&Apache::lonhtmlcommon::row_closure()); + if (($passwdconf{'crsownerchg'}) && ($type ne 'Placement')) { + my $checked; + if ($enrollvar{'nopasswdchg'}) { + $checked = ' checked="checked"'; + } + $r->print(&Apache::lonhtmlcommon::row_title( + &Apache::loncommon::help_open_topic('Modify_Course_Chgpasswd'). + ' '.&mt('Changing passwords (internal)'))."\n". + '