version 1.612, 2007/11/10 03:51:46
|
version 1.619, 2007/12/04 04:43:21
|
Line 4834 table.LC_descriptive_input td.LC_descrip
|
Line 4834 table.LC_descriptive_input td.LC_descrip
|
font-weight: bold; |
font-weight: bold; |
} |
} |
div.LC_feedback_link { |
div.LC_feedback_link { |
|
clear: both; |
background: white; |
background: white; |
width: 100%; |
width: 100%; |
} |
} |
Line 5097 span.LC_grade_check_note {
|
Line 5098 span.LC_grade_check_note {
|
right: 1em; |
right: 1em; |
} |
} |
|
|
|
table.LC_scantron_action { |
|
width: 100%; |
|
} |
|
table.LC_scantron_action tr th { |
|
font: normal bold $sans; |
|
} |
|
|
div.LC_edit_problem_header { |
div.LC_edit_problem_header, |
|
div.LC_edit_problem_footer { |
font: normal medium $sans; |
font: normal medium $sans; |
margin: 2px; |
margin: 2px; |
} |
} |
div.LC_edit_problem_header, |
div.LC_edit_problem_header, |
div.LC_edit_problem_header div, |
div.LC_edit_problem_header div, |
|
div.LC_edit_problem_footer, |
|
div.LC_edit_problem_footer div, |
div.LC_edit_problem_editxml_header, |
div.LC_edit_problem_editxml_header, |
div.LC_edit_problem_editxml_header div { |
div.LC_edit_problem_editxml_header div { |
margin-top: 5px; |
margin-top: 5px; |
Line 5851 sub get_course_users {
|
Line 5861 sub get_course_users {
|
my ($classlist,$keylist)=&Apache::loncoursedata::get_classlist($cdom,$cnum); |
my ($classlist,$keylist)=&Apache::loncoursedata::get_classlist($cdom,$cnum); |
my $now = time; |
my $now = time; |
foreach my $student (keys(%{$classlist})) { |
foreach my $student (keys(%{$classlist})) { |
my $status; |
|
my $match = 0; |
my $match = 0; |
my $secmatch = 0; |
my $secmatch = 0; |
my $section = $$classlist{$student}[$idx{section}]; |
my $section = $$classlist{$student}[$idx{section}]; |
Line 6431 END_BLOCK
|
Line 6440 END_BLOCK
|
} |
} |
|
|
sub user_rule_check { |
sub user_rule_check { |
my ($usershash,$checks,$alerts,$rulematch,$inst_results,$curr_rules) = @_; |
my ($usershash,$checks,$alerts,$rulematch,$inst_results,$curr_rules,$got_rules) = @_; |
my $response; |
my $response; |
if (ref($usershash) eq 'HASH') { |
if (ref($usershash) eq 'HASH') { |
my %got_rules; |
|
foreach my $user (keys(%{$usershash})) { |
foreach my $user (keys(%{$usershash})) { |
my ($uname,$udom) = split(/:/,$user); |
my ($uname,$udom) = split(/:/,$user); |
next if ($udom eq '' || $uname eq ''); |
next if ($udom eq '' || $uname eq ''); |
my ($userstatus,$id); |
my ($id,$newuser); |
if (ref($usershash->{$user}) eq 'HASH') { |
if (ref($usershash->{$user}) eq 'HASH') { |
$userstatus = $usershash->{$user}->{'status'}; |
$newuser = $usershash->{$user}->{'newuser'}; |
$id = $usershash->{$user}->{'id'}; |
$id = $usershash->{$user}->{'id'}; |
} |
} |
my $inst_response; |
my $inst_response; |
if (ref($checks) eq 'HASH') { |
if (ref($checks) eq 'HASH') { |
if (defined($checks->{'username'})) { |
if (defined($checks->{'username'})) { |
($inst_response,%{$inst_results}) = |
($inst_response,%{$inst_results->{$user}}) = |
&Apache::lonnet::get_instuser($udom,$uname); |
&Apache::lonnet::get_instuser($udom,$uname); |
} elsif (defined($checks->{'id'})) { |
} elsif (defined($checks->{'id'})) { |
($inst_response,%{$inst_results}) = |
($inst_response,%{$inst_results->{$user}}) = |
&Apache::lonnet::get_instuser($udom,undef,$id); |
&Apache::lonnet::get_instuser($udom,undef,$id); |
} |
} |
|
} else { |
|
($inst_response,%{$inst_results->{$user}}) = |
|
&Apache::lonnet::get_instuser($udom,$uname); |
|
return; |
} |
} |
if (!$got_rules{$udom}) { |
if (!$got_rules->{$udom}) { |
my %domconfig = &Apache::lonnet::get_dom('configuration', |
my %domconfig = &Apache::lonnet::get_dom('configuration', |
['usercreation'],$udom); |
['usercreation'],$udom); |
if (ref($domconfig{'usercreation'}) eq 'HASH') { |
if (ref($domconfig{'usercreation'}) eq 'HASH') { |
foreach my $item (keys(%{$checks})) { |
foreach my $item ('username','id') { |
if (ref($domconfig{'usercreation'}{$item.'_rule'}) eq 'ARRAY') { |
if (ref($domconfig{'usercreation'}{$item.'_rule'}) eq 'ARRAY') { |
$$curr_rules{$udom}{$item} = |
$$curr_rules{$udom}{$item} = |
$domconfig{'usercreation'}{$item.'_rule'}; |
$domconfig{'usercreation'}{$item.'_rule'}; |
} |
} |
} |
} |
} |
} |
$got_rules{$udom} = 1; |
$got_rules->{$udom} = 1; |
} |
} |
foreach my $item (keys(%{$checks})) { |
foreach my $item (keys(%{$checks})) { |
if (ref($$curr_rules{$udom}) eq 'HASH') { |
if (ref($$curr_rules{$udom}) eq 'HASH') { |
if (ref($$curr_rules{$udom}{$item}) eq 'ARRAY') { |
if (ref($$curr_rules{$udom}{$item}) eq 'ARRAY') { |
if (@{$$curr_rules{$udom}{$item}} > 0) { |
if (@{$$curr_rules{$udom}{$item}} > 0) { |
my %rule_check; |
|
my %rule_check = &Apache::lonnet::inst_rulecheck($udom,$uname,$id,$item,$$curr_rules{$udom}{$item}); |
my %rule_check = &Apache::lonnet::inst_rulecheck($udom,$uname,$id,$item,$$curr_rules{$udom}{$item}); |
foreach my $rule (@{$$curr_rules{$udom}{$item}}) { |
foreach my $rule (@{$$curr_rules{$udom}{$item}}) { |
if ($rule_check{$rule}) { |
if ($rule_check{$rule}) { |
$$rulematch{$user}{$item} = $rule; |
$$rulematch{$user}{$item} = $rule; |
if ($inst_response eq 'ok') { |
if ($inst_response eq 'ok') { |
if (keys(%{$inst_results}) == 0) { |
if (ref($inst_results) eq 'HASH') { |
if ($userstatus eq 'new') { |
if (ref($inst_results->{$user}) eq 'HASH') { |
$$alerts{$user}{$item} = 1; |
if (keys(%{$inst_results->{$user}}) == 0) { |
|
$$alerts{$item}{$udom}{$uname} = 1; |
|
} |
} |
} |
} |
} |
} |
} |
|
last; |
} |
} |
} |
} |
last; |
|
} |
} |
} |
} |
} |
} |
Line 6522 sub user_rule_formats {
|
Line 6535 sub user_rule_formats {
|
} |
} |
|
|
sub instrule_disallow_msg { |
sub instrule_disallow_msg { |
my ($checkitem,$domdesc,$count) = @_; |
my ($checkitem,$domdesc,$count,$mode) = @_; |
my $response; |
my $response; |
my %text = ( |
my %text = ( |
item => 'username', |
item => 'username', |
Line 6543 sub instrule_disallow_msg {
|
Line 6556 sub instrule_disallow_msg {
|
$text{'items'} = 'IDs'; |
$text{'items'} = 'IDs'; |
$text{'item'} = 'ID'; |
$text{'item'} = 'ID'; |
$text{'action'} = 'an ID'; |
$text{'action'} = 'an ID'; |
|
if ($count > 1) { |
|
$text{'item'} = 'IDs'; |
|
$text{'action'} = 'IDs'; |
|
} |
} |
} |
$response = &mt("The $text{'item'} you chose $text{'match'} the format of $text{'items'} defined for <span class=\"LC_cusr_emph\">[_1]</span>, but the $text{'item'} $text{'do'} not exist in the institutional directory.",$domdesc).'<br />'; |
$response = &mt("The $text{'item'} you chose $text{'match'} the format of $text{'items'} defined for <span class=\"LC_cusr_emph\">[_1]</span>, but the $text{'item'} $text{'do'} not exist in the institutional directory.",$domdesc).'<br />'; |
if ($checkitem eq 'username') { |
if ($mode eq 'upload') { |
$response .= &mt("You must choose $text{'action'} with a different format -- $text{'one'} that will not conflict with 'official' institutional $text{'items'}."); |
if ($checkitem eq 'username') { |
} elsif ($checkitem eq 'id') { |
$response .= &mt("You will need to modify your upload file so it will include $text{'action'} with a different format -- $text{'one'} that will not conflict with 'official' institutional $text{'items'}."); |
$response .= &mt("You must either choose $text{'action'} with a different format -- $text{'one'} that will not conflict with 'official' institutional $text{'items'}, or leave this field blank."); |
} elsif ($checkitem eq 'id') { |
|
$response .= &mt("Either upload a file which includes $text{'action'} with a different format -- $text{'one'} that will not conflict with 'official' institutional $text{'items'}, or when associating fields with data columns, omit an association for the ID/Student Number field."); |
|
} |
|
} else { |
|
if ($checkitem eq 'username') { |
|
$response .= &mt("You must choose $text{'action'} with a different format -- $text{'one'} that will not conflict with 'official' institutional $text{'items'}."); |
|
} elsif ($checkitem eq 'id') { |
|
$response .= &mt("You must either choose $text{'action'} with a different format -- $text{'one'} that will not conflict with 'official' institutional $text{'items'}, or leave the ID field blank."); |
|
} |
} |
} |
return $response; |
return $response; |
} |
} |
Line 7611 sub restore_settings {
|
Line 7636 sub restore_settings {
|
} |
} |
} |
} |
|
|
|
####################################################### |
|
####################################################### |
|
|
|
=pod |
|
|
|
=head1 Domain E-mail Routines |
|
|
|
=over 4 |
|
|
|
=item &build_recipient_list |
|
|
|
Build recipient lists for three types of e-mail: |
|
(a) Error Reports, (b) Package Updates, (c) Help requests, generated by |
|
lonerrorhandler.pm, CHECKRPMS and lonsupportreq.pm respectively. |
|
|
|
Inputs: |
|
defmail (scalar - email address of default recipient), |
|
mailing type (scalar - errormail, packagesmail, or helpdeskmail), |
|
defdom (domain for which to retrieve configuration settings), |
|
origmail (scalar - email address of recipient from loncapa.conf, |
|
i.e., predates configuration by DC via domainprefs.pm |
|
|
|
Returns: comma separated list of addresses to which to send e-mail. |
|
|
|
=cut |
|
|
|
############################################################ |
|
############################################################ |
|
sub build_recipient_list { |
|
my ($defmail,$mailing,$defdom,$origmail) = @_; |
|
my @recipients; |
|
my $otheremails; |
|
my %domconfig = |
|
&Apache::lonnet::get_dom('configuration',['contacts'],$defdom); |
|
if (ref($domconfig{'contacts'}) eq 'HASH') { |
|
if (ref($domconfig{'contacts'}{$mailing}) eq 'HASH') { |
|
my @contacts = ('adminemail','supportemail'); |
|
foreach my $item (@contacts) { |
|
if ($domconfig{'contacts'}{$mailing}{$item}) { |
|
my $addr = $domconfig{'contacts'}{$item}; |
|
if (!grep(/^\Q$addr\E$/,@recipients)) { |
|
push(@recipients,$addr); |
|
} |
|
} |
|
$otheremails = $domconfig{'contacts'}{$mailing}{'others'}; |
|
} |
|
} |
|
} elsif ($origmail ne '') { |
|
push(@recipients,$origmail); |
|
} |
|
if ($defmail ne '') { |
|
push(@recipients,$defmail); |
|
} |
|
if ($otheremails) { |
|
my @others; |
|
if ($otheremails =~ /,/) { |
|
@others = split(/,/,$otheremails); |
|
} else { |
|
push(@others,$otheremails); |
|
} |
|
foreach my $addr (@others) { |
|
if (!grep(/^\Q$addr\E$/,@recipients)) { |
|
push(@recipients,$addr); |
|
} |
|
} |
|
} |
|
my $recipientlist = join(',',@recipients); |
|
return $recipientlist; |
|
} |
|
|
############################################################ |
############################################################ |
############################################################ |
############################################################ |
|
|