version 1.213, 2008/09/13 02:37:26
|
version 1.214.2.3, 2008/12/23 19:27:33
|
Line 83 sub packagemsg {
|
Line 83 sub packagemsg {
|
$citation=&HTML::Entities::encode($citation,'<>&"'); |
$citation=&HTML::Entities::encode($citation,'<>&"'); |
$subject =&HTML::Entities::encode($subject,'<>&"'); |
$subject =&HTML::Entities::encode($subject,'<>&"'); |
#remove machine specification |
#remove machine specification |
$baseurl =~ s|^http://[^/]+/|/|; |
$baseurl =~ s|^https?\://[^/]+/|/|; |
$baseurl =&HTML::Entities::encode($baseurl,'<>&"'); |
$baseurl =&HTML::Entities::encode($baseurl,'<>&"'); |
#remove machine specification |
#remove machine specification |
$attachmenturl =~ s|^http://[^/]+/|/|; |
$attachmenturl =~ s|^https\://[^/]+/|/|; |
$attachmenturl =&HTML::Entities::encode($attachmenturl,'<>&"'); |
$attachmenturl =&HTML::Entities::encode($attachmenturl,'<>&"'); |
my $course_context = &get_course_context(); |
my $course_context = &get_course_context(); |
my $now=time; |
my $now=time; |
Line 120 sub packagemsg {
|
Line 120 sub packagemsg {
|
'<role>'.$env{'request.role'}.'</role>'. |
'<role>'.$env{'request.role'}.'</role>'. |
'<resource>'.$env{'request.filename'}.'</resource>'. |
'<resource>'.$env{'request.filename'}.'</resource>'. |
'<msgid>'.$msgid.'</msgid>'; |
'<msgid>'.$msgid.'</msgid>'; |
|
if (defined($env{'form.group'})) { |
|
$result .= '<group>'.$env{'form.group'}.'</group>'; |
|
} |
if (ref($recuser) eq 'ARRAY') { |
if (ref($recuser) eq 'ARRAY') { |
for (my $i=0; $i<@{$recuser}; $i++) { |
for (my $i=0; $i<@{$recuser}; $i++) { |
if ($type eq 'dcmail') { |
if ($type eq 'dcmail') { |
Line 313 sub sendnotification {
|
Line 316 sub sendnotification {
|
|
|
$text=~s/\<\;/\</gs; |
$text=~s/\<\;/\</gs; |
$text=~s/\>\;/\>/gs; |
$text=~s/\>\;/\>/gs; |
my $url='http://'. |
my $homeserver = &Apache::lonnet::homeserver($touname,$toudom); |
&Apache::lonnet::hostname(&Apache::lonnet::homeserver($touname,$toudom)). |
my $protocol = $Apache::lonnet::protocol{$homeserver}; |
'/adm/email?username='.$touname.'&domain='.$toudom; |
$protocol = 'http' if ($protocol ne 'https'); |
|
my $url = $protocol.'://'.&Apache::lonnet::hostname($homeserver). |
|
'/adm/email?username='.$touname.'&domain='.$toudom; |
my ($sendtime,$shortsubj,$fromname,$fromdomain,$status,$fromcid, |
my ($sendtime,$shortsubj,$fromname,$fromdomain,$status,$fromcid, |
$symb,$error) = &Apache::lonmsg::unpackmsgid($msgid); |
$symb,$error) = &Apache::lonmsg::unpackmsgid($msgid); |
my ($coursetext,$body,$bodybegin,$bodysubj,$bodyend); |
my ($coursetext,$body,$bodybegin,$bodysubj,$bodyend); |
Line 688 sub user_normal_msg_raw {
|
Line 693 sub user_normal_msg_raw {
|
$text,$msgid); |
$text,$msgid); |
} |
} |
if ($toperm && $userenv{'permanentemail'}) { |
if ($toperm && $userenv{'permanentemail'}) { |
&sendnotification($userenv{'permanentemail'},$user,$domain,$subject,0, |
if ((!$userenv{'notification'}) || ($userenv{'notification'} ne $userenv{'permanentemail'})) { |
$text,$msgid); |
&sendnotification($userenv{'permanentemail'},$user,$domain,$subject,0, |
|
$text,$msgid); |
|
} |
} |
} |
&Apache::lonnet::log($env{'user.domain'},$env{'user.name'}, |
&Apache::lonnet::log($env{'user.domain'},$env{'user.name'}, |
$env{'user.home'}, |
$env{'user.home'}, |
Line 748 sub user_normal_msg {
|
Line 755 sub user_normal_msg {
|
} |
} |
|
|
sub process_sent_mail { |
sub process_sent_mail { |
my ($msgsubj,$subj_prefix,$numsent,$stamp,$msgname,$msgdom,$msgcount,$context,$pid,$savemsg,$recusers,$recudoms,$baseurl,$attachmenturl,$symb,$error,$senderuname,$senderdom) = @_; |
my ($msgsubj,$subj_prefix,$numsent,$stamp,$msgname,$msgdom,$msgcount,$context,$pid,$savemsg,$recusers,$recudoms,$baseurl,$attachmenturl,$symb,$error,$senderuname,$senderdom,$recipid) = @_; |
my $sentsubj; |
my $sentsubj; |
if ($numsent > 1) { |
if ($numsent > 1) { |
$sentsubj = $subj_prefix.' ('.$numsent.' sent) '.$msgsubj; |
$sentsubj = $subj_prefix.' ('.$numsent.' sent) '.$msgsubj; |
Line 763 sub process_sent_mail {
|
Line 770 sub process_sent_mail {
|
&buildmsgid($stamp,$sentsubj,$msgname,$msgdom,$msgcount,$context,$pid); |
&buildmsgid($stamp,$sentsubj,$msgname,$msgdom,$msgcount,$context,$pid); |
(undef,my $sentmessage) = |
(undef,my $sentmessage) = |
&packagemsg($msgsubj,$savemsg,undef,$baseurl,$attachmenturl,$recusers, |
&packagemsg($msgsubj,$savemsg,undef,$baseurl,$attachmenturl,$recusers, |
$recudoms,$sentmsgid,undef,undef,$symb,$error); |
$recudoms,$sentmsgid,undef,undef,$symb,$error,$recipid); |
my $status = &store_sent_mail($sentmsgid,$sentmessage,$senderuname, |
my $status = &store_sent_mail($sentmsgid,$sentmessage,$senderuname, |
$senderdom); |
$senderdom); |
return $status; |
return $status; |
Line 931 sub user_lang {
|
Line 938 sub user_lang {
|
@userlangs=(@userlangs,split(/\s*(\,|\;|\:)\s*/, |
@userlangs=(@userlangs,split(/\s*(\,|\;|\:)\s*/, |
$env{'course.'.$fromcid.'.languages'})); |
$env{'course.'.$fromcid.'.languages'})); |
} else { |
} else { |
my %langhash = &Apache::lonnet::get('environment',['languages'],$toudom,$touname); |
my %langhash = &Apache::loncommon::getlangs($toudom,$touname); |
if ($langhash{'languages'} ne '') { |
if ($langhash{'languages'} ne '') { |
@userlangs = split(/\s*(\,|\;|\:)\s*/,$langhash{'languages'}); |
@userlangs = split(/\s*(\,|\;|\:)\s*/,$langhash{'languages'}); |
} else { |
} else { |
Line 941 sub user_lang {
|
Line 948 sub user_lang {
|
} |
} |
} |
} |
} |
} |
my @languages=&Apache::loncommon::get_genlanguages(@userlangs); |
my @languages=&Apache::lonlocal::get_genlanguages(@userlangs); |
my $user_lh = Apache::localize->get_handle(@languages); |
my $user_lh = Apache::localize->get_handle(@languages); |
return $user_lh; |
return $user_lh; |
} |
} |