Diff for /loncom/interface/lonaboutme.pm between versions 1.31 and 1.32

version 1.31, 2004/08/26 21:42:40 version 1.32, 2004/11/13 10:06:17
Line 105  ENDDOCUMENT Line 105  ENDDOCUMENT
   
 # does this user have privileges to post, etc?  # does this user have privileges to post, etc?
   
        $allowed=(($ENV{'user.name'} eq $cnum) &&          my $privleged=$allowed=(($ENV{'user.name'} eq $cnum) && 
  ($ENV{'user.domain'} eq $cdom));         ($ENV{'user.domain'} eq $cdom));
        if ($forcestudent or $target eq 'tex') { $allowed=0; }         if ($forcestudent or $target eq 'tex') { $allowed=0; }
     
        if ($allowed) {         if ($allowed) {
    if ($target ne 'tex') {     $r->print('<p><b>'.&mt('Privacy Note').':</b> '.
        $r->print('<p><b>'.&mt('Privacy Note').':</b> '.       &mt('The information you submit can be viewed by anybody who is logged into LON-CAPA. Do not provide information that you are not ready to share publicly.').
                          &mt('The information you submit can be viewed by anybody who is logged into LON-CAPA. Do not provide information that you are not ready to share publicly.').       '</p>'.
                          '</p>'.       &Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes','Help with filling in text boxes').'</p><p><a href="'.$r->uri.'?forcestudent=1">Show Public View</a>'.
                          &Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes','Help with filling in text boxes').'</p><p><a href="'.$r->uri.'?forcestudent=1">Show Public View</a>'.       &Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView').'</p>');
                          &Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView').'</p>');         } elsif ($privleged && $target ne 'tex') {
    } else {     $r->print('<p><a href="'.$r->uri.'?forceedit=1"><font size="+1">'.
        $r->print(' \textbf{'.&mt('Privacy Note').'}: '.       &mt('Edit').'</font></a></p>');
                          &mt('The information you submit can be viewed by anybody who is logged into LON-CAPA. Do not provide information that you are not ready to share publicly.').'\\\\\\\\');         }
    }  
       }  
       if (($ENV{'form.uploaddoc.filename'}) &&        if (($ENV{'form.uploaddoc.filename'}) &&
           ($ENV{'form.storeupl'}) && ($allowed)) {            ($ENV{'form.storeupl'}) && ($allowed)) {
    if ($ENV{'form.uploaddoc.filename'}=~/\.(gif|jpg|png|jpeg)$/i) {     if ($ENV{'form.uploaddoc.filename'}=~/\.(gif|jpg|png|jpeg)$/i) {
Line 133  ENDDOCUMENT Line 131  ENDDOCUMENT
           $syllabus{'uploaded.lastmodified'}=time;            $syllabus{'uploaded.lastmodified'}=time;
           &Apache::lonnet::put('aboutme',\%syllabus,$cdom,$cnum);            &Apache::lonnet::put('aboutme',\%syllabus,$cdom,$cnum);
        }         }
       if ($allowed && $ENV{'form.delupl'}) {
    if ($syllabus{'uploaded.photourl'}) {
       &Apache::lonnet::removeuploadedurl($syllabus{'uploaded.photourl'});
       delete($syllabus{'uploaded.photourl'});
       &Apache::lonnet::del('aboutme',['uploaded.photourl'],$cdom,$cnum);
    }
       }
        if (($allowed) && ($ENV{'form.storesyl'})) {         if (($allowed) && ($ENV{'form.storesyl'})) {
    foreach (keys %syllabusfields) {     foreach (keys %syllabusfields) {
                my $field=$ENV{'form.'.$_};                 my $field=$ENV{'form.'.$_};
Line 162  ENDDOCUMENT Line 167  ENDDOCUMENT
        }         }
        if ($allowed) {         if ($allowed) {
            $r->print(             $r->print(
    '<form method="post">
                  <input type="submit" name="delupl" value="Delete Photo" />
             </form>'.
  '<form method="post" enctype="multipart/form-data">'.   '<form method="post" enctype="multipart/form-data">'.
          '<h3>'.&mt('Upload a Photo').'</h3>'.           '<h3>'.&mt('Upload a Photo').'</h3>'.
          '<input type="file" name="uploaddoc" size="50">'.           '<input type="file" name="uploaddoc" size="50">'.
          '<input type="submit" name="storeupl" value="Upload">'.           '<input type="submit" name="storeupl" value="Upload">'.
  '</form><form method="post">');   '</form><form method="post">');
   
        }         }
        foreach (sort keys %syllabusfields) {         foreach (sort keys %syllabusfields) {
           if (($syllabus{$_}) || ($allowed)) {            if (($syllabus{$_}) || ($allowed)) {

Removed from v.1.31  
changed lines
  Added in v.1.32


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>