Diff for /loncom/interface/lonaboutme.pm between versions 1.30 and 1.33

version 1.30, 2004/08/25 18:08:11 version 1.33, 2004/12/02 18:53:13
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 153  ENDDOCUMENT Line 158  ENDDOCUMENT
        if ($syllabus{'uploaded.photourl'}) {         if ($syllabus{'uploaded.photourl'}) {
    &Apache::lonnet::allowuploaded('/adm/aboutme',     &Apache::lonnet::allowuploaded('/adm/aboutme',
   $syllabus{'uploaded.photourl'});    $syllabus{'uploaded.photourl'});
    my $image='<img src="'.$syllabus{'uploaded.photourl'}.'"     my $image=
                            align="right" />';                 qq{<img src="$syllabus{'uploaded.photourl'}" align="right" />};
    if ($target eq 'tex') {     if ($target eq 'tex') {
        $image=&Apache::lonxml::xmlparse($r,'tex',$image);         $image=&Apache::lonxml::xmlparse($r,'tex',$image);
    }     }
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)) {
Line 209  ENDDOCUMENT Line 218  ENDDOCUMENT
                           &mt('Shared by course faculty and staff').                            &mt('Shared by course faculty and staff').
                           &Apache::loncommon::help_open_topic("Course_Face_To_Face_Records,Course_Critical_Message").                            &Apache::loncommon::help_open_topic("Course_Face_To_Face_Records,Course_Critical_Message").
 '<br />');  '<br />');
     &Apache::lonmsg::disfacetoface($r,$cnum,$cdom);                  &Apache::lonmsg::disfacetoface($r,$cnum,$cdom);
             $r->print(&Apache::loncommon::noteswrapper('Add Records',$cnum,$cdom));                  $r->print('<hr />');
                   if (&Apache::lonnet::allowed('vsa',
                                                $ENV{'request.course.id'}) ||
                       &Apache::lonnet::allowed('vsa',
                                                $ENV{'request.course.id'}.'/'.
                                                $ENV{'request.course.sec'})) {
                       $r->print(&Apache::loncommon::track_student_link
                                 ('View recent activity by this student',
                                  $cnum,$cdom).('&nbsp;'x2));
                   }
                   $r->print(&Apache::loncommon::noteswrapper('Add Records',$cnum,$cdom));
     } else {      } 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').'\\\\\\\\');   $r->print('\\\\\textbf{'.&mt('User Notes, Records of Face-To-Face Discussions, and Critical Messages in Course').'}\\\\'.&mt('Shared by course faculty and staff').'\\\\\\\\');
  &Apache::lonmsg::disfacetoface($r,$cnum,$cdom);   &Apache::lonmsg::disfacetoface($r,$cnum,$cdom);

Removed from v.1.30  
changed lines
  Added in v.1.33


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