version 1.71, 2003/12/05 22:14:15
|
version 1.74, 2003/12/30 20:39:30
|
Line 270 sub author_res_msg {
|
Line 270 sub author_res_msg {
|
my ($filename,$message)=@_; |
my ($filename,$message)=@_; |
unless ($message) { return 'empty'; } |
unless ($message) { return 'empty'; } |
$filename=&Apache::lonnet::declutter($filename); |
$filename=&Apache::lonnet::declutter($filename); |
my ($domain,$author)=split(/\//,$filename); |
my ($domain,$author,@dummy)=split(/\//,$filename); |
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); |
my $msgid; |
my $msgid; |
($msgid,$message)=&packagemsg("Error: [$filename]",$message); |
($msgid,$message)=&packagemsg($filename,$message); |
#FIXME this should be nohist_res_msg, we need to provide an interface |
|
# to this hash BUG#2444 |
|
#return &Apache::lonnet::reply('put:'.$domain.':'.$author. |
|
# ':nohist_res_msg:'. |
|
# &Apache::lonnet::escape($filename.'_'.$id).'='. |
|
# &Apache::lonnet::escape($message),$homeserver); |
|
return &Apache::lonnet::reply('put:'.$domain.':'.$author. |
return &Apache::lonnet::reply('put:'.$domain.':'.$author. |
':nohist_email:'. |
':nohist_res_msgs:'. |
&Apache::lonnet::escape($msgid).'='. |
&Apache::lonnet::escape($filename.'_'.$id).'='. |
&Apache::lonnet::escape($message),$homeserver); |
&Apache::lonnet::escape($message),$homeserver); |
} |
} |
return 'no_host'; |
return 'no_host'; |
} |
} |
|
|
|
# =========================================== Retrieve author resource messages |
|
|
|
sub retrieve_author_res_msg { |
|
my ($author,$domain,$url)=@_; |
|
$url=&Apache::lonnet::declutter($url); |
|
my %errormsgs=&Apache::lonnet::dump('nohist_res_msgs',$1,$2); |
|
my $msgs=''; |
|
foreach (keys %errormsgs) { |
|
if ($_=~/^\Q$url\E\_\d+$/) { |
|
my %content=&unpackagemsg($errormsgs{$_}); |
|
$msgs.='<p><img src="/adm/lonMisc/bomb.gif" /><b>'. |
|
$content{'time'}.'</b>: '.$content{'message'}. |
|
'<br /></p>'; |
|
} |
|
} |
|
return $msgs; |
|
} |
|
|
|
|
|
# =============================== Delete all author messages related to one URL |
|
|
|
sub del_url_author_res_msg { |
|
my ($author,$domain,$url)=@_; |
|
$url=&Apache::lonnet::declutter($url); |
|
} |
|
|
|
# ================= Return hash with URLs for which there is a resource message |
|
|
|
sub all_url_author_res_msg { |
|
my ($author,$domain)=@_; |
|
} |
|
|
# ================================================== Critical message to a user |
# ================================================== Critical message to a user |
|
|
sub user_crit_msg_raw { |
sub user_crit_msg_raw { |