--- loncom/interface/domainprefs.pm 2014/05/05 21:40:52 1.160.6.44 +++ loncom/interface/domainprefs.pm 2014/05/04 21:48:56 1.239 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: domainprefs.pm,v 1.160.6.44 2014/05/05 21:40:52 raeburn Exp $ +# $Id: domainprefs.pm,v 1.239 2014/05/04 21:48:56 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -213,15 +213,15 @@ sub handler { 'quotas','autoenroll','autoupdate','autocreate', 'directorysrch','usercreation','usermodification', 'contacts','defaults','scantron','coursecategories', - 'serverstatuses','requestcourses','coursedefaults', - 'usersessions','loadbalancing','requestauthor', - 'selfenrollment','inststatus'],$dom); + 'serverstatuses','requestcourses','helpsettings', + 'coursedefaults','usersessions','loadbalancing', + 'requestauthor','selfenrollment','inststatus'],$dom); my @prefs_order = ('rolecolors','login','defaults','quotas','autoenroll', 'autoupdate','autocreate','directorysrch','contacts', 'usercreation','selfcreation','usermodification','scantron', 'requestcourses','requestauthor','coursecategories', - 'serverstatuses','coursedefaults','selfenrollment', - 'usersessions'); + 'serverstatuses','helpsettings', + 'coursedefaults','selfenrollment','usersessions'); my %existing; if (ref($domconfig{'loadbalancing'}) eq 'HASH') { %existing = %{$domconfig{'loadbalancing'}}; @@ -407,6 +407,14 @@ sub handler { print => \&print_serverstatuses, modify => \&modify_serverstatuses, }, + 'helpsettings' => + {text => 'Help page settings', + help => 'Domain_Configuration_Help_Settings', + header => [{col1 => 'Help Settings (logged-in users)', + col2 => 'Value'}], + print => \&print_helpsettings, + modify => \&modify_helpsettings, + }, 'coursedefaults' => {text => 'Course/Community defaults', help => 'Domain_Configuration_Course_Defaults', @@ -429,6 +437,14 @@ sub handler { print => \&print_selfenrollment, modify => \&modify_selfenrollment, }, + 'privacy' => + {text => 'User Privacy', + help => 'Domain_Configuration_User_Privacy', + header => [{col1 => 'Setting', + col2 => 'Value',}], + print => \&print_privacy, + modify => \&modify_privacy, + }, 'usersessions' => {text => 'User session hosting/offloading', help => 'Domain_Configuration_User_Sessions', @@ -613,6 +629,8 @@ sub process_changes { $output = &modify_quotas($r,$dom,$action,$lastactref,%domconfig); } elsif ($action eq 'requestauthor') { $output = &modify_quotas($r,$dom,$action,$lastactref,%domconfig); + } elsif ($action eq 'helpsettings') { + $output = &modify_helpsettings($r,$dom,$confname,%domconfig); } elsif ($action eq 'coursedefaults') { $output = &modify_coursedefaults($dom,$lastactref,%domconfig); } elsif ($action eq 'selfenrollment') { @@ -666,7 +684,7 @@ sub print_config_box { '; $rowtotal ++; if (($action eq 'autoupdate') || ($action eq 'usercreation') || ($action eq 'selfcreation') || - ($action eq 'usermodification') || ($action eq 'defaults') || + ($action eq 'usermodification') || ($action eq 'defaults') || ($action eq 'coursedefaults') || ($action eq 'selfenrollment') || ($action eq 'usersessions')) { $output .= $item->{'print'}->('top',$dom,$settings,\$rowtotal); } elsif ($action eq 'coursecategories') { @@ -4063,43 +4081,6 @@ sub print_selfcreation { $$rowtotal ++; } } - my @fields = ('lastname','firstname','middlename','permanentemail','id','inststatus'); - my %fieldtitles = &Apache::loncommon::personal_data_fieldtitles(); - $fieldtitles{'inststatus'} = &mt('Institutional status'); - my $rem; - my $numperrow = 2; - my $css_class = $$rowtotal%2?' class="LC_odd_row"':''; - $datatable .= ''. - ''.&mt('Shibboleth (SSO) Data').''. - ''."\n". - ''; - } - $datatable .= ''; - } - my $currval; - if (ref($createsettings->{'shibenv'}) eq 'HASH') { - $currval = $createsettings->{'shibenv'}{$fields[$i]}; - } - $datatable .= ''; - } - my $colsleft = $numperrow - $rem; - if ($colsleft > 1 ) { - $datatable .= ''; - } elsif ($colsleft == 1) { - $datatable .= ''; - } - $datatable .= '
'."\n"; - for (my $i=0; $i<@fields; $i++) { - $rem = $i%($numperrow); - if ($rem == 0) { - if ($i > 0) { - $datatable .= '
'. - ''. - ' '. - $fieldtitles{$fields[$i]}.''. - '  
'; - $$rowtotal ++; } elsif ($position eq 'middle') { my %domconf = &Apache::lonnet::get_dom('configuration',['usermodification'],$dom); my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom); @@ -4110,7 +4091,7 @@ sub print_selfcreation { foreach my $status (@{$types}) { $datatable .= &modifiable_userdata_row('selfcreate',$status,$domconf{'usermodification'}, $numinrow,$$rowtotal,$usertypes); - $$rowtotal ++; + $$rowtotal ++; } } } else { @@ -4156,8 +4137,8 @@ sub print_selfcreation { $additional .= ''."\n"; ($datatable,$itemcount) = &radiobutton_prefs(\%radiohash,\@toggles,\%defaultchecked, - \%choices,$$rowtotal,$onclick,$additional); - $$rowtotal ++; + \%choices,$itemcount,$onclick,$additional); + $$rowtotal += $itemcount; $datatable .= &print_requestmail($dom,'selfcreation',$createsettings,$rowtotal); $$rowtotal ++; my ($infofields,$infotitles) = &Apache::loncommon::emailusername_info(); @@ -8355,7 +8336,7 @@ sub modify_selfcreation { if (($item eq 'selfcreate') || ($item eq 'statustocreate') || ($item eq 'captcha') || ($item eq 'recaptchakeys') || ($item eq 'emailusername') || ($item eq 'notify') || - ($item eq 'selfcreateprocessing') || ($item eq 'shibenv')) { + ($item eq 'selfcreateprocessing')) { $curr_usercreation{$key}{$item} = $domconfig{'usercreation'}{$key}{$item}; } else { $save_usercreate{$key}{$item} = $domconfig{'usercreation'}{$key}{$item}; @@ -8387,7 +8368,6 @@ sub modify_selfcreation { %{$cancreate{'emailusername'}} = (); @{$cancreate{'statustocreate'}} = (); %{$cancreate{'selfcreateprocessing'}} = (); - %{$cancreate{'shibenv'}} = (); my %selfcreatetypes = ( sso => 'users authenticated by institutional single sign on', login => 'users authenticated by institutional log-in', @@ -8505,7 +8485,6 @@ sub modify_selfcreation { } my @fields = ('lastname','firstname','middlename','generation', 'permanentemail','id'); - my @shibfields = (@fields,'inststatus'); my %fieldtitles = &Apache::loncommon::personal_data_fieldtitles(); # # Where usernames may created for institutional log-in and/or institutional single sign on: @@ -8550,27 +8529,6 @@ sub modify_selfcreation { } } } - foreach my $field (@shibfields) { - if ($env{'form.shibenv_'.$field} ne '') { - $cancreate{'shibenv'}{$field} = $env{'form.shibenv_'.$field}; - } - } - if (ref($curr_usercreation{'cancreate'}) eq 'HASH') { - if (ref($curr_usercreation{'cancreate'}{'shibenv'}) eq 'HASH') { - foreach my $field (@shibfields) { - if ($env{'form.shibenv_'.$field} ne $curr_usercreation{'cancreate'}{'shibenv'}{$field}) { - push(@{$changes{'cancreate'}},'shibenv'); - } - } - } else { - foreach my $field (@shibfields) { - if ($env{'form.shibenv_'.$field}) { - push(@{$changes{'cancreate'}},'shibenv'); - last; - } - } - } - } } foreach my $item (@contexts) { if (ref($curr_usercreation{'cancreate'}{$item}) eq 'ARRAY') { @@ -8693,9 +8651,6 @@ sub modify_selfcreation { if (ref($cancreate{'statustocreate'}) eq 'ARRAY') { $save_usercreate{'cancreate'}{'statustocreate'} = $cancreate{'statustocreate'}; } - if (ref($cancreate{'shibenv'}) eq 'HASH') { - $save_usercreate{'cancreate'}{'shibenv'} = $cancreate{'shibenv'}; - } $save_usercreate{'cancreate'}{'emailusername'} = $cancreate{'emailusername'}; $save_usercreate{'emailrule'} = \@email_rule; @@ -8738,22 +8693,6 @@ sub modify_selfcreation { } } } - } elsif ($type eq 'shibenv') { - if (keys(%{$cancreate{$type}}) == 0) { - $chgtext .= &mt('Shibboleth-autheticated user does not use environment variables to set user information'); - } else { - $chgtext .= &mt('Shibboleth-autheticated user information set from environment variables, as follows:'). - ''; - } } elsif ($type eq 'statustocreate') { if ((ref($cancreate{'selfcreate'}) eq 'ARRAY') && (ref($cancreate{'statustocreate'}) eq 'ARRAY')) {