version 1.102.2.14, 2010/04/14 05:16:47
|
version 1.121, 2009/11/30 06:23:32
|
Line 199 sub handler {
|
Line 199 sub handler {
|
} |
} |
my %domconfig = |
my %domconfig = |
&Apache::lonnet::get_dom('configuration',['login','rolecolors', |
&Apache::lonnet::get_dom('configuration',['login','rolecolors', |
'quotas','autoenroll','autoupdate','autocreate', |
'quotas','autoenroll','autoupdate','directorysrch', |
'directorysrch','usercreation','usermodification', |
'usercreation','usermodification','contacts','defaults', |
'contacts','defaults','scantron','coursecategories', |
'scantron','coursecategories','serverstatuses', |
'serverstatuses','requestcourses'],$dom); |
'requestcourses','helpsettings','coursedefaults'],$dom); |
my @prefs_order = ('rolecolors','login','defaults','quotas','autoenroll', |
my @prefs_order = ('rolecolors','login','defaults','quotas','autoenroll', |
'autoupdate','autocreate','directorysrch','contacts', |
'autoupdate','directorysrch','contacts', |
'usercreation','usermodification','scantron', |
'usercreation','usermodification','scantron', |
'requestcourses','coursecategories','serverstatuses'); |
'requestcourses','coursecategories','serverstatuses','helpsettings', |
|
'coursedefaults'); |
my %prefs = ( |
my %prefs = ( |
'rolecolors' => |
'rolecolors' => |
{ text => 'Default color schemes', |
{ text => 'Default color schemes', |
Line 220 sub handler {
|
Line 221 sub handler {
|
{col1 => 'Administrator Settings', |
{col1 => 'Administrator Settings', |
col2 => '',}], |
col2 => '',}], |
}, |
}, |
'login' => |
'login' => |
{ text => 'Log-in page options', |
{ text => 'Log-in page options', |
help => 'Domain_Configuration_Login_Page', |
help => 'Domain_Configuration_Login_Page', |
header => [{col1 => 'Item', |
header => [{col1 => 'Item', |
col2 => '',}], |
col2 => '',}], |
}, |
}, |
|
|
'defaults' => |
'defaults' => |
{ text => 'Default authentication/language/timezone', |
{ text => 'Default authentication/language/timezone', |
help => 'Domain_Configuration_LangTZAuth', |
help => 'Domain_Configuration_LangTZAuth', |
Line 233 sub handler {
|
Line 235 sub handler {
|
col2 => 'Value'}], |
col2 => 'Value'}], |
}, |
}, |
'quotas' => |
'quotas' => |
{ text => 'User blogs, personal information pages, portfolios', |
{ text => 'User blogs, personal information pages and portfolios', |
help => 'Domain_Configuration_Quotas', |
help => 'Domain_Configuration_Quotas', |
header => [{col1 => 'User affiliation', |
header => [{col1 => 'User affiliation', |
col2 => 'Available tools', |
col2 => 'Available tools', |
Line 250 sub handler {
|
Line 252 sub handler {
|
help => 'Domain_Configuration_Auto_Updates', |
help => 'Domain_Configuration_Auto_Updates', |
header => [{col1 => 'Setting', |
header => [{col1 => 'Setting', |
col2 => 'Value',}, |
col2 => 'Value',}, |
{col1 => 'Setting', |
|
col2 => 'Affiliation'}, |
|
{col1 => 'User population', |
{col1 => 'User population', |
col2 => 'Updateable user data'}], |
col2 => 'Updataeable user data'}], |
}, |
|
'autocreate' => |
|
{ text => 'Auto-course creation settings', |
|
help => 'Domain_Configuration_Auto_Creation', |
|
header => [{col1 => 'Configuration Setting', |
|
col2 => 'Value',}], |
|
}, |
}, |
'directorysrch' => |
'directorysrch' => |
{ text => 'Institutional directory searches', |
{ text => 'Institutional directory searches', |
Line 326 sub handler {
|
Line 320 sub handler {
|
col3 => 'Specific IPs', |
col3 => 'Specific IPs', |
}], |
}], |
}, |
}, |
'coursedefaults' => |
'helpsettings' => |
|
{text => 'Help page settings', |
|
help => 'Domain_Configuration_Help_Settings', |
|
header => [{col1 => 'Setting', |
|
col2 => 'Value',}], |
|
}, |
|
'coursedefaults' => |
{text => 'Course/Community defaults', |
{text => 'Course/Community defaults', |
help => 'Domain_Configuration_Course_Defaults', |
help => 'Domain_Configuration_Course_Defaults', |
header => [{col1 => 'Setting', |
header => [{col1 => 'Setting', |
col2 => 'Value',}], |
col2 => 'Value',}], |
}, |
}, |
|
'privacy' => |
|
{text => 'User Privacy', |
|
help => 'Domain_Configuration_User_Privacy', |
|
header => [{col1 => 'Setting', |
|
col2 => 'Value',}], |
|
}, |
); |
); |
my %servers = &dom_servers($dom); |
my %servers = &dom_servers($dom); |
if (keys(%servers) > 1) { |
if (keys(%servers) > 1) { |
Line 347 sub handler {
|
Line 353 sub handler {
|
my @actions = &Apache::loncommon::get_env_multiple('form.actions'); |
my @actions = &Apache::loncommon::get_env_multiple('form.actions'); |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>"javascript:changePage(document.$phase,'pickactions')", |
({href=>"javascript:changePage(document.$phase,'pickactions')", |
text=>"Settings to display/modify"}); |
text=>"Pick functionality"}); |
my $confname = $dom.'-domainconfig'; |
my $confname = $dom.'-domainconfig'; |
if ($phase eq 'process') { |
if ($phase eq 'process') { |
&Apache::lonconfigsettings::make_changes($r,$dom,$phase,$context,\@prefs_order,\%prefs,\%domconfig,$confname,\@roles); |
&Apache::lonconfigsettings::make_changes($r,$dom,$phase,$context,\@prefs_order,\%prefs,\%domconfig,$confname,\@roles); |
Line 410 sub process_changes {
|
Line 416 sub process_changes {
|
$output = &modify_autoenroll($dom,%domconfig); |
$output = &modify_autoenroll($dom,%domconfig); |
} elsif ($action eq 'autoupdate') { |
} elsif ($action eq 'autoupdate') { |
$output = &modify_autoupdate($dom,%domconfig); |
$output = &modify_autoupdate($dom,%domconfig); |
} elsif ($action eq 'autocreate') { |
|
$output = &modify_autocreate($dom,%domconfig); |
|
} elsif ($action eq 'directorysrch') { |
} elsif ($action eq 'directorysrch') { |
$output = &modify_directorysrch($dom,%domconfig); |
$output = &modify_directorysrch($dom,%domconfig); |
} elsif ($action eq 'usercreation') { |
} elsif ($action eq 'usercreation') { |
Line 430 sub process_changes {
|
Line 434 sub process_changes {
|
$output = &modify_serverstatuses($dom,%domconfig); |
$output = &modify_serverstatuses($dom,%domconfig); |
} elsif ($action eq 'requestcourses') { |
} elsif ($action eq 'requestcourses') { |
$output = &modify_quotas($dom,$action,%domconfig); |
$output = &modify_quotas($dom,$action,%domconfig); |
|
} elsif ($action eq 'helpsettings') { |
|
$output = &modify_helpsettings($dom,%domconfig); |
|
} elsif ($action eq 'coursedefaults') { |
|
$output = &modify_coursedefaults($dom,%domconfig); |
} |
} |
return $output; |
return $output; |
} |
} |
Line 480 sub print_config_box {
|
Line 488 sub print_config_box {
|
$colspan = ' colspan="2"'; |
$colspan = ' colspan="2"'; |
} elsif ($action eq 'requestcourses') { |
} elsif ($action eq 'requestcourses') { |
$output .= &print_quotas($dom,$settings,\$rowtotal,$action); |
$output .= &print_quotas($dom,$settings,\$rowtotal,$action); |
|
} elsif ($action eq 'helpsettings') { |
|
$output .= &print_helpsettings($dom,$settings,\$rowtotal); |
} else { |
} else { |
$output .= &print_rolecolors($phase,'student',$dom,$confname,$settings,\$rowtotal); |
$output .= &print_rolecolors($phase,'student',$dom,$confname,$settings,\$rowtotal); |
} |
} |
Line 497 sub print_config_box {
|
Line 507 sub print_config_box {
|
</tr>'; |
</tr>'; |
$rowtotal ++; |
$rowtotal ++; |
if ($action eq 'autoupdate') { |
if ($action eq 'autoupdate') { |
$output .= &print_autoupdate('middle',$dom,$settings,\$rowtotal).' |
$output .= &print_autoupdate('bottom',$dom,$settings,\$rowtotal); |
</table> |
|
</td> |
|
</tr> |
|
<tr> |
|
<td> |
|
<table class="LC_nested"> |
|
<tr class="LC_info_row"> |
|
<td class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[2]->{'col1'}).'</td> |
|
<td class="LC_right_item">'.&mt($item->{'header'}->[2]->{'col2'}).'</td> </tr>'. |
|
&print_autoupdate('bottom',$dom,$settings,\$rowtotal); |
|
$rowtotal ++; |
|
} elsif ($action eq 'usercreation') { |
} elsif ($action eq 'usercreation') { |
$output .= &print_usercreation('middle',$dom,$settings,\$rowtotal).' |
$output .= &print_usercreation('middle',$dom,$settings,\$rowtotal).' |
</table> |
</table> |
Line 532 sub print_config_box {
|
Line 531 sub print_config_box {
|
<table class="LC_nested"> |
<table class="LC_nested"> |
<tr class="LC_info_row"> |
<tr class="LC_info_row"> |
<td class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[2]->{'col1'}).'</td> |
<td class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[2]->{'col1'}).'</td> |
<td class="LC_right_item">'.&mt($item->{'header'}->[2]->{'col2'}).'</td></tr>'. |
<td class="LC_right_item">'.&mt($item->{'header'}->[2]->{'col2'}).'</td> </tr>'. |
|
|
&print_usermodification('bottom',$dom,$settings,\$rowtotal); |
&print_usermodification('bottom',$dom,$settings,\$rowtotal); |
$rowtotal ++; |
$rowtotal ++; |
} elsif ($action eq 'coursecategories') { |
} elsif ($action eq 'coursecategories') { |
Line 615 sub print_config_box {
|
Line 615 sub print_config_box {
|
$output .= &print_quotas($dom,$settings,\$rowtotal,$action); |
$output .= &print_quotas($dom,$settings,\$rowtotal,$action); |
} elsif ($action eq 'autoenroll') { |
} elsif ($action eq 'autoenroll') { |
$output .= &print_autoenroll($dom,$settings,\$rowtotal); |
$output .= &print_autoenroll($dom,$settings,\$rowtotal); |
} elsif ($action eq 'autocreate') { |
|
$output .= &print_autocreate($dom,$settings,\$rowtotal); |
|
} elsif ($action eq 'directorysrch') { |
} elsif ($action eq 'directorysrch') { |
$output .= &print_directorysrch($dom,$settings,\$rowtotal); |
$output .= &print_directorysrch($dom,$settings,\$rowtotal); |
} elsif ($action eq 'contacts') { |
} elsif ($action eq 'contacts') { |
Line 627 sub print_config_box {
|
Line 625 sub print_config_box {
|
$output .= &print_scantronformat($r,$dom,$confname,$settings,\$rowtotal); |
$output .= &print_scantronformat($r,$dom,$confname,$settings,\$rowtotal); |
} elsif ($action eq 'serverstatuses') { |
} elsif ($action eq 'serverstatuses') { |
$output .= &print_serverstatuses($dom,$settings,\$rowtotal); |
$output .= &print_serverstatuses($dom,$settings,\$rowtotal); |
|
} elsif ($action eq 'helpsettings') { |
|
$output .= &print_helpsettings($dom,$settings,\$rowtotal); |
|
} elsif ($action eq 'coursedefaults') { |
|
$output .= &print_coursedefaults($dom,$settings,\$rowtotal); |
} |
} |
} |
} |
$output .= ' |
$output .= ' |
Line 641 sub print_login {
|
Line 643 sub print_login {
|
my ($position,$dom,$confname,$phase,$settings,$rowtotal) = @_; |
my ($position,$dom,$confname,$phase,$settings,$rowtotal) = @_; |
my ($css_class,$datatable); |
my ($css_class,$datatable); |
my %choices = &login_choices(); |
my %choices = &login_choices(); |
|
my $itemcount = 1; |
|
|
if ($position eq 'top') { |
if ($position eq 'top') { |
my %servers = &dom_servers($dom); |
my %servers = &dom_servers($dom); |
my $choice = $choices{'disallowlogin'}; |
my $choice = $choices{'disallowlogin'}; |
$css_class = ' class="LC_odd_row"'; |
$css_class = ' class="LC_odd_row"'; |
$datatable .= '<tr'.$css_class.'><td>'.$choice.'</td>'. |
$datatable .= '<tr'.$css_class.'><td>'.$choices{'disallowlogin'}.'</td>'. |
'<td align="right"><table><tr><th>'.$choices{'hostid'}.'</th>'. |
'<td align="right"><table><tr><th>'.$choices{'hostid'}.'</th>'. |
'<th>'.$choices{'server'}.'</th>'. |
'<th>'.$choices{'serverurl'}.'</th></tr>'."\n"; |
'<th>'.$choices{'serverpath'}.'</th>'. |
|
'<th>'.$choices{'custompath'}.'</th>'. |
|
'<th><span class="LC_nobreak">'.$choices{'exempt'}.'</span></th></tr>'."\n"; |
|
my %disallowed; |
my %disallowed; |
if (ref($settings) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
if (ref($settings->{'loginvia'}) eq 'HASH') { |
if (ref($settings->{'loginvia'}) eq 'HASH') { |
Line 660 sub print_login {
|
Line 660 sub print_login {
|
} |
} |
foreach my $lonhost (sort(keys(%servers))) { |
foreach my $lonhost (sort(keys(%servers))) { |
my $direct = 'selected="selected"'; |
my $direct = 'selected="selected"'; |
if (ref($disallowed{$lonhost}) eq 'HASH') { |
if ($disallowed{$lonhost} eq '') { |
if ($disallowed{$lonhost}{'server'} ne '') { |
$direct = ''; |
$direct = ''; |
|
} |
|
} |
} |
$datatable .= '<tr><td>'.$servers{$lonhost}.'</td>'. |
$datatable .= '<tr><td>'.$servers{$lonhost}.'</td>'. |
'<td><select name="'.$lonhost.'_server">'. |
'<td><select name="'.$lonhost.'_serverurl">'. |
'<option value=""'.$direct.'>'.$choices{'directlogin'}. |
'<option value=""'.$direct.'>'.$choices{'directlogin'}. |
'</option>'; |
'</option>'; |
foreach my $hostid (keys(%servers)) { |
foreach my $hostid (keys(%servers)) { |
next if ($servers{$hostid} eq $servers{$lonhost}); |
next if ($servers{$hostid} eq $servers{$lonhost}); |
my $selected = ''; |
my $selected = ''; |
if (ref($disallowed{$lonhost}) eq 'HASH') { |
if ($hostid eq $disallowed{$lonhost}) { |
if ($hostid eq $disallowed{$lonhost}{'server'}) { |
$selected = 'selected="selected"'; |
$selected = 'selected="selected"'; |
|
} |
|
} |
} |
$datatable .= '<option value="'.$hostid.'"'.$selected.'>'. |
$datatable .= '<option value="'.$hostid.'"'.$selected.'>'. |
$servers{$hostid}.'</option>'; |
$servers{$hostid}.'</option>'; |
} |
} |
$datatable .= '</select></td>'. |
$datatable .= '</select></td></tr>'; |
'<td><select name="'.$lonhost.'_serverpath">'; |
|
foreach my $path ('','/','/adm/login','/adm/roles','custom') { |
|
my $pathname = $path; |
|
if ($path eq 'custom') { |
|
$pathname = &mt('Custom Path').' ->'; |
|
} |
|
my $selected = ''; |
|
if (ref($disallowed{$lonhost}) eq 'HASH') { |
|
if ($path eq $disallowed{$lonhost}{'serverpath'}) { |
|
$selected = 'selected="selected"'; |
|
} |
|
} elsif ($path eq '') { |
|
$selected = 'selected="selected"'; |
|
} |
|
$datatable .= '<option value="'.$path.'"'.$selected.'>'.$pathname.'</option>'; |
|
} |
|
$datatable .= '</select></td>'; |
|
my ($custom,$exempt); |
|
if (ref($disallowed{$lonhost}) eq 'HASH') { |
|
$custom = $disallowed{$lonhost}{'custompath'}; |
|
$exempt = $disallowed{$lonhost}{'exempt'}; |
|
} |
|
$datatable .= '<td><input type="text" name="'.$lonhost.'_custompath" size="6" value="'.$custom.'" /></td>'. |
|
'<td><input type="text" name="'.$lonhost.'_exempt" size="8" value="'.$exempt.'" /></td>'. |
|
'</tr>'; |
|
} |
} |
$datatable .= '</table></td></tr>'; |
$datatable .= '</table></td></tr>'; |
return $datatable; |
return $datatable; |
Line 846 sub login_choices {
|
Line 817 sub login_choices {
|
my %choices = |
my %choices = |
&Apache::lonlocal::texthash ( |
&Apache::lonlocal::texthash ( |
coursecatalog => 'Display Course/Community Catalog link?', |
coursecatalog => 'Display Course/Community Catalog link?', |
adminmail => "Display Administrator's E-mail Address?", |
adminmail => "Display Administrator's E-mail Address?", |
disallowlogin => "Login page requests redirected", |
disallowlogin => "Login page requests redirected", |
hostid => "Server", |
hostid => "Server", |
server => "Redirect to:", |
serverurl => "Redirect to log-in via:", |
serverpath => "Path", |
|
custompath => "Custom", |
|
exempt => "Exempt IP(s)", |
|
directlogin => "No redirect", |
directlogin => "No redirect", |
newuser => "Link to create a user account", |
newuser => "Link to create a user account", |
img => "Header", |
img => "Header", |
logo => "Main Logo", |
logo => "Main Logo", |
domlogo => "Domain Logo", |
domlogo => "Domain Logo", |
login => "Log-in Header", |
login => "Log-in Header", |
textcol => "Text color", |
textcol => "Text color", |
bgcol => "Box color", |
bgcol => "Box color", |
bgs => "Background colors", |
bgs => "Background colors", |
links => "Link colors", |
links => "Link colors", |
font => "Font color", |
font => "Font color", |
pgbg => "Header", |
pgbg => "Header", |
mainbg => "Page", |
mainbg => "Page", |
sidebg => "Login box", |
sidebg => "Login box", |
link => "Link", |
link => "Link", |
alink => "Active link", |
alink => "Active link", |
vlink => "Visited link", |
vlink => "Visited link", |
); |
); |
return %choices; |
return %choices; |
} |
} |
Line 887 sub print_rolecolors {
|
Line 855 sub print_rolecolors {
|
my %defaults = ( |
my %defaults = ( |
img => $defaultdesign{$role.'.img'}, |
img => $defaultdesign{$role.'.img'}, |
font => $defaultdesign{$role.'.font'}, |
font => $defaultdesign{$role.'.font'}, |
|
fontmenu => $defaultdesign{$role.'.fontmenu'}, |
); |
); |
foreach my $item (@bgs) { |
foreach my $item (@bgs) { |
$defaults{'bgs'}{$item} = $defaultdesign{$role.'.'.$item}; |
$defaults{'bgs'}{$item} = $defaultdesign{$role.'.'.$item}; |
Line 904 sub print_rolecolors {
|
Line 873 sub print_rolecolors {
|
$designs{'font'} = $settings->{$role}->{'font'}; |
$designs{'font'} = $settings->{$role}->{'font'}; |
$is_custom{'font'} = 1; |
$is_custom{'font'} = 1; |
} |
} |
|
if ($settings->{$role}->{'fontmenu'} ne '') { |
|
$designs{'fontmenu'} = $settings->{$role}->{'fontmenu'}; |
|
$is_custom{'fontmenu'} = 1; |
|
} |
foreach my $item (@bgs) { |
foreach my $item (@bgs) { |
if ($settings->{$role}->{$item} ne '') { |
if ($settings->{$role}->{$item} ne '') { |
$designs{'bgs'}{$item} = $settings->{$role}->{$item}; |
$designs{'bgs'}{$item} = $settings->{$role}->{$item}; |
Line 922 sub print_rolecolors {
|
Line 895 sub print_rolecolors {
|
$designs{img} = $designhash{$dom.'.'.$role.'.img'}; |
$designs{img} = $designhash{$dom.'.'.$role.'.img'}; |
$is_custom{'img'} = 1; |
$is_custom{'img'} = 1; |
} |
} |
|
if ($designhash{$dom.'.'.$role.'.fontmenu'} ne '') { |
|
$designs{fontmenu} = $designhash{$dom.'.'.$role.'.fontmenu'}; |
|
$is_custom{'fontmenu'} = 1; |
|
} |
if ($designhash{$dom.'.'.$role.'.font'} ne '') { |
if ($designhash{$dom.'.'.$role.'.font'} ne '') { |
$designs{font} = $designhash{$dom.'.'.$role.'.font'}; |
$designs{font} = $designhash{$dom.'.'.$role.'.font'}; |
$is_custom{'font'} = 1; |
$is_custom{'font'} = 1; |
Line 950 sub display_color_options {
|
Line 927 sub display_color_options {
|
my ($dom,$confname,$phase,$role,$itemcount,$choices,$is_custom,$defaults,$designs, |
my ($dom,$confname,$phase,$role,$itemcount,$choices,$is_custom,$defaults,$designs, |
$images,$bgs,$links,$alt_text,$rowtotal,$logintext,$loginheader) = @_; |
$images,$bgs,$links,$alt_text,$rowtotal,$logintext,$loginheader) = @_; |
my $css_class = $itemcount%2?' class="LC_odd_row"':''; |
my $css_class = $itemcount%2?' class="LC_odd_row"':''; |
my $datatable = '<tr'.$css_class.'>'. |
my $datatable = '<tr>'. |
'<td>'.$choices->{'font'}.'</td>'; |
'<td>'.$choices->{'font'}.'</td>'; |
if (!$is_custom->{'font'}) { |
if (!$is_custom->{'font'}) { |
$datatable .= '<td>'.&mt('Default in use:').' <span id="css_default_'.$role.'_font" style="color: '.$defaults->{'font'}.';">'.$defaults->{'font'}.'</span></td>'; |
$datatable .= '<td>'.&mt('Default in use:').' <span id="css_default_'.$role.'_font" style="color: '.$defaults->{'font'}.';">'.$defaults->{'font'}.'</span></td>'; |
Line 964 sub display_color_options {
|
Line 941 sub display_color_options {
|
' <span id="css_'.$role.'_font" style="background-color: '. |
' <span id="css_'.$role.'_font" style="background-color: '. |
$designs->{'font'}.';"> </span>'. |
$designs->{'font'}.';"> </span>'. |
'</span></td></tr>'; |
'</span></td></tr>'; |
|
unless ($role eq 'login') { |
|
$datatable .= '<tr'.$css_class.'>'. |
|
'<td>'.$choices->{'fontmenu'}.'</td>'; |
|
if (!$is_custom->{'fontmenu'}) { |
|
$datatable .= '<td>'.&mt('Default in use:').' <span id="css_default_'.$role.'_font" style="color: '.$defaults->{'fontmenu'}.';">'.$defaults->{'fontmenu'}.'</span></td>'; |
|
} else { |
|
$datatable .= '<td> </td>'; |
|
} |
|
$fontlink = &color_pick($phase,$role,'fontmenu',$choices->{'fontmenu'},$designs->{'fontmenu'}); |
|
$datatable .= '<td><span class="LC_nobreak">'. |
|
'<input type="text" size="10" name="'.$role.'_fontmenu"'. |
|
' value="'.$designs->{'fontmenu'}.'" /> '.$fontlink. |
|
' <span id="css_'.$role.'_fontmenu" style="background-color: '. |
|
$designs->{'fontmenu'}.';"> </span>'. |
|
'</span></td></tr>'; |
|
} |
my $switchserver = &check_switchserver($dom,$confname); |
my $switchserver = &check_switchserver($dom,$confname); |
foreach my $img (@{$images}) { |
foreach my $img (@{$images}) { |
$itemcount ++; |
$itemcount ++; |
Line 1319 sub print_quotas {
|
Line 1312 sub print_quotas {
|
$cell{$item} .= '<span class="LC_nobreak"><label>'. |
$cell{$item} .= '<span class="LC_nobreak"><label>'. |
'<input type="radio" name="crsreq_'.$item. |
'<input type="radio" name="crsreq_'.$item. |
'_'.$type.'" value="'.$val.'"'.$checked.' />'. |
'_'.$type.'" value="'.$val.'"'.$checked.' />'. |
$titles{$option}.'</label>'; |
$titles{$option}.'</label> '; |
if ($option eq 'autolimit') { |
if ($option eq 'autolimit') { |
$cell{$item} .= ' <input type="text" name="crsreq_'. |
$cell{$item} .= '<input type="text" name="crsreq_'. |
$item.'_limit_'.$type.'" size="1" '. |
$item.'_limit_'.$type.'" size="1" '. |
'value="'.$currlimit.'" />'; |
'value="'.$currlimit.'" />'; |
} |
} |
$cell{$item} .= '</span> '; |
$cell{$item} .= '</span> '; |
if ($option eq 'autolimit') { |
if ($option eq 'autolimit') { |
$cell{$item} .= $titles{'unlimited'}; |
$cell{$item} .= $titles{'unlimited'} |
} |
} |
} |
} |
} else { |
} else { |
Line 1350 sub print_quotas {
|
Line 1343 sub print_quotas {
|
if ($context eq 'requestcourses') { |
if ($context eq 'requestcourses') { |
$datatable .= '</tr><tr>'; |
$datatable .= '</tr><tr>'; |
foreach my $item (@usertools) { |
foreach my $item (@usertools) { |
$datatable .= '<td style="vertical-align: top;">'.$cell{$item}.'</td>'; |
$datatable .= '<td style="vertical-align: top">'.$cell{$item}.'</td>'; |
} |
} |
$datatable .= '</tr></table>'; |
$datatable .= '</tr></table>'; |
} |
} |
Line 1427 sub print_quotas {
|
Line 1420 sub print_quotas {
|
'_default" value="'.$val.'"'.$checked.' />'. |
'_default" value="'.$val.'"'.$checked.' />'. |
$titles{$option}.'</label>'; |
$titles{$option}.'</label>'; |
if ($option eq 'autolimit') { |
if ($option eq 'autolimit') { |
$defcell{$item} .= ' <input type="text" name="crsreq_'. |
$defcell{$item} .= '<input type="text" name="crsreq_'. |
$item.'_limit_default" size="1" '. |
$item.'_limit_default" size="1" '. |
'value="'.$currlimit.'" />'; |
'value="'.$currlimit.'" />'; |
} |
} |
$defcell{$item} .= '</span> '; |
$defcell{$item} .= '</span> '; |
if ($option eq 'autolimit') { |
if ($option eq 'autolimit') { |
$defcell{$item} .= $titles{'unlimited'}; |
$defcell{$item} .= $titles{'unlimited'} |
} |
} |
} |
} |
} else { |
} else { |
Line 1456 sub print_quotas {
|
Line 1449 sub print_quotas {
|
if ($context eq 'requestcourses') { |
if ($context eq 'requestcourses') { |
$datatable .= '</tr><tr>'; |
$datatable .= '</tr><tr>'; |
foreach my $item (@usertools) { |
foreach my $item (@usertools) { |
$datatable .= '<td style="vertical-align: top;">'.$defcell{$item}.'</td>'; |
$datatable .= '<td style="vertical-align: top">'.$defcell{$item}.'</td>'; |
} |
} |
$datatable .= '</tr></table>'; |
$datatable .= '</tr></table>'; |
} |
} |
Line 1530 sub print_quotas {
|
Line 1523 sub print_quotas {
|
'__LC_adv" value="'.$val.'"'.$checked.' />'. |
'__LC_adv" value="'.$val.'"'.$checked.' />'. |
$titles{$option}.'</label>'; |
$titles{$option}.'</label>'; |
if ($option eq 'autolimit') { |
if ($option eq 'autolimit') { |
$advcell{$item} .= ' <input type="text" name="crsreq_'. |
$advcell{$item} .= '<input type="text" name="crsreq_'. |
$item.'_limit__LC_adv" size="1" '. |
$item.'_limit__LC_adv" size="1" '. |
'value="'.$currlimit.'" />'; |
'value="'.$currlimit.'" />'; |
} |
} |
$advcell{$item} .= '</span> '; |
$advcell{$item} .= '</span> '; |
if ($option eq 'autolimit') { |
if ($option eq 'autolimit') { |
$advcell{$item} .= $titles{'unlimited'}; |
$advcell{$item} .= $titles{'unlimited'} |
} |
} |
} |
} |
} else { |
} else { |
Line 1559 sub print_quotas {
|
Line 1552 sub print_quotas {
|
if ($context eq 'requestcourses') { |
if ($context eq 'requestcourses') { |
$datatable .= '</tr><tr>'; |
$datatable .= '</tr><tr>'; |
foreach my $item (@usertools) { |
foreach my $item (@usertools) { |
$datatable .= '<td style="vertical-align: top;">'.$advcell{$item}.'</td>'; |
$datatable .= '<td style="vertical-align: top">'.$advcell{$item}.'</td>'; |
} |
} |
$datatable .= '</tr></table>'; |
$datatable .= '</tr></table>'; |
} |
} |
Line 1649 sub print_courserequestmail {
|
Line 1642 sub print_courserequestmail {
|
sub print_autoenroll { |
sub print_autoenroll { |
my ($dom,$settings,$rowtotal) = @_; |
my ($dom,$settings,$rowtotal) = @_; |
my $autorun = &Apache::lonnet::auto_run(undef,$dom), |
my $autorun = &Apache::lonnet::auto_run(undef,$dom), |
my ($defdom,$runon,$runoff,$coownerson,$coownersoff); |
my ($defdom,$runon,$runoff); |
if (ref($settings) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
if (exists($settings->{'run'})) { |
if (exists($settings->{'run'})) { |
if ($settings->{'run'} eq '0') { |
if ($settings->{'run'} eq '0') { |
Line 1668 sub print_autoenroll {
|
Line 1661 sub print_autoenroll {
|
$runon = ' '; |
$runon = ' '; |
} |
} |
} |
} |
if (exists($settings->{'co-owners'})) { |
|
if ($settings->{'co-owners'} eq '0') { |
|
$coownersoff = ' checked="checked" '; |
|
$coownerson = ' '; |
|
} else { |
|
$coownerson = ' checked="checked" '; |
|
$coownersoff = ' '; |
|
} |
|
} else { |
|
$coownersoff = ' checked="checked" '; |
|
$coownerson = ' '; |
|
} |
|
if (exists($settings->{'sender_domain'})) { |
if (exists($settings->{'sender_domain'})) { |
$defdom = $settings->{'sender_domain'}; |
$defdom = $settings->{'sender_domain'}; |
} |
} |
Line 1710 sub print_autoenroll {
|
Line 1691 sub print_autoenroll {
|
&mt('username').': '. |
&mt('username').': '. |
'<input type="text" name="sender_uname" value="'. |
'<input type="text" name="sender_uname" value="'. |
$notif_sender.'" size="10" /> '.&mt('domain'). |
$notif_sender.'" size="10" /> '.&mt('domain'). |
': '.$domform.'</span></td></tr>'. |
': '.$domform.'</span></td></tr>'; |
'<tr class="LC_odd_row">'. |
$$rowtotal += 2; |
'<td>'.&mt('Automatically assign co-ownership').'</td>'. |
|
'<td class="LC_right_item"><span class="LC_nobreak"><label>'. |
|
'<input type="radio" name="autoassign_coowners"'. |
|
$coownerson.' value="1" />'.&mt('Yes').'</label> '. |
|
'<label><input type="radio" name="autoassign_coowners"'. |
|
$coownersoff.' value="0" />'.&mt('No').'</label></span></td>'. |
|
'</tr>'; |
|
$$rowtotal += 3; |
|
return $datatable; |
return $datatable; |
} |
} |
|
|
Line 1761 sub print_autoupdate {
|
Line 1734 sub print_autoupdate {
|
$classlistsoff.'value="0" />'.&mt('No').'</label></span></td>'. |
$classlistsoff.'value="0" />'.&mt('No').'</label></span></td>'. |
'</tr>'; |
'</tr>'; |
$$rowtotal += 2; |
$$rowtotal += 2; |
} elsif ($position eq 'middle') { |
|
my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom); |
|
my $numinrow = 3; |
|
my $locknamesettings; |
|
$datatable .= &insttypes_row($settings,$types,$usertypes, |
|
$dom,$numinrow,$othertitle, |
|
'lockablenames'); |
|
$$rowtotal ++; |
|
} else { |
} else { |
my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom); |
my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom); |
my @fields = ('lastname','firstname','middlename','generation', |
my @fields = ('lastname','firstname','middlename','gen', |
'permanentemail','id'); |
'permanentemail','id'); |
my %fieldtitles = &Apache::loncommon::personal_data_fieldtitles(); |
my %fieldtitles = &Apache::loncommon::personal_data_fieldtitles(); |
my $numrows = 0; |
my $numrows = 0; |
Line 1792 sub print_autoupdate {
|
Line 1757 sub print_autoupdate {
|
return $datatable; |
return $datatable; |
} |
} |
|
|
sub print_autocreate { |
|
my ($dom,$settings,$rowtotal) = @_; |
|
my (%createon,%createoff); |
|
my $curr_dc; |
|
my @types = ('xml','req'); |
|
if (ref($settings) eq 'HASH') { |
|
foreach my $item (@types) { |
|
$createoff{$item} = ' checked="checked" '; |
|
$createon{$item} = ' '; |
|
if (exists($settings->{$item})) { |
|
if ($settings->{$item}) { |
|
$createon{$item} = ' checked="checked" '; |
|
$createoff{$item} = ' '; |
|
} |
|
} |
|
} |
|
$curr_dc = $settings->{'xmldc'}; |
|
} else { |
|
foreach my $item (@types) { |
|
$createoff{$item} = ' checked="checked" '; |
|
$createon{$item} = ' '; |
|
} |
|
} |
|
$$rowtotal += 2; |
|
my $datatable='<tr class="LC_odd_row">'. |
|
'<td>'.&mt('Create pending official courses from XML files').'</td>'. |
|
'<td class="LC_right_item"><span class="LC_nobreak"><label>'. |
|
'<input type="radio" name="autocreate_xml"'. |
|
$createon{'xml'}.' value="1" />'.&mt('Yes').'</label> '. |
|
'<label><input type="radio" name="autocreate_xml"'. |
|
$createoff{'xml'}.' value="0" />'.&mt('No').'</label></span>'; |
|
my ($numdc,$dctable) = &active_dc_picker($dom,$curr_dc); |
|
if ($numdc > 1) { |
|
$datatable .= '</td><tr><td>'. |
|
&mt('XML files processed as: (choose Dom. Coord.)'). |
|
'</td><td class="LC_left_item">'.$dctable.'</td></tr>'. |
|
'<tr class="LC_odd_row">'; |
|
$$rowtotal ++ ; |
|
} else { |
|
$datatable .= '</td></tr><tr>'; |
|
} |
|
$datatable .= '<td>'.&mt('Create pending requests for official courses (if validated)').'</td>'. |
|
'<td class="LC_right_item"><span class="LC_nobreak"><label>'. |
|
'<input type="radio" name="autocreate_req"'. |
|
$createon{'req'}.' value="1" />'.&mt('Yes').'</label> '. |
|
'<label><input type="radio" name="autocreate_req"'. |
|
$createoff{'req'}.' value="0" />'.&mt('No').'</label></span></td>'. |
|
'</tr>'; |
|
return $datatable; |
|
} |
|
|
|
sub print_directorysrch { |
sub print_directorysrch { |
my ($dom,$settings,$rowtotal) = @_; |
my ($dom,$settings,$rowtotal) = @_; |
my $srchon = ' '; |
my $srchon = ' '; |
Line 1960 sub print_contacts {
|
Line 1874 sub print_contacts {
|
my ($dom,$settings,$rowtotal) = @_; |
my ($dom,$settings,$rowtotal) = @_; |
my $datatable; |
my $datatable; |
my @contacts = ('adminemail','supportemail'); |
my @contacts = ('adminemail','supportemail'); |
my (%checked,%to,%otheremails,%bccemails); |
my (%checked,%to,%otheremails); |
my @mailings = ('errormail','packagesmail','lonstatusmail','helpdeskmail', |
my @mailings = ('errormail','packagesmail','lonstatusmail','helpdeskmail', |
'requestsmail'); |
'requestsmail'); |
foreach my $type (@mailings) { |
foreach my $type (@mailings) { |
$otheremails{$type} = ''; |
$otheremails{$type} = ''; |
} |
} |
$bccemails{'helpdeskmail'} = ''; |
|
if (ref($settings) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
foreach my $item (@contacts) { |
foreach my $item (@contacts) { |
if (exists($settings->{$item})) { |
if (exists($settings->{$item})) { |
Line 1982 sub print_contacts {
|
Line 1895 sub print_contacts {
|
} |
} |
} |
} |
$otheremails{$type} = $settings->{$type}{'others'}; |
$otheremails{$type} = $settings->{$type}{'others'}; |
if ($type eq 'helpdeskmail') { |
|
$bccemails{$type} = $settings->{$type}{'bcc'}; |
|
} |
|
} |
} |
} elsif ($type eq 'lonstatusmail') { |
} elsif ($type eq 'lonstatusmail') { |
$checked{'lonstatusmail'}{'adminemail'} = ' checked="checked" '; |
$checked{'lonstatusmail'}{'adminemail'} = ' checked="checked" '; |
Line 2028 sub print_contacts {
|
Line 1938 sub print_contacts {
|
} |
} |
$datatable .= '</span><br />'.&mt('Others').': '. |
$datatable .= '</span><br />'.&mt('Others').': '. |
'<input type="text" name="'.$type.'_others" '. |
'<input type="text" name="'.$type.'_others" '. |
'value="'.$otheremails{$type}.'" />'; |
'value="'.$otheremails{$type}.'" />'. |
if ($type eq 'helpdeskmail') { |
'</td></tr>'."\n"; |
$datatable .= '<br />'.&mt('Bcc').':'.(' 'x6). |
|
'<input type="text" name="'.$type.'_bcc" '. |
|
'value="'.$bccemails{$type}.'" />'; |
|
} |
|
$datatable .= '</td></tr>'."\n"; |
|
} |
} |
$$rowtotal += $rownum; |
$$rowtotal += $rownum; |
return $datatable; |
return $datatable; |
} |
} |
|
|
|
sub print_helpsettings { |
|
my ($dom,$settings,$rowtotal) = @_; |
|
my ($css_class,$datatable); |
|
my $itemcount = 1; |
|
my (%checkedon,%checkedoff,%choices,%defaultchecked,@toggles); |
|
%choices = |
|
&Apache::lonlocal::texthash ( |
|
submitbugs => 'Display "Submit a bug" link?', |
|
); |
|
%defaultchecked = ('submitbugs' => 'on'); |
|
@toggles = ('submitbugs',); |
|
($datatable,$itemcount) = &radiobutton_prefs($settings,\@toggles,\%defaultchecked, |
|
\%choices,$itemcount); |
|
$$rowtotal += $itemcount; |
|
return $datatable; |
|
} |
|
|
sub radiobutton_prefs { |
sub radiobutton_prefs { |
my ($settings,$toggles,$defaultchecked,$choices,$itemcount) = @_; |
my ($settings,$toggles,$defaultchecked,$choices,$itemcount) = @_; |
return unless ((ref($toggles) eq 'ARRAY') && (ref($defaultchecked) eq 'HASH') && |
return unless ((ref($toggles) eq 'ARRAY') && (ref($defaultchecked) eq 'HASH') && |
Line 2146 sub courserequest_titles {
|
Line 2068 sub courserequest_titles {
|
|
|
sub courserequest_conditions { |
sub courserequest_conditions { |
my %conditions = &Apache::lonlocal::texthash ( |
my %conditions = &Apache::lonlocal::texthash ( |
approval => '(Processing of request subject to approval by Domain Coordinator).', |
approval => '(Processing of request subject to approval by Domain Coordinator).', |
validate => '(Processing of request subject to instittutional validation).', |
validate => '(Processing of request subject to instittutional validation).', |
); |
); |
return %conditions; |
return %conditions; |
Line 2642 sub print_scantronformat {
|
Line 2564 sub print_scantronformat {
|
'<span class="LC_nobreak">'; |
'<span class="LC_nobreak">'; |
if ($scantronurl) { |
if ($scantronurl) { |
$datatable .= '<a href="'.$scantronurl.'" target="_blank">'. |
$datatable .= '<a href="'.$scantronurl.'" target="_blank">'. |
&mt('Default bubblesheet format file').'</a>'; |
&mt('Default scantron format file').'</a>'; |
} else { |
} else { |
$datatable = &mt('File unavailable for display'); |
$datatable = &mt('File unavailable for display'); |
} |
} |
Line 2669 sub print_scantronformat {
|
Line 2591 sub print_scantronformat {
|
} elsif ($scantronurl) { |
} elsif ($scantronurl) { |
$datatable .= '<td><span class="LC_nobreak">'. |
$datatable .= '<td><span class="LC_nobreak">'. |
'<a href="'.$scantronurl.'" target="_blank">'. |
'<a href="'.$scantronurl.'" target="_blank">'. |
&mt('Custom bubblesheet format file').'</a><label>'. |
&mt('Custom scantron format file').'</a><label>'. |
'<input type="checkbox" name="scantronformat_del"'. |
'<input type="checkbox" name="scantronformat_del"'. |
'" value="1" />'.&mt('Delete?').'</label></span></td>'. |
'" value="1" />'.&mt('Delete?').'</label></span></td>'. |
'<td><span class="LC_nobreak"> '. |
'<td><span class="LC_nobreak"> '. |
Line 2698 sub legacy_scantronformat {
|
Line 2620 sub legacy_scantronformat {
|
&publishlogo($r,'copy',$legacyfile,$dom,$confname,'scantron', |
&publishlogo($r,'copy',$legacyfile,$dom,$confname,'scantron', |
'','',$newfile); |
'','',$newfile); |
if ($result ne 'ok') { |
if ($result ne 'ok') { |
$error = &mt("An error occurred publishing the [_1] bubblesheet format file in RES space. Error was: [_2].",$newfile,$result); |
$error = &mt("An error occurred publishing the [_1] scantron format file in RES space. Error was: [_2].",$newfile,$result); |
} |
} |
} |
} |
return ($url,$error); |
return ($url,$error); |
Line 2742 sub print_coursecategories {
|
Line 2664 sub print_coursecategories {
|
categorizecomm => 'Assign a category to a community', |
categorizecomm => 'Assign a category to a community', |
); |
); |
my %level = &Apache::lonlocal::texthash ( |
my %level = &Apache::lonlocal::texthash ( |
dom => 'Set in Domain', |
dom => 'Set in Domain', |
crs => 'Set in Course', |
crs => 'Set in Course', |
comm => 'Set in Community', |
comm => 'Set in Community', |
); |
); |
$datatable = '<tr class="LC_odd_row">'. |
$datatable = '<tr class="LC_odd_row">'. |
Line 2802 sub print_coursecategories {
|
Line 2724 sub print_coursecategories {
|
communities => &mt('Communities'), |
communities => &mt('Communities'), |
); |
); |
|
|
if ((!grep(/^instcode$/,@{$cats[0]})) || |
if ((!grep(/^instcode$/,@{$cats[0]})) || |
($cathash->{'instcode::0'} eq '') || |
($cathash->{'instcode::0'} eq '') || |
(!grep(/^communities$/,@{$cats[0]})) || |
(!grep(/^communities$/,@{$cats[0]})) || |
($cathash->{'communities::0'} eq '')) { |
($cathash->{'communities::0'} eq '')) { |
$maxnum ++; |
$maxnum ++; |
} |
} |
Line 2898 sub print_coursecategories {
|
Line 2820 sub print_coursecategories {
|
'<td><span class="LC_nobreak">'. |
'<td><span class="LC_nobreak">'. |
$default_names{$default}.'</span>'; |
$default_names{$default}.'</span>'; |
if ($default eq 'instcode') { |
if ($default eq 'instcode') { |
$datatable .= '<br /><span class="LC_nobreak">(' |
$datatable .= '<br /><span class="LC_nobreak">(' |
.&mt('with institutional codes').')</span>'; |
.&mt('with institutional codes').')</span>'; |
} |
} |
$datatable .= '</td>' |
$datatable .= '</td>' |
Line 2997 sub coursecategories_javascript {
|
Line 2919 sub coursecategories_javascript {
|
} |
} |
my $instcode_reserved = &mt('The name: "instcode" is a reserved category'); |
my $instcode_reserved = &mt('The name: "instcode" is a reserved category'); |
my $communities_reserved = &mt('The name: "communities" is a reserved category'); |
my $communities_reserved = &mt('The name: "communities" is a reserved category'); |
my $choose_again = '\\n'.&mt('Please use a different name for the new top level category'); |
my $choose_again = '\\n'.&mt('Please use a different name for the new top level category'); |
$output = <<"ENDSCRIPT"; |
$output = <<"ENDSCRIPT"; |
<script type="text/javascript"> |
<script type="text/javascript"> |
// <![CDATA[ |
// <![CDATA[ |
Line 3278 sub insttypes_row {
|
Line 3200 sub insttypes_row {
|
my %lt = &Apache::lonlocal::texthash ( |
my %lt = &Apache::lonlocal::texthash ( |
cansearch => 'Users allowed to search', |
cansearch => 'Users allowed to search', |
statustocreate => 'Institutional affiliation(s) able to create own account (login/SSO)', |
statustocreate => 'Institutional affiliation(s) able to create own account (login/SSO)', |
lockablenames => 'User preference to lock name', |
|
); |
); |
my $showdom; |
my $showdom; |
if ($context eq 'cansearch') { |
if ($context eq 'cansearch') { |
Line 3315 sub insttypes_row {
|
Line 3236 sub insttypes_row {
|
$usertypes->{$types->[$i]}.'</label></span></td>'; |
$usertypes->{$types->[$i]}.'</label></span></td>'; |
} |
} |
} |
} |
|
|
$rem = @{$types}%($numinrow); |
$rem = @{$types}%($numinrow); |
} |
} |
my $colsleft = $numinrow - $rem; |
my $colsleft = $numinrow - $rem; |
if (($rem == 0) && (@{$types} > 0)) { |
|
$output .= '<tr>'; |
|
} |
|
if ($colsleft > 1) { |
if ($colsleft > 1) { |
$output .= '<td colspan="'.$colsleft.'" class="LC_left_item">'; |
$output .= '<td colspan="'.$colsleft.'" class="LC_left_item">'; |
} else { |
} else { |
Line 3444 sub modify_login {
|
Line 3363 sub modify_login {
|
} |
} |
|
|
my %servers = &dom_servers($dom); |
my %servers = &dom_servers($dom); |
my @loginvia_attribs = ('serverpath','custompath','exempt'); |
|
if (keys(%servers) > 1) { |
if (keys(%servers) > 1) { |
foreach my $lonhost (keys(%servers)) { |
foreach my $lonhost (keys(%servers)) { |
next if ($env{'form.'.$lonhost.'_server'} eq $lonhost); |
next if ($env{'form.'.$lonhost.'_serverurl'} eq $lonhost); |
if (ref($curr_loginvia{$lonhost}) eq 'HASH') { |
if ($env{'form.'.$lonhost.'_serverurl'} eq $curr_loginvia{$lonhost}) { |
if ($env{'form.'.$lonhost.'_server'} eq $curr_loginvia{$lonhost}{'server'}) { |
$loginhash{login}{loginvia}{$lonhost} = $curr_loginvia{$lonhost}; next; |
$loginhash{login}{loginvia}{$lonhost}{'server'} = $curr_loginvia{$lonhost}{'server'}; |
} |
} elsif ($curr_loginvia{$lonhost}{'server'} ne '') { |
if ($curr_loginvia{$lonhost} ne '') { |
if (defined($servers{$env{'form.'.$lonhost.'_server'}})) { |
$loginhash{login}{loginvia}{$lonhost} = $env{'form.'.$lonhost.'_serverurl'}; |
$loginhash{login}{loginvia}{$lonhost}{'server'} = $env{'form.'.$lonhost.'_server'}; |
$changes{'loginvia'}{$lonhost} = 1; |
$changes{'loginvia'}{$lonhost} = 1; |
|
} else { |
|
$loginhash{login}{loginvia}{$lonhost}{'server'} = ''; |
|
$changes{'loginvia'}{$lonhost} = 1; |
|
} |
|
} else { |
|
if (defined($servers{$env{'form.'.$lonhost.'_server'}})) { |
|
$loginhash{login}{loginvia}{$lonhost}{'server'} = $env{'form.'.$lonhost.'_server'}; |
|
$changes{'loginvia'}{$lonhost} = 1; |
|
} |
|
} |
|
if ($loginhash{login}{loginvia}{$lonhost}{'server'} eq '') { |
|
foreach my $item (@loginvia_attribs) { |
|
$loginhash{login}{loginvia}{$lonhost}{$item} = ''; |
|
} |
|
} else { |
|
foreach my $item (@loginvia_attribs) { |
|
my $new = $env{'form.'.$lonhost.'_'.$item}; |
|
if (($item eq 'serverpath') && ($new eq 'custom')) { |
|
$env{'form.'.$lonhost.'_custompath'} =~ s/\s+//g; |
|
if ($env{'form.'.$lonhost.'_custompath'} eq '') { |
|
$new = '/'; |
|
} |
|
} |
|
if (($item eq 'custompath') && |
|
($env{'form.'.$lonhost.'_serverpath'} ne 'custom')) { |
|
$new = ''; |
|
} |
|
if ($new ne $curr_loginvia{$lonhost}{$item}) { |
|
$changes{'loginvia'}{$lonhost} = 1; |
|
} |
|
if ($item eq 'exempt') { |
|
$new =~ s/^\s+//; |
|
$new =~ s/\s+$//; |
|
my @poss_ips = split(/\s*[,:]\s*/,$new); |
|
my @okips; |
|
foreach my $ip (@poss_ips) { |
|
if ($ip =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/) { |
|
if (($1 <= 255) && ($2 <= 255) && ($3 <= 255) && ($4 <= 255)) { |
|
push(@okips,$ip); |
|
} |
|
} |
|
} |
|
if (@okips > 0) { |
|
$new = join(',',@okips); |
|
} else { |
|
$new = ''; |
|
} |
|
} |
|
|
|
$loginhash{login}{loginvia}{$lonhost}{$item} = $new; |
|
} |
|
} |
|
} else { |
} else { |
if (defined($servers{$env{'form.'.$lonhost.'_server'}})) { |
if (defined($servers{$env{'form.'.$lonhost.'_serverurl'}})) { |
$loginhash{login}{loginvia}{$lonhost}{'server'} = $env{'form.'.$lonhost.'_server'}; |
$loginhash{login}{loginvia}{$lonhost} = $env{'form.'.$lonhost.'_serverurl'}; |
$changes{'loginvia'}{$lonhost} = 1; |
$changes{'loginvia'}{$lonhost} = 1; |
foreach my $item (@loginvia_attribs) { |
|
my $new = $env{'form.'.$lonhost.'_'.$item}; |
|
if (($item eq 'serverpath') && ($new eq 'custom')) { |
|
if ($env{'form.'.$lonhost.'_custompath'} eq '') { |
|
$new = '/'; |
|
} |
|
} |
|
if (($item eq 'custompath') && |
|
($env{'form.'.$lonhost.'_serverpath'} ne 'custom')) { |
|
$new = ''; |
|
} |
|
$loginhash{login}{loginvia}{$lonhost}{$item} = $new; |
|
} |
|
} |
} |
} |
} |
} |
} |
Line 3579 sub modify_login {
|
Line 3431 sub modify_login {
|
if (ref($changes{$item}) eq 'HASH') { |
if (ref($changes{$item}) eq 'HASH') { |
$resulttext .= '<li>'.&mt('Log-in page availability:').'<ul>'; |
$resulttext .= '<li>'.&mt('Log-in page availability:').'<ul>'; |
foreach my $lonhost (sort(keys(%{$changes{$item}}))) { |
foreach my $lonhost (sort(keys(%{$changes{$item}}))) { |
if (defined($servers{$loginhash{login}{loginvia}{$lonhost}{'server'}})) { |
if ($servers{$env{'form.'.$lonhost.'_serverurl'}} ne '') { |
if (ref($loginhash{login}{loginvia}{$lonhost}) eq 'HASH') { |
$resulttext .= '<li>'.&mt('Server: [_1] log-in page now redirects to [_2]',$lonhost,$servers{$env{'form.'.$lonhost.'_serverurl'}}).'</li>'; |
my $protocol = $Apache::lonnet::protocol{$env{'form.'.$lonhost.'_server'}}; |
|
$protocol = 'http' if ($protocol ne 'https'); |
|
my $target = $protocol.'://'.$servers{$env{'form.'.$lonhost.'_server'}}; |
|
|
|
if ($loginhash{login}{loginvia}{$lonhost}{'serverpath'} eq 'custom') { |
|
$target .= $loginhash{login}{loginvia}{$lonhost}{'custompath'}; |
|
} else { |
|
$target .= $loginhash{login}{loginvia}{$lonhost}{'serverpath'}; |
|
} |
|
$resulttext .= '<li>'.&mt('Server: [_1] log-in page redirects to [_2].',$servers{$lonhost},'<a href="'.$target.'">'.$target.'</a>'); |
|
if ($loginhash{login}{loginvia}{$lonhost}{'exempt'} ne '') { |
|
$resulttext .= ' '.&mt('No redirection for clients from following IPs:').' '.$loginhash{login}{loginvia}{$lonhost}{'exempt'}; |
|
} |
|
$resulttext .= '</li>'; |
|
} else { |
|
$resulttext .= '<li>'.&mt('Server: [_1] has standard log-in page.',$lonhost).'</li>'; |
|
} |
|
} else { |
} else { |
$resulttext .= '<li>'.&mt('Server: [_1] has standard log-in page.',$servers{$lonhost}).'</li>'; |
$resulttext .= '<li>'.&mt('Server: [_1] now has standard log-in page.',$lonhost).'</li>'; |
} |
} |
} |
} |
$resulttext .= '</ul></li>'; |
$resulttext .= '</ul></li>'; |
} |
} |
} else { |
} else { |
$resulttext .= '<li>'.&mt("$title{$item} set to $offon[$env{'form.'.$item}]").'</li>'; |
$resulttext .= '<li>'.&mt("$title{$item} set to $offon[$env{'form.'.$item}]").'</li>'; |
Line 3631 sub color_font_choices {
|
Line 3466 sub color_font_choices {
|
links => "Link colors", |
links => "Link colors", |
images => "Images", |
images => "Images", |
font => "Font color", |
font => "Font color", |
|
fontmenu => "Font Menu", |
pgbg => "Page", |
pgbg => "Page", |
tabbg => "Header", |
tabbg => "Header", |
sidebg => "Border", |
sidebg => "Border", |
Line 3688 sub modify_colors {
|
Line 3524 sub modify_colors {
|
@logintext = ('textcol','bgcol'); |
@logintext = ('textcol','bgcol'); |
} else { |
} else { |
%choices = &color_font_choices(); |
%choices = &color_font_choices(); |
|
$confhash->{$role}{'fontmenu'} = $env{'form.'.$role.'_fontmenu'}; |
} |
} |
if ($role eq 'login') { |
if ($role eq 'login') { |
@images = ('img','logo','domlogo','login'); |
@images = ('img','logo','domlogo','login'); |
Line 3810 sub modify_colors {
|
Line 3647 sub modify_colors {
|
$changes{$role}{'font'} = 1; |
$changes{$role}{'font'} = 1; |
} |
} |
} |
} |
|
if ($role ne 'login') { |
|
if ($domconfig->{$role}{'fontmenu'} ne '') { |
|
if ($confhash->{$role}{'fontmenu'} ne $domconfig->{$role}{'fontmenu'}) { |
|
$changes{$role}{'fontmenu'} = 1; |
|
} |
|
} else { |
|
if ($confhash->{$role}{'fontmenu'}) { |
|
$changes{$role}{'fontmenu'} = 1; |
|
} |
|
} |
|
} |
foreach my $item (@bgs) { |
foreach my $item (@bgs) { |
if ($domconfig->{$role}{$item} ne '') { |
if ($domconfig->{$role}{$item} ne '') { |
if ($confhash->{$role}{$item} ne $domconfig->{$role}{$item}) { |
if ($confhash->{$role}{$item} ne $domconfig->{$role}{$item}) { |
Line 4305 sub modify_quotas {
|
Line 4153 sub modify_quotas {
|
} |
} |
foreach my $item (@usertools) { |
foreach my $item (@usertools) { |
foreach my $type (@{$types},'default','_LC_adv') { |
foreach my $type (@{$types},'default','_LC_adv') { |
my $unset; |
my $unset; |
if ($context eq 'requestcourses') { |
if ($context eq 'requestcourses') { |
$unset = '0'; |
$unset = '0'; |
if ($type eq '_LC_adv') { |
if ($type eq '_LC_adv') { |
Line 4525 sub modify_autoenroll {
|
Line 4373 sub modify_autoenroll {
|
} |
} |
my $autorun = &Apache::lonnet::auto_run(undef,$dom), |
my $autorun = &Apache::lonnet::auto_run(undef,$dom), |
my %title = ( run => 'Auto-enrollment active', |
my %title = ( run => 'Auto-enrollment active', |
sender => 'Sender for notification messages', |
sender => 'Sender for notification messages'); |
coowners => 'Automatic assignment of co-ownership to instructors of record (institutional data)'); |
|
my @offon = ('off','on'); |
my @offon = ('off','on'); |
my $sender_uname = $env{'form.sender_uname'}; |
my $sender_uname = $env{'form.sender_uname'}; |
my $sender_domain = $env{'form.sender_domain'}; |
my $sender_domain = $env{'form.sender_domain'}; |
Line 4535 sub modify_autoenroll {
|
Line 4382 sub modify_autoenroll {
|
} elsif ($sender_uname eq '') { |
} elsif ($sender_uname eq '') { |
$sender_domain = ''; |
$sender_domain = ''; |
} |
} |
my $coowners = $env{'form.autoassign_coowners'}; |
|
my %autoenrollhash = ( |
my %autoenrollhash = ( |
autoenroll => { run => $env{'form.autoenroll_run'}, |
autoenroll => { run => $env{'form.autoenroll_run'}, |
sender_uname => $sender_uname, |
sender_uname => $sender_uname, |
sender_domain => $sender_domain, |
sender_domain => $sender_domain, |
'co-owners' => $coowners, |
|
} |
} |
); |
); |
my $putresult = &Apache::lonnet::put_dom('configuration',\%autoenrollhash, |
my $putresult = &Apache::lonnet::put_dom('configuration',\%autoenrollhash, |
Line 4561 sub modify_autoenroll {
|
Line 4407 sub modify_autoenroll {
|
if ($currautoenroll{'sender_domain'} ne $sender_domain) { |
if ($currautoenroll{'sender_domain'} ne $sender_domain) { |
$changes{'sender'} = 1; |
$changes{'sender'} = 1; |
} |
} |
if ($currautoenroll{'co-owners'} ne '') { |
|
if ($currautoenroll{'co-owners'} ne $coowners) { |
|
$changes{'coowners'} = 1; |
|
} |
|
} elsif ($coowners) { |
|
$changes{'coowners'} = 1; |
|
} |
|
if (keys(%changes) > 0) { |
if (keys(%changes) > 0) { |
$resulttext = &mt('Changes made:').'<ul>'; |
$resulttext = &mt('Changes made:').'<ul>'; |
if ($changes{'run'}) { |
if ($changes{'run'}) { |
Line 4580 sub modify_autoenroll {
|
Line 4419 sub modify_autoenroll {
|
$resulttext .= '<li>'.&mt("$title{'sender'} set to [_1]",$sender_uname.':'.$sender_domain).'</li>'; |
$resulttext .= '<li>'.&mt("$title{'sender'} set to [_1]",$sender_uname.':'.$sender_domain).'</li>'; |
} |
} |
} |
} |
if ($changes{'coowners'}) { |
|
$resulttext .= '<li>'.&mt("$title{'coowners'} set to $offon[$env{'form.autoassign_coowners'}]").'</li>'; |
|
&Apache::loncommon::devalidate_domconfig_cache($dom); |
|
} |
|
$resulttext .= '</ul>'; |
$resulttext .= '</ul>'; |
} else { |
} else { |
$resulttext = &mt('No changes made to auto-enrollment settings'); |
$resulttext = &mt('No changes made to auto-enrollment settings'); |
Line 4615 sub modify_autoupdate {
|
Line 4450 sub modify_autoupdate {
|
lastname => 'Last Name', |
lastname => 'Last Name', |
firstname => 'First Name', |
firstname => 'First Name', |
middlename => 'Middle Name', |
middlename => 'Middle Name', |
generation => 'Generation', |
gen => 'Generation', |
); |
); |
my $othertitle = &mt('All users'); |
my $othertitle = &mt('All users'); |
if (keys(%{$usertypes}) > 0) { |
if (keys(%{$usertypes}) > 0) { |
Line 4623 sub modify_autoupdate {
|
Line 4458 sub modify_autoupdate {
|
} |
} |
foreach my $key (keys(%env)) { |
foreach my $key (keys(%env)) { |
if ($key =~ /^form\.updateable_(.+)_([^_]+)$/) { |
if ($key =~ /^form\.updateable_(.+)_([^_]+)$/) { |
my ($usertype,$item) = ($1,$2); |
push(@{$fields{$1}},$2); |
if (grep(/^\Q$item\E$/,keys(%fieldtitles))) { |
|
if ($usertype eq 'default') { |
|
push(@{$fields{$1}},$2); |
|
} elsif (ref($types) eq 'ARRAY') { |
|
if (grep(/^\Q$usertype\E$/,@{$types})) { |
|
push(@{$fields{$1}},$2); |
|
} |
|
} |
|
} |
|
} |
|
} |
|
my @lockablenames = &Apache::loncommon::get_env_multiple('form.lockablenames'); |
|
@lockablenames = sort(@lockablenames); |
|
if (ref($currautoupdate{'lockablenames'}) eq 'ARRAY') { |
|
my @changed = &Apache::loncommon::compare_arrays($currautoupdate{'lockablenames'},\@lockablenames); |
|
if (@changed) { |
|
$changes{'lockablenames'} = 1; |
|
} |
|
} else { |
|
if (@lockablenames) { |
|
$changes{'lockablenames'} = 1; |
|
} |
} |
} |
} |
my %updatehash = ( |
my %updatehash = ( |
autoupdate => { run => $env{'form.autoupdate_run'}, |
autoupdate => { run => $env{'form.autoupdate_run'}, |
classlists => $env{'form.classlists'}, |
classlists => $env{'form.classlists'}, |
fields => {%fields}, |
fields => {%fields}, |
lockablenames => \@lockablenames, |
|
} |
} |
); |
); |
foreach my $key (keys(%currautoupdate)) { |
foreach my $key (keys(%currautoupdate)) { |
Line 4669 sub modify_autoupdate {
|
Line 4482 sub modify_autoupdate {
|
foreach my $type (@{$currautoupdate{$key}{$item}}) { |
foreach my $type (@{$currautoupdate{$key}{$item}}) { |
if (!exists($fields{$item})) { |
if (!exists($fields{$item})) { |
$change = 1; |
$change = 1; |
last; |
|
} elsif (ref($fields{$item}) eq 'ARRAY') { |
} elsif (ref($fields{$item}) eq 'ARRAY') { |
if (!grep(/^\Q$type\E$/,@{$fields{$item}})) { |
if (!grep(/^\Q$type\E$/,@{$fields{$item}})) { |
$change = 1; |
$change = 1; |
last; |
|
} |
} |
} |
} |
} |
} |
Line 4683 sub modify_autoupdate {
|
Line 4494 sub modify_autoupdate {
|
} |
} |
} |
} |
} |
} |
} elsif ($key eq 'lockablenames') { |
|
if (ref($currautoupdate{$key}) eq 'ARRAY') { |
|
my @changed = &Apache::loncommon::compare_arrays($currautoupdate{'lockablenames'},\@lockablenames); |
|
if (@changed) { |
|
$changes{'lockablenames'} = 1; |
|
} |
|
} else { |
|
if (@lockablenames) { |
|
$changes{'lockablenames'} = 1; |
|
} |
|
} |
|
} |
|
} |
|
unless (grep(/^\Qlockablenames\E$/,keys(%currautoupdate))) { |
|
if (@lockablenames) { |
|
$changes{'lockablenames'} = 1; |
|
} |
} |
} |
} |
foreach my $item (@{$types},'default') { |
foreach my $item (@{$types},'default') { |
if (defined($fields{$item})) { |
if (defined($fields{$item})) { |
if (ref($currautoupdate{'fields'}) eq 'HASH') { |
if (ref($currautoupdate{'fields'}) eq 'HASH') { |
if (ref($currautoupdate{'fields'}{$item}) eq 'ARRAY') { |
if (!exists($currautoupdate{'fields'}{$item})) { |
my $change = 0; |
|
if (ref($fields{$item}) eq 'ARRAY') { |
|
foreach my $type (@{$fields{$item}}) { |
|
if (!grep(/^\Q$type\E$/,@{$currautoupdate{'fields'}{$item}})) { |
|
$change = 1; |
|
last; |
|
} |
|
} |
|
} |
|
if ($change) { |
|
push(@{$changes{'fields'}},$item); |
|
} |
|
} else { |
|
push(@{$changes{'fields'}},$item); |
push(@{$changes{'fields'}},$item); |
} |
} |
} else { |
} else { |
Line 4731 sub modify_autoupdate {
|
Line 4513 sub modify_autoupdate {
|
if (keys(%changes) > 0) { |
if (keys(%changes) > 0) { |
$resulttext = &mt('Changes made:').'<ul>'; |
$resulttext = &mt('Changes made:').'<ul>'; |
foreach my $key (sort(keys(%changes))) { |
foreach my $key (sort(keys(%changes))) { |
if ($key eq 'lockablenames') { |
if (ref($changes{$key}) eq 'ARRAY') { |
$resulttext .= '<li>'; |
|
if (@lockablenames) { |
|
$usertypes->{'default'} = $othertitle; |
|
$resulttext .= &mt("User preference to disable replacement of user's name with institutional data (by auto-update), available for the following affiliations:").' '. |
|
join(', ', map { $usertypes->{$_}; } @lockablenames).'</li>'; |
|
} else { |
|
$resulttext .= &mt("User preference to disable replacement of user's name with institutional data (by auto-update) is unavailable."); |
|
} |
|
$resulttext .= '</li>'; |
|
} elsif (ref($changes{$key}) eq 'ARRAY') { |
|
foreach my $item (@{$changes{$key}}) { |
foreach my $item (@{$changes{$key}}) { |
my @newvalues; |
my @newvalues; |
foreach my $type (@{$fields{$item}}) { |
foreach my $type (@{$fields{$item}}) { |
Line 4780 sub modify_autoupdate {
|
Line 4552 sub modify_autoupdate {
|
return $resulttext; |
return $resulttext; |
} |
} |
|
|
sub modify_autocreate { |
|
my ($dom,%domconfig) = @_; |
|
my ($resulttext,%changes,%currautocreate,%newvals,%autocreatehash); |
|
if (ref($domconfig{'autocreate'}) eq 'HASH') { |
|
foreach my $key (keys(%{$domconfig{'autocreate'}})) { |
|
$currautocreate{$key} = $domconfig{'autocreate'}{$key}; |
|
} |
|
} |
|
my %title= ( xml => 'Auto-creation of courses in XML course description files', |
|
req => 'Auto-creation of validated requests for official courses', |
|
xmldc => 'Identity of course creator of courses from XML files', |
|
); |
|
my @types = ('xml','req'); |
|
foreach my $item (@types) { |
|
$newvals{$item} = $env{'form.autocreate_'.$item}; |
|
$newvals{$item} =~ s/\D//g; |
|
$newvals{$item} = 0 if ($newvals{$item} eq ''); |
|
} |
|
$newvals{'xmldc'} = $env{'form.autocreate_xmldc'}; |
|
my %domcoords = &get_active_dcs($dom); |
|
unless (exists($domcoords{$newvals{'xmldc'}})) { |
|
$newvals{'xmldc'} = ''; |
|
} |
|
%autocreatehash = ( |
|
autocreate => { xml => $newvals{'xml'}, |
|
req => $newvals{'req'}, |
|
} |
|
); |
|
if ($newvals{'xmldc'} ne '') { |
|
$autocreatehash{'autocreate'}{'xmldc'} = $newvals{'xmldc'}; |
|
} |
|
my $putresult = &Apache::lonnet::put_dom('configuration',\%autocreatehash, |
|
$dom); |
|
if ($putresult eq 'ok') { |
|
my @items = @types; |
|
if ($newvals{'xml'}) { |
|
push(@items,'xmldc'); |
|
} |
|
foreach my $item (@items) { |
|
if (exists($currautocreate{$item})) { |
|
if ($currautocreate{$item} ne $newvals{$item}) { |
|
$changes{$item} = 1; |
|
} |
|
} elsif ($newvals{$item}) { |
|
$changes{$item} = 1; |
|
} |
|
} |
|
if (keys(%changes) > 0) { |
|
my @offon = ('off','on'); |
|
$resulttext = &mt('Changes made:').'<ul>'; |
|
foreach my $item (@types) { |
|
if ($changes{$item}) { |
|
my $newtxt = $offon[$newvals{$item}]; |
|
$resulttext .= '<li>'.&mt("$title{$item} set to [_1]$newtxt [_2]",'<b>','</b>').'</li>'; |
|
} |
|
} |
|
if ($changes{'xmldc'}) { |
|
my ($dcname,$dcdom) = split(':',$newvals{'xmldc'}); |
|
my $newtxt = &Apache::loncommon::plainname($dcname,$dcdom); |
|
$resulttext .= '<li>'.&mt("$title{'xmldc'} set to [_1]$newtxt [_2]",'<b>','</b>').'</li>'; |
|
} |
|
$resulttext .= '</ul>'; |
|
} else { |
|
$resulttext = &mt('No changes made to auto-creation settings'); |
|
} |
|
} else { |
|
$resulttext = '<span class="LC_error">'. |
|
&mt('An error occurred: [_1]',$putresult).'</span>'; |
|
} |
|
return $resulttext; |
|
} |
|
|
|
sub modify_directorysrch { |
sub modify_directorysrch { |
my ($dom,%domconfig) = @_; |
my ($dom,%domconfig) = @_; |
my ($resulttext,%changes); |
my ($resulttext,%changes); |
Line 5034 sub modify_contacts {
|
Line 4734 sub modify_contacts {
|
$currsetting{$key} = $domconfig{'contacts'}{$key}; |
$currsetting{$key} = $domconfig{'contacts'}{$key}; |
} |
} |
} |
} |
my (%others,%to,%bcc); |
my (%others,%to); |
my @contacts = ('supportemail','adminemail'); |
my @contacts = ('supportemail','adminemail'); |
my @mailings = ('errormail','packagesmail','helpdeskmail','lonstatusmail', |
my @mailings = ('errormail','packagesmail','helpdeskmail','lonstatusmail', |
'requestsmail'); |
'requestsmail'); |
Line 5050 sub modify_contacts {
|
Line 4750 sub modify_contacts {
|
} |
} |
$others{$type} = $env{'form.'.$type.'_others'}; |
$others{$type} = $env{'form.'.$type.'_others'}; |
$contacts_hash{contacts}{$type}{'others'} = $others{$type}; |
$contacts_hash{contacts}{$type}{'others'} = $others{$type}; |
if ($type eq 'helpdeskmail') { |
|
$bcc{$type} = $env{'form.'.$type.'_bcc'}; |
|
$contacts_hash{contacts}{$type}{'bcc'} = $bcc{$type}; |
|
} |
|
} |
} |
foreach my $item (@contacts) { |
foreach my $item (@contacts) { |
$to{$item} = $env{'form.'.$item}; |
$to{$item} = $env{'form.'.$item}; |
Line 5078 sub modify_contacts {
|
Line 4774 sub modify_contacts {
|
if ($others{$type} ne $currsetting{$type}{'others'}) { |
if ($others{$type} ne $currsetting{$type}{'others'}) { |
push(@{$changes{$type}},'others'); |
push(@{$changes{$type}},'others'); |
} |
} |
if ($type eq 'helpdeskmail') { |
|
if ($bcc{$type} ne $currsetting{$type}{'bcc'}) { |
|
push(@{$changes{$type}},'bcc'); |
|
} |
|
} |
|
} |
} |
} else { |
} else { |
my %default; |
my %default; |
Line 5105 sub modify_contacts {
|
Line 4796 sub modify_contacts {
|
} |
} |
if ($others{$type} ne '') { |
if ($others{$type} ne '') { |
push(@{$changes{$type}},'others'); |
push(@{$changes{$type}},'others'); |
} |
} |
if ($type eq 'helpdeskmail') { |
|
if ($bcc{$type} ne '') { |
|
push(@{$changes{$type}},'bcc'); |
|
} |
|
} |
|
} |
} |
} |
} |
my $putresult = &Apache::lonnet::put_dom('configuration',\%contacts_hash, |
my $putresult = &Apache::lonnet::put_dom('configuration',\%contacts_hash, |
Line 5138 sub modify_contacts {
|
Line 4824 sub modify_contacts {
|
push(@text,$others{$type}); |
push(@text,$others{$type}); |
} |
} |
$resulttext .= '<span class="LC_cusr_emph">'. |
$resulttext .= '<span class="LC_cusr_emph">'. |
join(', ',@text).'</span>'; |
join(', ',@text).'</span></li>'; |
if ($type eq 'helpdeskmail') { |
|
if ($bcc{$type} ne '') { |
|
$resulttext .= ' '.&mt('with Bcc to').': <span class="LC_cusr_emph">'.$bcc{$type}.'</span>'; |
|
} |
|
} |
|
$resulttext .= '</li>'; |
|
} |
} |
} |
} |
$resulttext .= '</ul>'; |
$resulttext .= '</ul>'; |
Line 5626 sub modify_usermodification {
|
Line 5306 sub modify_usermodification {
|
} |
} |
my @modifiable; |
my @modifiable; |
if ($context eq 'selfcreate') { |
if ($context eq 'selfcreate') { |
$resulttext .= '<li><span class="LC_cusr_emph">'.&mt('Self-creation of account by users with status: [_1]',$rolename).'</span> - '.&mt('modifiable fields (if institutional data blank): '); |
$resulttext .= '<li><span class="LC_cusr_emph">'.&mt('Self-creation of account by users with status: [_1] ',$rolename).'</span> - '.&mt('modifiable fields (if institutional data blank): '); |
} else { |
} else { |
$resulttext .= '<li><span class="LC_cusr_emph">'.&mt('Target user with [_1] role',$rolename).'</span> - '.&mt('modifiable fields: '); |
$resulttext .= '<li><span class="LC_cusr_emph">'.&mt('Target user with [_1] role',$rolename).'</span> - '.&mt('modifiable fields: '); |
} |
} |
Line 5770 sub modify_scantron {
|
Line 5450 sub modify_scantron {
|
my $error; |
my $error; |
if ($configuserok eq 'ok') { |
if ($configuserok eq 'ok') { |
if ($switchserver) { |
if ($switchserver) { |
$error = &mt("Upload of bubblesheet format file is not permitted to this server: [_1]",$switchserver); |
$error = &mt("Upload of scantron format file is not permitted to this server: [_1]",$switchserver); |
} else { |
} else { |
if ($author_ok eq 'ok') { |
if ($author_ok eq 'ok') { |
my ($result,$scantronurl) = |
my ($result,$scantronurl) = |
Line 5810 sub modify_scantron {
|
Line 5490 sub modify_scantron {
|
if (ref($confhash{'scantron'}) eq 'HASH') { |
if (ref($confhash{'scantron'}) eq 'HASH') { |
$resulttext = &mt('Changes made:').'<ul>'; |
$resulttext = &mt('Changes made:').'<ul>'; |
if ($confhash{'scantron'}{'scantronformat'} eq '') { |
if ($confhash{'scantron'}{'scantronformat'} eq '') { |
$resulttext .= '<li>'.&mt('[_1] bubblesheet format file removed; [_2] file will be used for courses in this domain.',$custom,$default).'</li>'; |
$resulttext .= '<li>'.&mt('[_1] scantron format file removed; [_2] file will be used for courses in this domain.',$custom,$default).'</li>'; |
} else { |
} else { |
$resulttext .= '<li>'.&mt('Custom bubblesheet format file ([_1]) uploaded for use with courses in this domain.',$custom).'</li>'; |
$resulttext .= '<li>'.&mt('Custom scantron format file ([_1]) uploaded for use with courses in this domain.',$custom).'</li>'; |
} |
} |
$resulttext .= '</ul>'; |
$resulttext .= '</ul>'; |
} else { |
} else { |
$resulttext = &mt('Changes made to bubblesheet format file.'); |
$resulttext = &mt('Changes made to scantron format file.'); |
} |
} |
$resulttext .= '</ul>'; |
$resulttext .= '</ul>'; |
&Apache::loncommon::devalidate_domconfig_cache($dom); |
&Apache::loncommon::devalidate_domconfig_cache($dom); |
} else { |
} else { |
$resulttext = &mt('No changes made to bubblesheet format file'); |
$resulttext = &mt('No changes made to scantron format file'); |
} |
} |
} else { |
} else { |
$resulttext = '<span class="LC_error">'. |
$resulttext = '<span class="LC_error">'. |
&mt('An error occurred: [_1]',$putresult).'</span>'; |
&mt('An error occurred: [_1]',$putresult).'</span>'; |
} |
} |
} else { |
} else { |
$resulttext = &mt('No changes made to bubblesheet format file'); |
$resulttext = &mt('No changes made to scantron format file'); |
} |
} |
if ($errors) { |
if ($errors) { |
$resulttext .= &mt('The following errors occurred: ').'<ul>'. |
$resulttext .= &mt('The following errors occurred: ').'<ul>'. |
Line 5863 sub modify_coursecategories {
|
Line 5543 sub modify_coursecategories {
|
} else { |
} else { |
$changes{'togglecats'} = 1; |
$changes{'togglecats'} = 1; |
$changes{'categorize'} = 1; |
$changes{'categorize'} = 1; |
$changes{'togglecatscomm'} = 1; |
|
$changes{'categorizecomm'} = 1; |
|
$domconfig{'coursecategories'} = { |
$domconfig{'coursecategories'} = { |
togglecats => $env{'form.togglecats'}, |
togglecats => $env{'form.togglecats'}, |
categorize => $env{'form.categorize'}, |
categorize => $env{'form.categorize'}, |
togglecatscomm => $env{'form.togglecatscomm'}, |
}; |
categorizecomm => $env{'form.categorizecomm'}, |
$changes{'togglecatscomm'} = 1; |
|
$changes{'categorizecomm'} = 1; |
|
$domconfig{'coursecategories'} = { |
|
togglecats => $env{'form.togglecatscomm'}, |
|
categorize => $env{'form.categorizecomm'}, |
}; |
}; |
} |
} |
if (ref($cathash) eq 'HASH') { |
if (ref($cathash) eq 'HASH') { |
Line 6186 sub modify_serverstatuses {
|
Line 5868 sub modify_serverstatuses {
|
return $resulttext; |
return $resulttext; |
} |
} |
|
|
|
sub modify_helpsettings { |
|
my ($dom,%domconfig) = @_; |
|
my ($resulttext,$errors,%changes,%helphash); |
|
|
|
my %defaultchecked = ('submitbugs' => 'on'); |
|
my @offon = ('off','on'); |
|
my %title = ( submitbugs => 'Display link for users to submit a bug'); |
|
my @toggles = ('submitbugs'); |
|
|
|
$helphash{'helpsettings'} = {}; |
|
|
|
if (ref($domconfig{'helpsettings'}) ne 'HASH') { |
|
if ($domconfig{'helpsettings'} eq '') { |
|
$domconfig{'helpsettings'} = {}; |
|
} |
|
} |
|
|
|
if (ref($domconfig{'helpsettings'}) eq 'HASH') { |
|
|
|
foreach my $item (@toggles) { |
|
|
|
if ($defaultchecked{$item} eq 'on') { |
|
if (($domconfig{'helpsettings'}{$item} eq '') && |
|
($env{'form.'.$item} eq '0')) { |
|
$changes{$item} = 1; |
|
} elsif ($domconfig{'helpsettings'}{$item} ne $env{'form.'.$item}) { |
|
$changes{$item} = 1; |
|
} |
|
} elsif ($defaultchecked{$item} eq 'off') { |
|
if (($domconfig{'helpsettings'}{$item} eq '') && |
|
($env{'form.'.$item} eq '1')) { |
|
$changes{$item} = 1; |
|
} elsif ($domconfig{'helpsettings'}{$item} ne $env{'form.'.$item}) { |
|
$changes{$item} = 1; |
|
} |
|
} |
|
$helphash{'helpsettings'}{$item} = $env{'form.'.$item}; |
|
} |
|
} |
|
|
|
my $putresult = &Apache::lonnet::put_dom('configuration',\%helphash, |
|
$dom); |
|
|
|
if ($putresult eq 'ok') { |
|
if (keys(%changes) > 0) { |
|
$resulttext = &mt('Changes made:').'<ul>'; |
|
foreach my $item (sort(keys(%changes))) { |
|
if ($item eq 'submitbugs') { |
|
$resulttext .= '<li>'.&mt("$title{$item} set to $offon[$env{'form.'.$item}]").'</li>'; |
|
} |
|
} |
|
$resulttext .= '</ul>'; |
|
} else { |
|
$resulttext = &mt('No changes made to help settings'); |
|
} |
|
} else { |
|
$resulttext = '<span class="LC_error">'. |
|
&mt('An error occurred: [_1]',$putresult).'</span>'; |
|
} |
|
if ($errors) { |
|
$resulttext .= &mt('The following errors occurred: ').'<ul>'. |
|
$errors.'</ul>'; |
|
} |
|
return $resulttext; |
|
} |
|
|
sub modify_coursedefaults { |
sub modify_coursedefaults { |
my ($dom,%domconfig) = @_; |
my ($dom,%domconfig) = @_; |
my ($resulttext,$errors,%changes,%defaultshash); |
my ($resulttext,$errors,%changes,%defaultshash); |
Line 6325 sub dom_servers {
|
Line 6073 sub dom_servers {
|
return %uniqservers; |
return %uniqservers; |
} |
} |
|
|
sub get_active_dcs { |
|
my ($dom) = @_; |
|
my %dompersonnel = &Apache::lonnet::get_domain_roles($dom,['dc']); |
|
my %domcoords; |
|
my $numdcs = 0; |
|
my $now = time; |
|
foreach my $server (keys(%dompersonnel)) { |
|
foreach my $user (sort(keys(%{$dompersonnel{$server}}))) { |
|
my ($trole,$uname,$udom,$runame,$rudom,$rsec) = split(/:/,$user); |
|
my ($end,$start) = split(':',$dompersonnel{$server}{$user}); |
|
if (($end eq '') || ($end == 0) || ($end > $now)) { |
|
if ($start <= $now) { |
|
$domcoords{$uname.':'.$udom} = $dompersonnel{$server}{$user}; |
|
} |
|
} |
|
} |
|
} |
|
return %domcoords; |
|
} |
|
|
|
sub active_dc_picker { |
|
my ($dom,$curr_dc) = @_; |
|
my %domcoords = &get_active_dcs($dom); |
|
my @dcs = sort(keys(%domcoords)); |
|
my $numdcs = scalar(@dcs); |
|
my $datatable; |
|
my $numinrow = 2; |
|
if ($numdcs > 1) { |
|
$datatable = '<table>'; |
|
for (my $i=0; $i<@dcs; $i++) { |
|
my $rem = $i%($numinrow); |
|
if ($rem == 0) { |
|
if ($i > 0) { |
|
$datatable .= '</tr>'; |
|
} |
|
$datatable .= '<tr>'; |
|
} |
|
my $check = ' '; |
|
if ($curr_dc eq '') { |
|
if (!$i) { |
|
$check = ' checked="checked" '; |
|
} |
|
} elsif ($dcs[$i] eq $curr_dc) { |
|
$check = ' checked="checked" '; |
|
} |
|
if ($i == @dcs - 1) { |
|
my $colsleft = $numinrow - $rem; |
|
if ($colsleft > 1) { |
|
$datatable .= '<td colspan="'.$colsleft.'">'; |
|
} else { |
|
$datatable .= '<td>'; |
|
} |
|
} else { |
|
$datatable .= '<td>'; |
|
} |
|
my ($dcname,$dcdom) = split(':',$dcs[$i]); |
|
$datatable .= '<span class="LC_nobreak"><label>'. |
|
'<input type="radio" name="autocreate_xmldc"'. |
|
' value="'.$dcs[$i].'"'.$check.'/>'. |
|
&Apache::loncommon::plainname($dcname,$dcdom). |
|
'</label></span></td>'; |
|
} |
|
$datatable .= '</tr></table>'; |
|
} elsif (@dcs) { |
|
$datatable .= '<input type="hidden" name="autocreate_dc" value="'. |
|
$dcs[0].'" />'; |
|
} |
|
return ($numdcs,$datatable); |
|
} |
|
|
|
1; |
1; |