[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm
www
lon-capa-cvs@mail.lon-capa.org
Thu, 08 Aug 2002 13:42:01 -0000
www Thu Aug 8 09:42:01 2002 EDT
Modified files:
/loncom/lonnet/perl lonnet.pm
Log:
New routine to fetch uploaded file
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.262 loncom/lonnet/perl/lonnet.pm:1.263
--- loncom/lonnet/perl/lonnet.pm:1.262 Wed Aug 7 16:40:57 2002
+++ loncom/lonnet/perl/lonnet.pm Thu Aug 8 09:42:01 2002
@@ -1,7 +1,7 @@
# The LearningOnline Network
# TCP networking package
#
-# $Id: lonnet.pm,v 1.262 2002/08/07 20:40:57 matthew Exp $
+# $Id: lonnet.pm,v 1.263 2002/08/08 13:42:01 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -608,6 +608,18 @@
return %returnhash;
}
+# -------------------------------------------------------------------- New chat
+
+sub chatsend {
+ my ($newentry,$anon)=@_;
+ my $cnum=$ENV{'course.'.$ENV{'request.course.id'}.'.num'};
+ my $cdom=$ENV{'course.'.$ENV{'request.course.id'}.'.domain'};
+ my $chome=$ENV{'course.'.$ENV{'request.course.id'}.'.home'};
+ &reply('chatsend:'.$cdom.':'.$cnum.':'.
+ &escape($ENV{'user.domain'}.':'.$ENV{'user.name'}.':'.$anon.':'.
+ &escape($newentry)),$chome);
+}
+
# ----------------------------- Subscribe to a resource, return URL if possible
sub subscribe {
@@ -766,10 +778,15 @@
}
# Notify homeserver to grep it
#
-# FIXME - this still needs to happen
+ if
+(&reply('fetchuserfile:'.$docudom.'/'.$docuname.'/'.$fname,$docuhome) eq 'ok')
+ {
#
# Return the URL to it
- return '/uploaded/'.$path.$fname;
+ return '/uploaded/'.$path.$fname;
+ } else {
+ return '/adm/notfound.html';
+ }
}
# ------------------------------------------------------------------------- Log