version 1.180, 2006/04/08 06:53:37
|
version 1.183, 2006/04/25 19:45:50
|
Line 188 sub unpackmsgid {
|
Line 188 sub unpackmsgid {
|
$msgid=&Apache::lonnet::unescape($msgid); |
$msgid=&Apache::lonnet::unescape($msgid); |
my ($sendtime,$shortsubj,$fromname,$fromdomain,$count,$fromcid, |
my ($sendtime,$shortsubj,$fromname,$fromdomain,$count,$fromcid, |
$processid)=split(/\:/,&Apache::lonnet::unescape($msgid)); |
$processid)=split(/\:/,&Apache::lonnet::unescape($msgid)); |
|
$shortsubj = &Apache::lonnet::unescape($shortsubj); |
|
$shortsubj = &HTML::Entities::decode($shortsubj); |
if (!defined($processid)) { $fromcid = ''; } |
if (!defined($processid)) { $fromcid = ''; } |
my %status=(); |
my %status=(); |
unless ($skipstatus) { |
unless ($skipstatus) { |
Line 278 sub author_res_msg {
|
Line 280 sub author_res_msg {
|
my $homeserver=&Apache::lonnet::homeserver($author,$domain); |
my $homeserver=&Apache::lonnet::homeserver($author,$domain); |
if ($homeserver ne 'no_host') { |
if ($homeserver ne 'no_host') { |
my $id=unpack("%32C*",$message); |
my $id=unpack("%32C*",$message); |
|
$message .= " <p>This error occurred on machine ". |
|
$Apache::lonnet::perlvar{'lonHostID'}."</p>"; |
my $msgid; |
my $msgid; |
($msgid,$message)=&packagemsg($filename,$message); |
($msgid,$message)=&packagemsg($filename,$message); |
return &Apache::lonnet::reply('put:'.$domain.':'.$author. |
return &Apache::lonnet::reply('put:'.$domain.':'.$author. |
Line 402 sub user_crit_msg_raw {
|
Line 406 sub user_crit_msg_raw {
|
a critical message $message to the $user at $domain. If $sendback is true, |
a critical message $message to the $user at $domain. If $sendback is true, |
a reciept will be sent to the current user when $user recieves the message. |
a reciept will be sent to the current user when $user recieves the message. |
|
|
|
Additionally it will check if the user has a Forwarding address |
|
set, and send the message to that address instead |
|
|
|
returns |
|
- in array context a list of results for each message that was sent |
|
- in scalar context a space seperated list of results for each |
|
message sent |
|
|
=cut |
=cut |
|
|
sub user_crit_msg { |
sub user_crit_msg { |
my ($user,$domain,$subject,$message,$sendback,$toperm,$sentmessage)=@_; |
my ($user,$domain,$subject,$message,$sendback,$toperm,$sentmessage)=@_; |
my $status=''; |
my @status; |
my %userenv = &Apache::lonnet::get('environment',['msgforward'], |
my %userenv = &Apache::lonnet::get('environment',['msgforward'], |
$domain,$user); |
$domain,$user); |
my $msgforward=$userenv{'msgforward'}; |
my $msgforward=$userenv{'msgforward'}; |
if ($msgforward) { |
if ($msgforward) { |
foreach (split(/\,/,$msgforward)) { |
foreach my $addr (split(/\,/,$msgforward)) { |
my ($forwuser,$forwdomain)=split(/\:/,$_); |
my ($forwuser,$forwdomain)=split(/\:/,$addr); |
$status.= |
push(@status, |
&user_crit_msg_raw($forwuser,$forwdomain,$subject,$message, |
&user_crit_msg_raw($forwuser,$forwdomain,$subject,$message, |
$sendback,$toperm,$sentmessage).' '; |
$sendback,$toperm,$sentmessage)); |
} |
} |
} else { |
} else { |
$status=&user_crit_msg_raw($user,$domain,$subject,$message,$sendback,$toperm,$sentmessage); |
push(@status, |
|
&user_crit_msg_raw($user,$domain,$subject,$message,$sendback, |
|
$toperm,$sentmessage)); |
} |
} |
return $status; |
if (wantarray) { |
|
return @status; |
|
} |
|
return join(' ',@status); |
} |
} |
|
|
# =================================================== Critical message received |
# =================================================== Critical message received |