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

sakharuk lon-capa-cvs@mail.lon-capa.org
Tue, 04 May 2004 14:20:55 -0000


sakharuk		Tue May  4 10:20:55 2004 EDT

  Modified files:              
    /loncom/interface	lonaboutme.pm 
  Log:
  allowed=0 for 'text' target. Additional cleanup is done.
  
  
Index: loncom/interface/lonaboutme.pm
diff -u loncom/interface/lonaboutme.pm:1.22 loncom/interface/lonaboutme.pm:1.23
--- loncom/interface/lonaboutme.pm:1.22	Mon May  3 15:04:49 2004
+++ loncom/interface/lonaboutme.pm	Tue May  4 10:20:55 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # "About Me" Personal Information
 #
-# $Id: lonaboutme.pm,v 1.22 2004/05/03 19:04:49 sakharuk Exp $
+# $Id: lonaboutme.pm,v 1.23 2004/05/04 14:20:55 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -107,7 +107,7 @@
 
        $allowed=(($ENV{'user.name'} eq $cnum) && 
 		 ($ENV{'user.domain'} eq $cdom));
-       if ($forcestudent) { $allowed=0; }
+       if ($forcestudent or $target eq 'tex') { $allowed=0; }
  
        if ($allowed) {
 	   if ($target ne 'tex') {
@@ -124,11 +124,8 @@
       if (($ENV{'form.uploaddoc.filename'}) &&
           ($ENV{'form.storeupl'}) && ($allowed)) {
  	  if ($ENV{'form.uploaddoc.filename'}=~/\.(gif|jpg|png|jpeg)$/i) {
-	      if ($syllabus{'uploaded.photourl'}) {
-		  &Apache::lonnet::removeuploadedurl($syllabus{'uploaded.photourl'});
-	      }
-	      $syllabus{'uploaded.photourl'}=
-                 &Apache::lonnet::userfileupload('uploaddoc',undef,'aboutme');
+             $syllabus{'uploaded.photourl'}=
+                 &Apache::lonnet::userfileupload('uploaddoc');
  	  }
           $syllabus{'uploaded.lastmodified'}=time;
           &Apache::lonnet::put('aboutme',\%syllabus,$cdom,$cnum);
@@ -151,12 +148,11 @@
        $lastmod=($lastmod?&Apache::lonlocal::locallocaltime($lastmod):&mt('never'));
        $r->print(&mt('Last updated').': '.$lastmod);
        if ($syllabus{'uploaded.photourl'}) {
-	   &Apache::lonnet::allowuploaded('/adm/aboutme',
-					  $syllabus{'uploaded.photourl'});
-	   $r->print('<img src="'.$syllabus{'uploaded.photourl'}.
+	   $r->print('<img src="'.
+             &Apache::lonnet::tokenwrapper($syllabus{'uploaded.photourl'}).
              '" align="right" />');
        }
-       if ($allowed & $target ne 'tex') {
+       if ($allowed) {
            $r->print(
 	 '<form method="post" enctype="multipart/form-data">'.
          '<h3>'.&mt('Upload a Photo').'</h3>'.
@@ -178,7 +174,7 @@
 		     $r->print('\\\\\textbf{'.$syllabusfields{$_}.'}\\\\'.
 			       &Apache::lonxml::xmlparse($r,' ',$message).'\\\\');
 	      }
-              if ($allowed and $target ne 'tex') {
+              if ($allowed) {
                  $r->print('<br /><textarea cols="80" rows="6" name="'.$_.'">'.
 			   $syllabus{$_}.
            '</textarea><input type="submit" name="storesyl" value="'.
@@ -186,7 +182,7 @@
 	      }
 	  }
        }
-       if ($allowed and $target ne 'tex') {
+       if ($allowed) {
 	   $r->print('</form>');
        }
        if ($target ne 'tex') {$r->print('</p>');} else {$r->print('\\\\');}
@@ -205,9 +201,7 @@
             $r->print(&Apache::loncommon::noteswrapper('Add Records',$cnum,$cdom));
 	    } else {
 		$r->print('\\\\\textbf{'.&mt('User Notes, Records of Face-To-Face Discussions, and Critical Messages in Course').'}\\\\'.&mt('Shared by course faculty and staff').'\\\\\\\\');
-		my $mess=&Apache::lonmsg::disfacetoface($r,$cnum,$cdom);
-	#    $r->print(' '.&Apache::lonxml::xmlparse($r,' ',$mess).' ');
-		$r->print(' >>>>'.$mess.'<<<< ');
+		&Apache::lonmsg::disfacetoface($r,$cnum,$cdom);
 	    }
         }
     }