--- loncom/interface/domainprefs.pm 2011/10/30 22:19:15 1.158 +++ loncom/interface/domainprefs.pm 2012/06/01 12:15:23 1.160.6.4 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: domainprefs.pm,v 1.158 2011/10/30 22:19:15 raeburn Exp $ +# $Id: domainprefs.pm,v 1.160.6.4 2012/06/01 12:15:23 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -210,13 +210,13 @@ sub handler { 'quotas','autoenroll','autoupdate','autocreate', 'directorysrch','usercreation','usermodification', 'contacts','defaults','scantron','coursecategories', - 'serverstatuses','requestcourses','helpsettings', - 'coursedefaults','usersessions','loadbalancing'],$dom); + 'serverstatuses','requestcourses','usersessions', + 'loadbalancing'],$dom); my @prefs_order = ('rolecolors','login','defaults','quotas','autoenroll', 'autoupdate','autocreate','directorysrch','contacts', 'usercreation','usermodification','scantron', - 'requestcourses','coursecategories','serverstatuses','helpsettings', - 'coursedefaults','usersessions'); + 'requestcourses','coursecategories','serverstatuses', + 'usersessions'); if (keys(%servers) > 1) { push(@prefs_order,'loadbalancing'); } @@ -247,7 +247,7 @@ sub handler { col2 => 'Value'}], }, 'quotas' => - { text => 'User blogs, personal information pages, portfolios', + { text => 'Blogs, personal web pages, webDAV, portfolios', help => 'Domain_Configuration_Quotas', header => [{col1 => 'User affiliation', col2 => 'Available tools', @@ -340,28 +340,6 @@ sub handler { col3 => 'Specific IPs', }], }, - 'helpsettings' => - {text => 'Help page settings', - help => 'Domain_Configuration_Help_Settings', - header => [{col1 => 'Authenticated Help Settings', - col2 => ''}, - {col1 => 'Unauthenticated Help Settings', - col2 => ''}], - }, - 'coursedefaults' => - {text => 'Course/Community defaults', - help => 'Domain_Configuration_Course_Defaults', - header => [{col1 => 'Defaults which can be overridden in each course by a CC', - col2 => 'Value',}, - {col1 => 'Defaults which can be overridden for each course by a DC', - col2 => 'Value',},], - }, - 'privacy' => - {text => 'User Privacy', - help => 'Domain_Configuration_User_Privacy', - header => [{col1 => 'Setting', - col2 => 'Value',}], - }, 'usersessions' => {text => 'User session hosting/offloading', help => 'Domain_Configuration_User_Sessions', @@ -487,10 +465,6 @@ sub process_changes { $output = &modify_serverstatuses($dom,%domconfig); } elsif ($action eq 'requestcourses') { $output = &modify_quotas($dom,$action,%domconfig); - } elsif ($action eq 'helpsettings') { - $output = &modify_helpsettings($r,$dom,$confname,%domconfig); - } elsif ($action eq 'coursedefaults') { - $output = &modify_coursedefaults($dom,%domconfig); } elsif ($action eq 'usersessions') { $output = &modify_usersessions($dom,%domconfig); } elsif ($action eq 'loadbalancing') { @@ -549,14 +523,10 @@ sub print_config_box { $colspan = ' colspan="2"'; } elsif ($action eq 'requestcourses') { $output .= &print_quotas($dom,$settings,\$rowtotal,$action); - } elsif ($action eq 'helpsettings') { - $output .= &print_helpsettings('top',$dom,$confname,$settings,\$rowtotal); } elsif ($action eq 'usersessions') { $output .= &print_usersessions('top',$dom,$settings,\$rowtotal); } elsif ($action eq 'rolecolors') { $output .= &print_rolecolors($phase,'student',$dom,$confname,$settings,\$rowtotal); - } elsif ($action eq 'coursedefaults') { - $output .= &print_coursedefaults('top',$dom,$settings,\$rowtotal); } $output .= ' @@ -1058,6 +1028,7 @@ sub print_rolecolors { sub display_color_options { my ($dom,$confname,$phase,$role,$itemcount,$choices,$is_custom,$defaults,$designs, $images,$bgs,$links,$alt_text,$rowtotal,$logintext) = @_; + my $londocroot = $Apache::lonnet::perlvar{'lonDocRoot'}; my $css_class = $itemcount%2?' class="LC_odd_row"':''; my $datatable = ''. ''.$choices->{'font'}.''; @@ -1135,11 +1106,11 @@ sub display_color_options { $showfile = $imgfile; my $imgdir = $1; my $filename = $2; - if (-e "/home/httpd/html/$imgdir/tn-".$filename) { + if (-e "$londocroot/$imgdir/tn-".$filename) { $showfile = "/$imgdir/tn-".$filename; } else { - my $input = "/home/httpd/html".$imgfile; - my $output = '/home/httpd/html/'.$imgdir.'/tn-'.$filename; + my $input = $londocroot.$imgfile; + my $output = "$londocroot/$imgdir/tn-".$filename; if (!-e $output) { my ($width,$height) = &thumb_dimensions(); my ($fullwidth,$fullheight) = &check_dimensions($input); @@ -1147,7 +1118,7 @@ sub display_color_options { if ($fullwidth > $width && $fullheight > $height) { my $size = $width.'x'.$height; system("convert -sample $size $input $output"); - $showfile = '/'.$imgdir.'/tn-'.$filename; + $showfile = "/$imgdir/tn-".$filename; } } } @@ -1376,7 +1347,7 @@ sub print_quotas { %validations = &Apache::lonnet::auto_courserequest_checks($dom); %titles = &courserequest_titles(); } else { - @usertools = ('aboutme','blog','portfolio'); + @usertools = ('aboutme','blog','webdav','portfolio'); %titles = &tool_titles(); } if (ref($types) eq 'ARRAY') { @@ -2913,6 +2884,7 @@ sub loadbalance_rule_row { } else { push(@rulenames,'specific'); } + push(@rulenames,'none'); my $style = $targets_div_style; if (($type eq '_LC_external') || ($type eq '_LC_internetdom')) { $style = $homedom_div_style; @@ -2969,6 +2941,7 @@ sub offloadtype_text { 'homeserver' => "Offloads to user's home server", 'externalbalancer' => "Offloads to Load Balancer in user's domain", 'specific' => 'Offloads to specific server', + 'none' => 'No offload', ); return %ruletitles; } @@ -3000,8 +2973,9 @@ sub contact_titles { sub tool_titles { my %titles = &Apache::lonlocal::texthash ( - aboutme => 'Personal Information Page', + aboutme => 'Personal web page', blog => 'Blog', + webdav => 'WebDAV', portfolio => 'Portfolio', official => 'Official courses (with institutional codes)', unofficial => 'Unofficial courses', @@ -5161,7 +5135,7 @@ sub notifysubscribed { print $logfh $reply; } print $logfh "\n============ Done ============\n"; - close(logfh); + close($logfh); } } } @@ -5218,7 +5192,7 @@ sub modify_quotas { $toolregexp = join('|',@usertools); %conditions = &courserequest_conditions(); } else { - @usertools = ('aboutme','blog','portfolio'); + @usertools = ('aboutme','blog','webdav','portfolio'); %titles = &tool_titles(); } my %domdefaults = &Apache::lonnet::get_domain_defaults($dom);