Annotation of loncom/interface/lonmsg.pm, revision 1.1
1.1 ! www 1: # The LearningOnline Network with CAPA
! 2: #
! 3: # Routines for messaging
! 4: #
! 5: # (Routines to control the menu
! 6: #
! 7: # (TeX Conversion Module
! 8: #
! 9: # 05/29/00,05/30 Gerd Kortemeyer)
! 10: #
! 11: # 10/05 Gerd Kortemeyer)
! 12: #
! 13: # 10/19 Gerd Kortemeyer
! 14:
! 15: package Apache::lonmsg;
! 16:
! 17: use strict;
! 18: use Apache::lonnet();
! 19:
! 20:
! 21: # ===================================================================== Package
! 22:
! 23: sub package {
! 24: var ($subject,$message)=@_;
! 25: $message=~s/\</\<\;/g;
! 26: $message=~s/\>/\>\;/g;
! 27: $subject=~s/\</\<\;/g;
! 28: $subject=~s/\>/\>\;/g;
! 29: return '<sendername>'.$ENV{'user.name'}.'</sendername>'.
! 30: '<senderdomain>'.$ENV{'user.domain'}.'</senderdomain>'.
! 31: '<subject>'.$subject.'</subject>'.
! 32: '<time>'.localtime().'</time>'.
! 33: '<servername>'.$ENV{'SERVER_NAME'}.'</servername>'.
! 34: '<host>'.$ENV{'HTTP_HOST'}.'</host>'.
! 35: '<client>'.$ENV{'REMOTE_ADDR'}.'</client>'.
! 36: '<browsertype>'.$ENV{'browser.type'}.'</browsertype>'.
! 37: '<browseros>'.$ENV{'browser.os'}.'</browseros>'.
! 38: '<browserversion>'.$ENV{'browser.version'}.'</browserversion>'.
! 39: '<browsermathml>'.$ENV{'browser.mathml'}.'</browsermathml>'.
! 40: '<browserraw>'.$ENV{'HTTP_USER_AGENT'}.'</browserraw>'.
! 41: '<courseid>'.$ENV{'request.course.id'}.'</courseid>'.
! 42: '<role>'.$ENV{'request.role'}.'</role>'.
! 43: '<resource>'.$ENV{'request.filename'}.'</resource>'.
! 44: '<message>'.$message.'</message>';
! 45: }
! 46:
! 47: # =============================== Automated message to the author of a resource
! 48:
! 49: sub author_res_msg {
! 50: my ($filename,$message)=@_;
! 51: $filename=&Apache::lonnet::declutter($filename);
! 52: my ($domain,$author,@dummy)=split(/\//,$filename);
! 53: my $homeserver=&Apache::lonnet::homeserver($author,$domain);
! 54: if ($homeserver ne 'no_host') {
! 55: my $id=unpack("%32C*",$message);
! 56: &Apache::lonnet::put('res_msgs',$filename.'_'.$id => package($message));
! 57: }
! 58: }
! 59:
! 60: # ================================================== Critical message to a user
! 61:
! 62: sub user_crit_msg {
! 63: my ($user,$domain,$subject,$message)=@_;
! 64: }
! 65:
! 66: 1;
! 67: __END__
! 68:
! 69:
! 70:
! 71:
! 72:
! 73:
! 74:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>