[LON-CAPA-cvs] cvs: loncom /interface lonaboutme.pm lonblockingmenu.pm lonblockingstatus.pm loncommon.pm lonmenu.pm /misc releaseslist.xml

raeburn raeburn at source.lon-capa.org
Sat Jan 2 16:07:36 EST 2021


raeburn		Sat Jan  2 21:07:36 2021 EDT

  Modified files:              
    /loncom/interface	lonaboutme.pm lonblockingmenu.pm 
                     	lonblockingstatus.pm loncommon.pm lonmenu.pm 
    /loncom/misc	releaseslist.xml 
  Log:
  - Blocking of user actions in a course during an exam can include access to
    "About Me" pages belonging to users in the course (course personnel with
    evb priv are exempt).
  
  
-------------- next part --------------
Index: loncom/interface/lonaboutme.pm
diff -u loncom/interface/lonaboutme.pm:1.159 loncom/interface/lonaboutme.pm:1.160
--- loncom/interface/lonaboutme.pm:1.159	Fri Dec 18 15:23:02 2020
+++ loncom/interface/lonaboutme.pm	Sat Jan  2 21:07:36 2021
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Personal Information Page
 #
-# $Id: lonaboutme.pm,v 1.159 2020/12/18 15:23:02 raeburn Exp $
+# $Id: lonaboutme.pm,v 1.160 2021/01/02 21:07:36 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -240,6 +240,17 @@
         my $start_page = &Apache::loncommon::start_page('Personal Information Page',$rss_link,$args);
         $r->print($start_page);
    }
+   my ($blocked,$blocktext) =
+       &Apache::loncommon::blocking_status('about',$cnum,$cdom);
+   if ($blocked) {
+       if ($target eq 'tex') {
+           $r->print('\noindent{\large\textbf{'.&mt('No user personal information page available').'}}\\\\\\\\');
+       } else {
+           $r->print($blocktext);
+       }
+       $r->print(&Apache::loncommon::end_page());
+       return OK;
+   }
 
 #----------------Print Privacy note (edit mode) or last modified date. 
 
Index: loncom/interface/lonblockingmenu.pm
diff -u loncom/interface/lonblockingmenu.pm:1.28 loncom/interface/lonblockingmenu.pm:1.29
--- loncom/interface/lonblockingmenu.pm:1.28	Tue Sep 22 12:19:15 2020
+++ loncom/interface/lonblockingmenu.pm	Sat Jan  2 21:07:36 2021
@@ -2,7 +2,7 @@
 # Routines for configuring blocking of access to collaborative functions, 
 # and specific resources during an exam
 #
-# $Id: lonblockingmenu.pm,v 1.28 2020/09/22 12:19:15 raeburn Exp $
+# $Id: lonblockingmenu.pm,v 1.29 2021/01/02 21:07:36 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -618,7 +618,7 @@
             '<ul>'."\n".
             '<li>'.&mt("displaying LON-CAPA messages sent by other $usertype in the $lctype").'</li>'."\n".
             '<li>'.&mt("displaying or posting to LON-CAPA discussion boards or live chat in the $lctype").'</li>'."\n".
-            '<li>'.&mt('accessing content in LON-CAPA portfolios or blogs').'</li>'."\n".
+            '<li>'.&mt('accessing content in LON-CAPA portfolios, blogs, or user information pages').'</li>'."\n".
             '<li>'.&mt("generating printouts of $lctype content").'</li>'.
             '<li>'.&mt("displaying the LON-CAPA gradebook in the $lctype").'</li>'.
             '<li>'.&mt("searching $lctype content by keyword").'</li>'.  
@@ -1655,6 +1655,7 @@
         'port' => 'Portfolio',
         'groups' => 'Groups',
         'blogs' => 'Blogs',
+        'about' => 'User Information',
         'docs' => 'Content',
         'printout' => 'Printouts',
         'passwd' => 'Change Password',
@@ -1663,7 +1664,7 @@
         'alert'  => 'Critical Alert',
         'reinit' => 'Course Re-init',
     );
-    my $typeorder = ['com','chat','boards','port','groups','blogs','printout','docs','grades','search','alert','reinit','passwd'];
+    my $typeorder = ['com','chat','boards','port','groups','blogs','about','printout','docs','grades','search','alert','reinit','passwd'];
     return ($typeorder,\%types);
 }
 
Index: loncom/interface/lonblockingstatus.pm
diff -u loncom/interface/lonblockingstatus.pm:1.18 loncom/interface/lonblockingstatus.pm:1.19
--- loncom/interface/lonblockingstatus.pm:1.18	Tue Sep 29 19:29:51 2020
+++ loncom/interface/lonblockingstatus.pm	Sat Jan  2 21:07:36 2021
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # displays the blocking status table
 #
-# $Id: lonblockingstatus.pm,v 1.18 2020/09/29 19:29:51 raeburn Exp $
+# $Id: lonblockingstatus.pm,v 1.19 2021/01/02 21:07:36 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -44,7 +44,7 @@
     return OK if $r->header_only;
 
     my (%activities,$activity,$origurl,$origsymb);
-    map { $activities{$_} = 1; } ('boards','chat','com','blogs','groups','port','printout','docs','grades','passwd','search');
+    map { $activities{$_} = 1; } ('boards','chat','com','blogs','about','groups','port','printout','docs','grades','passwd','search');
 
     # determine what kind of blocking we want details for
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['activity','url','symb']);
@@ -84,7 +84,7 @@
     # we're trying to look at. This information is passed via query string.
     my ($uname, $udom);
 
-    if (($activity eq 'port') ||
+    if (($activity eq 'port') || ($activity eq 'about') ||
         (($activity eq 'passwd') && ($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public'))) {
         &Apache::loncommon::get_unprocessed_cgi(
             $ENV{'QUERY_STRING'}, ['udom', 'uname'] );
@@ -96,6 +96,11 @@
                        &mt('Information about the owner of the portfolio files you were trying to view was missing or invalid.').
                        '</span><br />'.
                        &mt('Without valid owner information, the reason why access is blocked can not be determined');
+            } elsif ($activity eq 'about') {
+                return '<span class="LC_error">'.
+                       &mt('The username and/or domain for the User Information page you were trying to view was missing or invalid.').
+                       '</span><br />'.
+                       &mt('Without valid information, the reason why access is blocked can not be determined');
             } else {
                 return '<span class="LC_error">'.
                        &mt('Information about the username and/or domain for which you were trying to reset a password was missing or invalid.').
@@ -151,6 +156,7 @@
                    chat       => 'Chat Room',
                    com        => 'This message',
                    blogs      => 'Blogs',
+                   about      => 'User information pages',
                    groups     => 'Groups in this course',
                    printout   => 'Printout generation',
                    docs       => 'Course Content',
@@ -189,7 +195,8 @@
                          . ' access to selected '.$description.' is being blocked.'
                          ,$showstart, $showend);
         } elsif (($activity eq 'printout') || ($activity eq 'passwd') ||
-                 ($activity eq 'grades') || ($activity eq 'search')) {
+                 ($activity eq 'grades') || ($activity eq 'search') ||
+                 ($activity eq 'about')) {
             $output = mt( $description
                           . ' will be unavailable between [_1] and [_2] because'
                           . ' this functionality is being blocked.'
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1350 loncom/interface/loncommon.pm:1.1351
--- loncom/interface/loncommon.pm:1.1350	Fri Dec 18 15:23:02 2020
+++ loncom/interface/loncommon.pm	Sat Jan  2 21:07:36 2021
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1350 2020/12/18 15:23:02 raeburn Exp $
+# $Id: loncommon.pm,v 1.1351 2021/01/02 21:07:36 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -5519,8 +5519,8 @@
 
 # build a link to a popup window containing the details
     my $querystring  = "?activity=$activity";
-# $uname and $udom decide whose portfolio the user is trying to look at
-    if (($activity eq 'port') || ($activity eq 'passwd')) {
+# $uname and $udom decide whose portfolio (or information page) the user is trying to look at
+    if (($activity eq 'port') || ($activity eq 'about') || ($activity eq 'passwd')) {
         $querystring .= "&udom=$udom"      if ($udom =~ /^$match_domain$/); 
         $querystring .= "&uname=$uname"    if ($uname =~ /^$match_username$/);
     } elsif ($activity eq 'docs') {
@@ -5562,6 +5562,8 @@
         $text = &mt('Checking Critical Messages Blocked');
     } elsif ($activity eq 'reinit') {
         $text = &mt('Checking Course Update Blocked');
+    } elsif ($activity eq 'about') {
+        $text = &mt('Access to User Information Pages Blocked');
     }
     $output .= <<"END_BLOCK";
 <div class='$class'>
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.503 loncom/interface/lonmenu.pm:1.504
--- loncom/interface/lonmenu.pm:1.503	Tue Oct  6 21:28:33 2020
+++ loncom/interface/lonmenu.pm	Sat Jan  2 21:07:36 2021
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.503 2020/10/06 21:28:33 raeburn Exp $
+# $Id: lonmenu.pm,v 1.504 2021/01/02 21:07:36 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1283,11 +1283,12 @@
 # Determine whether or not to display 'Edit' or 'View Source' icon/button
 #
     if ($resurl =~ m{^/?adm/($match_domain)/($match_username)/aboutme$}) {
+        my $blocked = &Apache::loncommon::blocking_status('about',$2,$1);
         my $file=&Apache::lonnet::declutter($env{'request.filename'});
         ($cfile,$home,$switchserver,$forceedit,$forceview) =
             &Apache::lonnet::can_edit_resource($file,$cnum,$cdom,
                 &Apache::lonnet::clutter($resurl),$env{'request.symb'},$group);
-        if (($cfile) && ($home ne '') && ($home ne 'no_host')) {
+        if (($cfile) && ($home ne '') && ($home ne 'no_host') && (!$blocked)) {
             $editbutton = &get_editbutton($cfile,$home,$switchserver,
                                           $forceedit,$forceview,$forcereg);
         }
@@ -1400,10 +1401,13 @@
         if ($resurl =~ m{^/?adm/($match_domain)/($match_username)/aboutme$}) {
             my ($sdom,$sname) = ($1,$2);
             unless (&Apache::lonnet::is_course($sdom,$sname)) {
-                &switch('','',6,4,'mail-message-new-22x22.png','Message to user',
-                        '',
-                        "go('/adm/email?compose=individual&recname=$sname&recdom=$sdom')",
-                            'Send message to specific user');
+                my $blocked = &Apache::loncommon::blocking_status('about',$sname,$sdom);
+                unless ($blocked) {
+                    &switch('','',6,4,'mail-message-new-22x22.png','Message to user',
+                            '',
+                            "go('/adm/email?compose=individual&recname=$sname&recdom=$sdom')",
+                                'Send message to specific user');
+                }
             }
             my $hideprivileged = 1;
             if (&Apache::lonnet::in_course($sdom,$sname,$cdom,$cnum,undef,
Index: loncom/misc/releaseslist.xml
diff -u loncom/misc/releaseslist.xml:1.21 loncom/misc/releaseslist.xml:1.22
--- loncom/misc/releaseslist.xml:1.21	Tue Sep 22 12:19:16 2020
+++ loncom/misc/releaseslist.xml	Sat Jan  2 21:07:36 2021
@@ -8,6 +8,7 @@
 <course name="commblock" value="alert">2.12</course>
 <course name="commblock" value="grades">2.12</course>
 <course name="commblock" value="search">2.12</course>
+<course name="commblock" value="about">2.12</course>
 <course name="courserestype" value="exttool">2.12</course>
 <parameter name="type" value="anonsurvey">2.10</parameter>
 <parameter name="type" value="anonsurveycred">2.10</parameter>


More information about the LON-CAPA-cvs mailing list