version 1.222.2.2, 2010/09/13 23:38:04
|
version 1.230, 2010/11/10 14:44:50
|
Line 455 sub sendemail {
|
Line 455 sub sendemail {
|
"*** ".&mt_user($user_lh,'This is an automatic e-mail generated by the LON-CAPA system.')."\n". |
"*** ".&mt_user($user_lh,'This is an automatic e-mail generated by the LON-CAPA system.')."\n". |
"*** ".($senderaddress?&mt_user($user_lh,'You can reply to this e-mail'):&mt_user($user_lh,'Please do not reply to this address.')."\n*** ". |
"*** ".($senderaddress?&mt_user($user_lh,'You can reply to this e-mail'):&mt_user($user_lh,'Please do not reply to this address.')."\n*** ". |
&mt_user($user_lh,'A reply will not be received by the recipient!'))."\n\n".$body; |
&mt_user($user_lh,'A reply will not be received by the recipient!'))."\n\n".$body; |
|
|
my $msg = new Mail::Send; |
my $msg = new Mail::Send; |
$msg->to($to); |
$msg->to($to); |
$msg->subject('[LON-CAPA] '.$subject); |
$msg->subject('[LON-CAPA] '.$subject); |
Line 464 sub sendemail {
|
Line 465 sub sendemail {
|
if ($senderaddress) { |
if ($senderaddress) { |
$msg->add('From',$senderaddress); |
$msg->add('From',$senderaddress); |
} |
} |
|
$msg->add('Content-type','text/plain; charset=UTF-8'); |
if (my $fh = $msg->open()) { |
if (my $fh = $msg->open()) { |
print $fh $body; |
print $fh $body; |
$fh->close; |
$fh->close; |
Line 574 sub make_htmlfree {
|
Line 576 sub make_htmlfree {
|
return $text; |
return $text; |
} |
} |
|
|
|
sub mynewmail{ |
|
&newmail(); |
|
return $env{'user.mailcheck.lastnewmassagetime'} > $env{'user.mailcheck.lastvisit'}; |
|
} |
|
|
|
|
sub newmail { |
sub newmail { |
if ((time-$env{'user.mailcheck.time'})>300) { |
if ((time-$env{'user.mailcheck.time'})>300) { |
my %what=&Apache::lonnet::get('email_status',['recnewemail']); |
my %what=&Apache::lonnet::get('email_status',['recnewemail']); |
&Apache::lonnet::appenv({'user.mailcheck.time'=>time}); |
&Apache::lonnet::appenv({'user.mailcheck.time'=>time}); |
|
&Apache::lonnet::appenv({'user.mailcheck.lastnewmassagetime'=> $what{'recnewemail'}}); |
if ($what{'recnewemail'}>0) { return 1; } |
if ($what{'recnewemail'}>0) { return 1; } |
} |
} |
return 0; |
return 0; |
Line 977 sub secapply {
|
Line 986 sub secapply {
|
my $rec=shift; |
my $rec=shift; |
my $defaultflag=shift; |
my $defaultflag=shift; |
$rec=~s/\s+//g; |
$rec=~s/\s+//g; |
$rec=~s/\@/\:/g; |
unless ($rec =~ /\:/) { |
|
$rec=~s/\@/\:/g; |
|
} |
my ($adr,$sections_or_groups)=($rec=~/^([^\(]+)\(([^\)]+)\)/); |
my ($adr,$sections_or_groups)=($rec=~/^([^\(]+)\(([^\)]+)\)/); |
if ($sections_or_groups) { |
if ($sections_or_groups) { |
foreach my $item (split(/\;/,$sections_or_groups)) { |
foreach my $item (split(/\;/,$sections_or_groups)) { |