[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface lonpreferences.pm

raeburn raeburn at source.lon-capa.org
Thu Jul 4 19:13:07 EDT 2024


raeburn		Thu Jul  4 23:13:07 2024 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	lonpreferences.pm 
  Log:
  - For 2.11
    backport 1.240
  
  
Index: loncom/interface/lonpreferences.pm
diff -u loncom/interface/lonpreferences.pm:1.196.4.28 loncom/interface/lonpreferences.pm:1.196.4.29
--- loncom/interface/lonpreferences.pm:1.196.4.28	Tue Dec 14 00:30:54 2021
+++ loncom/interface/lonpreferences.pm	Thu Jul  4 23:13:07 2024
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Preferences
 #
-# $Id: lonpreferences.pm,v 1.196.4.28 2021/12/14 00:30:54 raeburn Exp $
+# $Id: lonpreferences.pm,v 1.196.4.29 2024/07/04 23:13:07 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2094,13 +2094,9 @@
 
 sub lockednameschanger {
     my $r = shift;
-    &Apache::lonhtmlcommon::add_breadcrumb(
-            {   href => '/adm/preferences?action=changelockednames',
-                text => 'Automatic name changes'});
-    $r->print(Apache::loncommon::start_page('Automatic name changes'));
-    $r->print(Apache::lonhtmlcommon::breadcrumbs('Allow/disallow name updates'));
     my %userenv = &Apache::lonnet::get('environment',['lockedname']);
     my $lockedname='';
+    my $ended;
     if (&can_toggle_namelocking()) {
         if ($userenv{'lockedname'}) {
             $lockedname = ' checked="checked"';
@@ -2118,6 +2114,11 @@
             }
         }
         if (keys(%updateable)) {
+            &Apache::lonhtmlcommon::add_breadcrumb(
+                {   href => '/adm/preferences?action=changelockednames',
+                    text => 'Automatic name changes'});
+            $r->print(Apache::loncommon::start_page('Automatic name changes'));
+            $r->print(Apache::lonhtmlcommon::breadcrumbs('Allow/disallow name updates'));
             my %longnames = &Apache::lonlocal::texthash (
                                 firstname  => 'First Name',
                                 middlename => 'Middle Name',
@@ -2144,11 +2145,14 @@
         } else {
             my $message = &mt('Based on your institutional affiliation no name information is automatically updated for your LON-CAPA account.');
             &print_main_menu($r,$message);
+            $ended = 1;
         }
     } else {
         my $message = &mt('You are not permitted to set a user preference for automatic name updates for your LON-CAPA account.');
         &print_main_menu($r,$message);
+        $ended = 1;
     }
+    return $ended;
 }
 
 sub verify_and_change_lockednames {
@@ -2508,7 +2512,7 @@
 	&print_main_menu($r);
         $ended = 1;
     } elsif ($env{'form.action'} eq 'changelockednames') {
-        &lockednameschanger($r);
+        $ended = &lockednameschanger($r);
     } elsif ($env{'form.action'} eq 'verify_and_change_lockednames') {
         &verify_and_change_lockednames($r);
         $ended = 1;




More information about the LON-CAPA-cvs mailing list