version 1.138.2.13, 2011/11/30 18:36:26
|
version 1.139, 2010/08/24 13:37:50
|
Line 140 autolimit
|
Line 140 autolimit
|
|
|
=over |
=over |
|
|
- course requests will be processed automatically up to a limit of |
- course requests will be processed autoatically up to a limit of |
N requests for the course type for the particular requestor. |
N requests for the course type for the particular requestor. |
If N is undefined, there is no limit to the number of course requests |
If N is undefined, there is no limit to the number of course requests |
which a course owner may submit and have processed automatically. |
which a course owner may submit and have processed automatically. |
Line 171 use Locale::Language;
|
Line 171 use Locale::Language;
|
use DateTime::TimeZone; |
use DateTime::TimeZone; |
use DateTime::Locale; |
use DateTime::Locale; |
|
|
my $registered_cleanup; |
|
my $modified_urls; |
|
|
|
sub handler { |
sub handler { |
my $r=shift; |
my $r=shift; |
if ($r->header_only) { |
if ($r->header_only) { |
Line 193 sub handler {
|
Line 190 sub handler {
|
"/adm/domainprefs:mau:0:0:Cannot modify domain settings"; |
"/adm/domainprefs:mau:0:0:Cannot modify domain settings"; |
return HTTP_NOT_ACCEPTABLE; |
return HTTP_NOT_ACCEPTABLE; |
} |
} |
|
|
$registered_cleanup=0; |
|
@{$modified_urls}=(); |
|
|
|
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
['phase','actions']); |
['phase','actions']); |
Line 209 sub handler {
|
Line 202 sub handler {
|
'quotas','autoenroll','autoupdate','autocreate', |
'quotas','autoenroll','autoupdate','autocreate', |
'directorysrch','usercreation','usermodification', |
'directorysrch','usercreation','usermodification', |
'contacts','defaults','scantron','coursecategories', |
'contacts','defaults','scantron','coursecategories', |
'serverstatuses','requestcourses','coursedefaults', |
'serverstatuses','requestcourses','helpsettings', |
'usersessions'],$dom); |
'coursedefaults','usersessions'],$dom); |
my @prefs_order = ('rolecolors','login','defaults','quotas','autoenroll', |
my @prefs_order = ('rolecolors','login','defaults','quotas','autoenroll', |
'autoupdate','autocreate','directorysrch','contacts', |
'autoupdate','autocreate','directorysrch','contacts', |
'usercreation','usermodification','scantron', |
'usercreation','usermodification','scantron', |
'requestcourses','coursecategories','serverstatuses', |
'requestcourses','coursecategories','serverstatuses','helpsettings', |
'coursedefaults','usersessions'); |
'coursedefaults','usersessions'); |
my %prefs = ( |
my %prefs = ( |
'rolecolors' => |
'rolecolors' => |
Line 237 sub handler {
|
Line 230 sub handler {
|
}, |
}, |
|
|
'defaults' => |
'defaults' => |
{ text => 'Default authentication/language/timezone/portal', |
{ text => 'Default authentication/language/timezone', |
help => 'Domain_Configuration_LangTZAuth', |
help => 'Domain_Configuration_LangTZAuth', |
header => [{col1 => 'Setting', |
header => [{col1 => 'Setting', |
col2 => 'Value'}], |
col2 => 'Value'}], |
Line 344 sub handler {
|
Line 337 sub handler {
|
{col1 => 'Unauthenticated Help Settings', |
{col1 => 'Unauthenticated Help Settings', |
col2 => ''}], |
col2 => ''}], |
}, |
}, |
'coursedefaults' => |
'coursedefaults' => |
{text => 'Course/Community defaults', |
{text => 'Course/Community defaults', |
help => 'Domain_Configuration_Course_Defaults', |
help => 'Domain_Configuration_Course_Defaults', |
header => [{col1 => 'Defaults which can be overridden for each course by a DC', |
header => [{col1 => 'Defaults which can be overridden in each course by a CC', |
col2 => 'Value',}], |
col2 => 'Value',}, |
|
{col1 => 'Defaults which can be overridden for each course by a DC', |
|
col2 => 'Value',},], |
}, |
}, |
'privacy' => |
'privacy' => |
{text => 'User Privacy', |
{text => 'User Privacy', |
Line 462 sub process_changes {
|
Line 457 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($r,$dom,$confname,%domconfig); |
} elsif ($action eq 'coursedefaults') { |
} elsif ($action eq 'coursedefaults') { |
$output = &modify_coursedefaults($dom,%domconfig); |
$output = &modify_coursedefaults($dom,%domconfig); |
} elsif ($action eq 'usersessions') { |
} elsif ($action eq 'usersessions') { |
Line 519 sub print_config_box {
|
Line 516 sub print_config_box {
|
} elsif ($action eq 'helpsettings') { |
} elsif ($action eq 'helpsettings') { |
$output .= &print_helpsettings('top',$dom,$confname,$settings,\$rowtotal); |
$output .= &print_helpsettings('top',$dom,$confname,$settings,\$rowtotal); |
} elsif ($action eq 'usersessions') { |
} elsif ($action eq 'usersessions') { |
$output .= &print_usersessions('top',$dom,$settings,\$rowtotal); |
$output .= &print_usersessions('top',$dom,$settings,\$rowtotal); |
} elsif ($action eq 'rolecolors') { |
} elsif ($action eq 'rolecolors') { |
$output .= &print_rolecolors($phase,'student',$dom,$confname,$settings,\$rowtotal); |
$output .= &print_rolecolors($phase,'student',$dom,$confname,$settings,\$rowtotal); |
|
} elsif ($action eq 'coursedefaults') { |
|
$output .= &print_coursedefaults('top',$dom,$settings,\$rowtotal); |
} |
} |
$output .= ' |
$output .= ' |
</table> |
</table> |
Line 585 sub print_config_box {
|
Line 584 sub print_config_box {
|
$output .= &print_helpsettings('bottom',$dom,$confname,$settings,\$rowtotal); |
$output .= &print_helpsettings('bottom',$dom,$confname,$settings,\$rowtotal); |
} elsif ($action eq 'usersessions') { |
} elsif ($action eq 'usersessions') { |
$output .= &print_usersessions('bottom',$dom,$settings,\$rowtotal); |
$output .= &print_usersessions('bottom',$dom,$settings,\$rowtotal); |
|
} elsif ($action eq 'coursedefaults') { |
|
$output .= &print_coursedefaults('bottom',$dom,$settings,\$rowtotal); |
} elsif ($action eq 'rolecolors') { |
} elsif ($action eq 'rolecolors') { |
$output .= &print_rolecolors($phase,'coordinator',$dom,$confname,$settings,\$rowtotal).' |
$output .= &print_rolecolors($phase,'coordinator',$dom,$confname,$settings,\$rowtotal).' |
</table> |
</table> |
Line 671 sub print_config_box {
|
Line 672 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 'coursedefaults') { |
} elsif ($action eq 'helpsettings') { |
$output .= &print_coursedefaults('bottom',$dom,$settings,\$rowtotal); |
$output .= &print_helpsettings('top',$dom,$confname,$settings,\$rowtotal); |
} |
} |
} |
} |
$output .= ' |
$output .= ' |
Line 866 sub print_login {
|
Line 867 sub print_login {
|
domlogo => 'Domain Logo', |
domlogo => 'Domain Logo', |
login => 'Login box'); |
login => 'Login box'); |
my $itemcount = 1; |
my $itemcount = 1; |
|
my ($css_class,$datatable); |
foreach my $item (@toggles) { |
foreach my $item (@toggles) { |
$css_class = $itemcount%2?' class="LC_odd_row"':''; |
$css_class = $itemcount%2?' class="LC_odd_row"':''; |
$datatable .= |
$datatable .= |
Line 1885 sub print_autocreate {
|
Line 1887 sub print_autocreate {
|
'<input type="radio" name="autocreate_xml"'. |
'<input type="radio" name="autocreate_xml"'. |
$createon{'xml'}.' value="1" />'.&mt('Yes').'</label> '. |
$createon{'xml'}.' value="1" />'.&mt('Yes').'</label> '. |
'<label><input type="radio" name="autocreate_xml"'. |
'<label><input type="radio" name="autocreate_xml"'. |
$createoff{'xml'}.' value="0" />'.&mt('No').'</label></span>'. |
$createoff{'xml'}.' value="0" />'.&mt('No').'</label></span>'; |
'</td></tr><tr>'. |
|
'<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>'; |
|
my ($numdc,$dctable) = &active_dc_picker($dom,$curr_dc); |
my ($numdc,$dctable) = &active_dc_picker($dom,$curr_dc); |
if ($numdc > 1) { |
if ($numdc > 1) { |
$datatable .= '</td></tr><tr class="LC_odd_row"><td>'. |
$datatable .= '</td><tr><td>'. |
&mt('Course creation processed as: (choose Dom. Coord.)'). |
&mt('XML files processed as: (choose Dom. Coord.)'). |
'</td><td class="LC_left_item">'.$dctable.'</td></tr>'; |
'</td><td class="LC_left_item">'.$dctable.'</td></tr>'. |
|
'<tr class="LC_odd_row">'; |
$$rowtotal ++ ; |
$$rowtotal ++ ; |
} else { |
} else { |
$datatable .= $dctable.'</td></tr>'; |
$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; |
return $datatable; |
} |
} |
|
|
Line 2284 sub print_coursedefaults {
|
Line 2287 sub print_coursedefaults {
|
sub print_usersessions { |
sub print_usersessions { |
my ($position,$dom,$settings,$rowtotal) = @_; |
my ($position,$dom,$settings,$rowtotal) = @_; |
my ($css_class,$datatable,%checked,%choices); |
my ($css_class,$datatable,%checked,%choices); |
my (%by_ip,%by_location,@intdoms); |
|
&build_location_hashes(\@intdoms,\%by_ip,\%by_location); |
|
if (keys(%by_location) == 0) { |
|
if ($position eq 'top') { |
|
$datatable .= '<tr'.$css_class.'><td colspan="2">'. |
|
&mt('Nothing to set here, as the cluster to which this domain belongs only contains this institution.'); |
|
} |
|
} |
|
my %lt = &usersession_titles(); |
my %lt = &usersession_titles(); |
my $itemcount = 1; |
my $itemcount = 1; |
my $numinrow = 5; |
my $numinrow = 6; |
my $prefix; |
my $prefix; |
my @types; |
my @types; |
if ($position eq 'top') { |
if ($position eq 'top') { |
Line 2306 sub print_usersessions {
|
Line 2301 sub print_usersessions {
|
} |
} |
my (%current,%checkedon,%checkedoff); |
my (%current,%checkedon,%checkedoff); |
my @lcversions = &Apache::lonnet::all_loncaparevs(); |
my @lcversions = &Apache::lonnet::all_loncaparevs(); |
|
my (%by_ip,%by_location,@intdoms); |
|
&build_location_hashes(\@intdoms,\%by_ip,\%by_location); |
my @locations = sort(keys(%by_location)); |
my @locations = sort(keys(%by_location)); |
foreach my $type (@types) { |
foreach my $type (@types) { |
$checkedon{$type} = ''; |
$checkedon{$type} = ''; |
Line 2328 sub print_usersessions {
|
Line 2325 sub print_usersessions {
|
} |
} |
} |
} |
foreach my $type (@types) { |
foreach my $type (@types) { |
next if ($type ne 'version' && !@locations); |
|
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : ''; |
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : ''; |
$datatable .= '<tr'.$css_class.'> |
$datatable .= '<tr'.$css_class.'> |
<td><span class="LC_nobreak">'.$lt{$type}.'</span><br /> |
<td><span class="LC_nobreak">'.$lt{$type}.'</span><br /> |
Line 2822 sub print_usermodification {
|
Line 2818 sub print_usermodification {
|
sub print_defaults { |
sub print_defaults { |
my ($dom,$rowtotal) = @_; |
my ($dom,$rowtotal) = @_; |
my @items = ('auth_def','auth_arg_def','lang_def','timezone_def', |
my @items = ('auth_def','auth_arg_def','lang_def','timezone_def', |
'datelocale_def','portal_def'); |
'datelocale_def'); |
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom); |
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom); |
my $titles = &defaults_titles($dom); |
my $titles = &defaults_titles(); |
my $rownum = 0; |
my $rownum = 0; |
my ($datatable,$css_class); |
my ($datatable,$css_class); |
foreach my $item (@items) { |
foreach my $item (@items) { |
Line 2861 sub print_defaults {
|
Line 2857 sub print_defaults {
|
my $includeempty = 1; |
my $includeempty = 1; |
$datatable .= &Apache::loncommon::select_datelocale($item,$domdefaults{$item},undef,$includeempty); |
$datatable .= &Apache::loncommon::select_datelocale($item,$domdefaults{$item},undef,$includeempty); |
} else { |
} else { |
my $size; |
|
if ($item eq 'portal_def') { |
|
$size = ' size="25"'; |
|
} |
|
$datatable .= '<input type="text" name="'.$item.'" value="'. |
$datatable .= '<input type="text" name="'.$item.'" value="'. |
$domdefaults{$item}.'"'.$size.' />'; |
$domdefaults{$item}.'" />'; |
} |
} |
$datatable .= '</td></tr>'; |
$datatable .= '</td></tr>'; |
$rownum ++; |
$rownum ++; |
Line 2876 sub print_defaults {
|
Line 2868 sub print_defaults {
|
} |
} |
|
|
sub defaults_titles { |
sub defaults_titles { |
my ($dom) = @_; |
|
my %titles = &Apache::lonlocal::texthash ( |
my %titles = &Apache::lonlocal::texthash ( |
'auth_def' => 'Default authentication type', |
'auth_def' => 'Default authentication type', |
'auth_arg_def' => 'Default authentication argument', |
'auth_arg_def' => 'Default authentication argument', |
'lang_def' => 'Default language', |
'lang_def' => 'Default language', |
'timezone_def' => 'Default timezone', |
'timezone_def' => 'Default timezone', |
'datelocale_def' => 'Default locale for dates', |
'datelocale_def' => 'Default locale for dates', |
'portal_def' => 'Portal/Default URL', |
|
); |
); |
if ($dom) { |
|
my $uprimary_id = &Apache::lonnet::domain($dom,'primary'); |
|
my $uint_dom = &Apache::lonnet::internet_dom($uprimary_id); |
|
my $protocol = $Apache::lonnet::protocol{$uprimary_id}; |
|
$protocol = 'http' if ($protocol ne 'https'); |
|
if ($uint_dom) { |
|
$titles{'portal_def'} .= ' '.&mt('(for example: [_1])',$protocol.'://loncapa.'. |
|
$uint_dom); |
|
} |
|
} |
|
return (\%titles); |
return (\%titles); |
} |
} |
|
|
Line 3336 sub print_serverstatuses {
|
Line 3316 sub print_serverstatuses {
|
sub serverstatus_pages { |
sub serverstatus_pages { |
return ('userstatus','lonstatus','loncron','server-status','codeversions', |
return ('userstatus','lonstatus','loncron','server-status','codeversions', |
'clusterstatus','metadata_keywords','metadata_harvest', |
'clusterstatus','metadata_keywords','metadata_harvest', |
'takeoffline','takeonline','showenv','toggledebug','ping','domconf'); |
'takeoffline','takeonline','showenv','toggledebug'); |
} |
} |
|
|
sub coursecategories_javascript { |
sub coursecategories_javascript { |
Line 4482 $env{'user.name'}.':'.$env{'user.domain'
|
Line 4462 $env{'user.name'}.':'.$env{'user.domain'
|
if (copy($source,$copyfile)) { |
if (copy($source,$copyfile)) { |
print $logfile "\nCopied original source to ".$copyfile."\n"; |
print $logfile "\nCopied original source to ".$copyfile."\n"; |
$output = 'ok'; |
$output = 'ok'; |
|
&write_metadata($dom,$confname,$formname,$targetdir,$file,$logfile); |
$logourl = '/res/'.$dom.'/'.$confname.'/'.$fname; |
$logourl = '/res/'.$dom.'/'.$confname.'/'.$fname; |
push(@{$modified_urls},[$copyfile,$source]); |
|
my $metaoutput = |
|
&write_metadata($dom,$confname,$formname,$targetdir,$file,$logfile); |
|
unless ($registered_cleanup) { |
|
my $handlers = $r->get_handlers('PerlCleanupHandler'); |
|
$r->set_handlers('PerlCleanupHandler' => [\¬ifysubscribed,@{$handlers}]); |
|
$registered_cleanup=1; |
|
} |
|
} else { |
} else { |
print $logfile "\nUnable to write ".$copyfile.':'.$!."\n"; |
print $logfile "\nUnable to write ".$copyfile.':'.$!."\n"; |
$output = &mt('Failed to copy file to RES space').", $!"; |
$output = &mt('Failed to copy file to RES space').", $!"; |
Line 4508 $env{'user.name'}.':'.$env{'user.domain'
|
Line 4481 $env{'user.name'}.':'.$env{'user.domain'
|
my $copyfile=$targetdir.'/tn-'.$file; |
my $copyfile=$targetdir.'/tn-'.$file; |
if (copy($outfile,$copyfile)) { |
if (copy($outfile,$copyfile)) { |
print $logfile "\nCopied source to ".$copyfile."\n"; |
print $logfile "\nCopied source to ".$copyfile."\n"; |
my $thumb_metaoutput = |
&write_metadata($dom,$confname,$formname, |
&write_metadata($dom,$confname,$formname, |
$targetdir,'tn-'.$file,$logfile); |
$targetdir,'tn-'.$file,$logfile); |
|
push(@{$modified_urls},[$copyfile,$outfile]); |
|
unless ($registered_cleanup) { |
|
my $handlers = $r->get_handlers('PerlCleanupHandler'); |
|
$r->set_handlers('PerlCleanupHandler' => [\¬ifysubscribed,@{$handlers}]); |
|
$registered_cleanup=1; |
|
} |
|
} else { |
} else { |
print $logfile "\nUnable to write ".$copyfile. |
print $logfile "\nUnable to write ".$copyfile. |
':'.$!."\n"; |
':'.$!."\n"; |
Line 4581 sub write_metadata {
|
Line 4547 sub write_metadata {
|
{ |
{ |
print $logfile "\nWrite metadata file for ".$targetdir.'/'.$file; |
print $logfile "\nWrite metadata file for ".$targetdir.'/'.$file; |
my $mfh; |
my $mfh; |
if (open($mfh,'>'.$targetdir.'/'.$file.'.meta')) { |
unless (open($mfh,'>'.$targetdir.'/'.$file.'.meta')) { |
foreach (sort keys %metadatafields) { |
|
unless ($_=~/\./) { |
|
my $unikey=$_; |
|
$unikey=~/^([A-Za-z]+)/; |
|
my $tag=$1; |
|
$tag=~tr/A-Z/a-z/; |
|
print $mfh "\n\<$tag"; |
|
foreach (split(/\,/,$metadatakeys{$unikey})) { |
|
my $value=$metadatafields{$unikey.'.'.$_}; |
|
$value=~s/\"/\'\'/g; |
|
print $mfh ' '.$_.'="'.$value.'"'; |
|
} |
|
print $mfh '>'. |
|
&HTML::Entities::encode($metadatafields{$unikey},'<>&"') |
|
.'</'.$tag.'>'; |
|
} |
|
} |
|
$output = 'ok'; |
|
print $logfile "\nWrote metadata"; |
|
close($mfh); |
|
} else { |
|
print $logfile "\nFailed to open metadata file"; |
|
$output = &mt('Could not write metadata'); |
$output = &mt('Could not write metadata'); |
} |
} |
|
foreach (sort keys %metadatafields) { |
|
unless ($_=~/\./) { |
|
my $unikey=$_; |
|
$unikey=~/^([A-Za-z]+)/; |
|
my $tag=$1; |
|
$tag=~tr/A-Z/a-z/; |
|
print $mfh "\n\<$tag"; |
|
foreach (split(/\,/,$metadatakeys{$unikey})) { |
|
my $value=$metadatafields{$unikey.'.'.$_}; |
|
$value=~s/\"/\'\'/g; |
|
print $mfh ' '.$_.'="'.$value.'"'; |
|
} |
|
print $mfh '>'. |
|
&HTML::Entities::encode($metadatafields{$unikey},'<>&"') |
|
.'</'.$tag.'>'; |
|
} |
|
} |
|
$output = 'ok'; |
|
print $logfile "\nWrote metadata"; |
|
close($mfh); |
} |
} |
return $output; |
|
} |
|
|
|
sub notifysubscribed { |
|
foreach my $targetsource (@{$modified_urls}){ |
|
next unless (ref($targetsource) eq 'ARRAY'); |
|
my ($target,$source)=@{$targetsource}; |
|
if ($source ne '') { |
|
if (open(my $logfh,'>>'.$source.'.log')) { |
|
print $logfh "\nCleanup phase: Notifications\n"; |
|
my @subscribed=&subscribed_hosts($target); |
|
foreach my $subhost (@subscribed) { |
|
print $logfh "\nNotifying host ".$subhost.':'; |
|
my $reply=&Apache::lonnet::critical('update:'.$target,$subhost); |
|
print $logfh $reply; |
|
} |
|
my @subscribedmeta=&subscribed_hosts("$target.meta"); |
|
foreach my $subhost (@subscribedmeta) { |
|
print $logfh "\nNotifying host for metadata only ".$subhost.':'; |
|
my $reply=&Apache::lonnet::critical('update:'.$target.'.meta', |
|
$subhost); |
|
print $logfh $reply; |
|
} |
|
print $logfh "\n============ Done ============\n"; |
|
close($logfh); |
|
} |
|
} |
|
} |
|
return OK; |
|
} |
|
|
|
sub subscribed_hosts { |
|
my ($target) = @_; |
|
my @subscribed; |
|
if (open(my $fh,"<$target.subscription")) { |
|
while (my $subline=<$fh>) { |
|
if ($subline =~ /^($match_lonid):/) { |
|
my $host = $1; |
|
if ($host ne $Apache::lonnet::perlvar{'lonHostID'}) { |
|
unless (grep(/^\Q$host\E$/,@subscribed)) { |
|
push(@subscribed,$host); |
|
} |
|
} |
|
} |
|
} |
|
} |
|
return @subscribed; |
|
} |
} |
|
|
sub check_switchserver { |
sub check_switchserver { |
Line 4723 sub modify_quotas {
|
Line 4640 sub modify_quotas {
|
$changes{'notify'}{'approval'} = 1; |
$changes{'notify'}{'approval'} = 1; |
} |
} |
} else { |
} else { |
if ($confhash{'notify'}{'approval'}) { |
if ($domconfig{$action}{'notify'}{'approval'}) { |
$changes{'notify'}{'approval'} = 1; |
$changes{'notify'}{'approval'} = 1; |
} |
} |
} |
} |
} else { |
} else { |
if ($confhash{'notify'}{'approval'}) { |
if ($domconfig{$action}{'notify'}{'approval'}) { |
$changes{'notify'}{'approval'} = 1; |
$changes{'notify'}{'approval'} = 1; |
} |
} |
} |
} |
Line 5049 sub modify_autoupdate {
|
Line 4966 sub modify_autoupdate {
|
middlename => 'Middle Name', |
middlename => 'Middle Name', |
generation => 'Generation', |
generation => 'Generation', |
); |
); |
$othertitle = &mt('All users'); |
my $othertitle = &mt('All users'); |
if (keys(%{$usertypes}) > 0) { |
if (keys(%{$usertypes}) > 0) { |
$othertitle = &mt('Other users'); |
$othertitle = &mt('Other users'); |
} |
} |
Line 6093 sub modify_defaults {
|
Line 6010 sub modify_defaults {
|
my ($dom,$r) = @_; |
my ($dom,$r) = @_; |
my ($resulttext,$mailmsgtxt,%newvalues,%changes,@errors); |
my ($resulttext,$mailmsgtxt,%newvalues,%changes,@errors); |
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom); |
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom); |
my @items = ('auth_def','auth_arg_def','lang_def','timezone_def','datelocale_def','portal_def'); |
my @items = ('auth_def','auth_arg_def','lang_def','timezone_def','datelocale_def'); |
my @authtypes = ('internal','krb4','krb5','localauth'); |
my @authtypes = ('internal','krb4','krb5','localauth'); |
foreach my $item (@items) { |
foreach my $item (@items) { |
$newvalues{$item} = $env{'form.'.$item}; |
$newvalues{$item} = $env{'form.'.$item}; |
Line 6129 sub modify_defaults {
|
Line 6046 sub modify_defaults {
|
push(@errors,$item); |
push(@errors,$item); |
} |
} |
} |
} |
} elsif ($item eq 'portal_def') { |
|
if ($newvalues{$item} ne '') { |
|
unless ($newvalues{$item} =~ /^https?\:\/\/(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])\/?$/) { |
|
push(@errors,$item); |
|
} |
|
} |
|
} |
} |
if (grep(/^\Q$item\E$/,@errors)) { |
if (grep(/^\Q$item\E$/,@errors)) { |
$newvalues{$item} = $domdefaults{$item}; |
$newvalues{$item} = $domdefaults{$item}; |
Line 6551 sub modify_serverstatuses {
|
Line 6462 sub modify_serverstatuses {
|
my %serverstatushash = ( |
my %serverstatushash = ( |
serverstatuses => \%newserverstatus, |
serverstatuses => \%newserverstatus, |
); |
); |
|
my %changes; |
foreach my $type (@pages) { |
foreach my $type (@pages) { |
foreach my $setting ('namedusers','machines') { |
foreach my $setting ('namedusers','machines') { |
my (@current,@new); |
my (@current,@new); |
Line 6751 sub modify_coursedefaults {
|
Line 6663 sub modify_coursedefaults {
|
my ($resulttext,$errors,%changes,%defaultshash); |
my ($resulttext,$errors,%changes,%defaultshash); |
my %defaultchecked = ('canuse_pdfforms' => 'off'); |
my %defaultchecked = ('canuse_pdfforms' => 'off'); |
my @offon = ('off','on'); |
my @offon = ('off','on'); |
my @toggles = (); |
my @toggles = ('canuse_pdfforms'); |
|
|
$defaultshash{'coursedefaults'} = {}; |
$defaultshash{'coursedefaults'} = {}; |
|
|
Line 6813 sub modify_coursedefaults {
|
Line 6725 sub modify_coursedefaults {
|
} |
} |
} elsif ($item eq 'anonsurvey_threshold') { |
} elsif ($item eq 'anonsurvey_threshold') { |
$resulttext .= '<li>'.&mt('Responder count required for display of anonymous survey submissions set to [_1].',$defaultshash{'coursedefaults'}{'anonsurvey_threshold'}).'</li>'; |
$resulttext .= '<li>'.&mt('Responder count required for display of anonymous survey submissions set to [_1].',$defaultshash{'coursedefaults'}{'anonsurvey_threshold'}).'</li>'; |
} |
} |
} |
} |
$resulttext .= '</ul>'; |
$resulttext .= '</ul>'; |
} else { |
} else { |