[LON-CAPA-cvs] cvs: loncom /interface lonaboutme.pm

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 04 May 2004 14:34:25 -0000


albertel		Tue May  4 10:34:25 2004 EDT

  Modified files:              
    /loncom/interface	lonaboutme.pm 
  Log:
  - putting reveision 1.20 & 1.21 changes back in
  
  
Index: loncom/interface/lonaboutme.pm
diff -u loncom/interface/lonaboutme.pm:1.23 loncom/interface/lonaboutme.pm:1.24
--- loncom/interface/lonaboutme.pm:1.23	Tue May  4 10:20:55 2004
+++ loncom/interface/lonaboutme.pm	Tue May  4 10:34:25 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # "About Me" Personal Information
 #
-# $Id: lonaboutme.pm,v 1.23 2004/05/04 14:20:55 sakharuk Exp $
+# $Id: lonaboutme.pm,v 1.24 2004/05/04 14:34:25 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -124,8 +124,11 @@
       if (($ENV{'form.uploaddoc.filename'}) &&
           ($ENV{'form.storeupl'}) && ($allowed)) {
  	  if ($ENV{'form.uploaddoc.filename'}=~/\.(gif|jpg|png|jpeg)$/i) {
-             $syllabus{'uploaded.photourl'}=
-                 &Apache::lonnet::userfileupload('uploaddoc');
+	      if ($syllabus{'uploaded.photourl'}) {
+		  &Apache::lonnet::removeuploadedurl($syllabus{'uploaded.photourl'});
+	      }
+	      $syllabus{'uploaded.photourl'}=
+                 &Apache::lonnet::userfileupload('uploaddoc',undef,'aboutme');
  	  }
           $syllabus{'uploaded.lastmodified'}=time;
           &Apache::lonnet::put('aboutme',\%syllabus,$cdom,$cnum);
@@ -148,8 +151,9 @@
        $lastmod=($lastmod?&Apache::lonlocal::locallocaltime($lastmod):&mt('never'));
        $r->print(&mt('Last updated').': '.$lastmod);
        if ($syllabus{'uploaded.photourl'}) {
-	   $r->print('<img src="'.
-             &Apache::lonnet::tokenwrapper($syllabus{'uploaded.photourl'}).
+	   &Apache::lonnet::allowuploaded('/adm/aboutme',
+					  $syllabus{'uploaded.photourl'});
+	   $r->print('<img src="'.$syllabus{'uploaded.photourl'}.
              '" align="right" />');
        }
        if ($allowed) {