version 1.228, 2010/10/28 16:20:50
|
version 1.235, 2013/07/24 18:21:39
|
Line 465 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 525 sub sendnotification {
|
Line 526 sub sendnotification {
|
|
|
to access the full message.',$url); |
to access the full message.',$url); |
my %userenv = &Apache::lonnet::get('environment',['notifywithhtml'],$toudom,$touname); |
my %userenv = &Apache::lonnet::get('environment',['notifywithhtml'],$toudom,$touname); |
my $subject = &mt_user($user_lh,"'New' $critical message from ").$sender; |
my $subject = &mt_user($user_lh,"'New'$critical message from [_1]",$sender); |
|
unless ($subj eq '') { |
|
$subject = $subj; |
|
} |
|
|
my ($blocked,$blocktext); |
my ($blocked,$blocktext); |
if (!$crit) { |
if (!$crit) { |
Line 577 sub make_htmlfree {
|
Line 581 sub make_htmlfree {
|
|
|
sub mynewmail{ |
sub mynewmail{ |
&newmail(); |
&newmail(); |
return $env{'user.mailcheck.lastnewmassagetime'} > $env{'user.mailcheck.lastvisit'}; |
return $env{'user.mailcheck.lastnewmessagetime'} > $env{'user.mailcheck.lastvisit'}; |
} |
} |
|
|
|
|
Line 585 sub newmail {
|
Line 589 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'}}); |
&Apache::lonnet::appenv({'user.mailcheck.lastnewmessagetime'=> $what{'recnewemail'}}); |
if ($what{'recnewemail'}>0) { return 1; } |
if ($what{'recnewemail'}>0) { return 1; } |
} |
} |
return 0; |
return 0; |
Line 985 sub secapply {
|
Line 989 sub secapply {
|
my $rec=shift; |
my $rec=shift; |
my $defaultflag=shift; |
my $defaultflag=shift; |
$rec=~s/\s+//g; |
$rec=~s/\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)) { |