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

raeburn raeburn at source.lon-capa.org
Fri Apr 27 17:39:42 EDT 2018


raeburn		Fri Apr 27 21:39:42 2018 EDT

  Modified files:              
    /loncom/interface	lonpreferences.pm 
  Log:
  - Eliminate duplicate calls to loncommon::end_page().
  
  
Index: loncom/interface/lonpreferences.pm
diff -u loncom/interface/lonpreferences.pm:1.225 loncom/interface/lonpreferences.pm:1.226
--- loncom/interface/lonpreferences.pm:1.225	Fri Apr 27 20:14:16 2018
+++ loncom/interface/lonpreferences.pm	Fri Apr 27 21:39:42 2018
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Preferences
 #
-# $Id: lonpreferences.pm,v 1.225 2018/04/27 20:14:16 raeburn Exp $
+# $Id: lonpreferences.pm,v 1.226 2018/04/27 21:39:42 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1511,7 +1511,7 @@
 }
 
 sub verify_and_change_password {
-    my ($r,$caller,$mailtoken) = @_;
+    my ($r,$caller,$mailtoken,$ended) = @_;
     my ($user,$domain,$homeserver);
     my ($blocked,$blocktext) =
         &Apache::loncommon::blocking_status('passwd');
@@ -1656,6 +1656,9 @@
             $r->print($message.'<br />');
         } else {
             &print_main_menu($r, $message);
+            if (ref($ended)) {
+                $$ended = 1;
+            }
         }
     } else {
 	# error error: run in circles, scream and shout
@@ -1670,6 +1673,9 @@
                 &mt("The password for user [_1] was not changed.",'<i>'.$user.'</i>').' '.&mt('Please make sure your old password was entered correctly.'),1);
             $message=&Apache::loncommon::confirmwrapper($message);
             &print_main_menu($r, $message);
+            if (ref($ended)) {
+                $$ended = 1;
+            }
         }
     }
     return;
@@ -2253,7 +2259,7 @@
                                    ['action','wysiwyg','returnurl','refpage']);
     #
     Apache::lonhtmlcommon::clear_breadcrumbs();
-    my ($brlink,$brtxt,$brhelp);
+    my ($brlink,$brtxt,$brhelp,$ended);
     if (($env{'form.action'} eq 'changerolespref') && ($env{'form.returnurl'} eq '/adm/roles')) {
         $brlink ='/adm/roles';
         $brtxt = 'User Roles';
@@ -2280,14 +2286,16 @@
           help => $brhelp,});
     if(!exists $env{'form.action'}) {
 	&print_main_menu($r);
+        $ended = 1;
     }elsif($env{'form.action'} eq 'changepass'){
         &passwordchanger($r);
     }elsif($env{'form.action'} eq 'verify_and_change_pass'){
-        &verify_and_change_password($r,'preferences');
+        &verify_and_change_password($r,'preferences','',\$ended));
     }elsif($env{'form.action'} eq 'changescreenname'){
         &screennamechanger($r);
     }elsif($env{'form.action'} eq 'verify_and_change_screenname'){
         &verify_and_change_screenname($r);
+        $ended = 1;
     }elsif($env{'form.action'} eq 'changemsgforward'){
         &msgforwardchanger($r);
     }elsif($env{'form.action'} eq 'verify_and_change_msgforward'){
@@ -2296,10 +2304,12 @@
         &colorschanger($r);
     }elsif($env{'form.action'} eq 'verify_and_change_colors'){
         &verify_and_change_colors($r);
+        $ended = 1;
     }elsif($env{'form.action'} eq 'changelanguages'){
         &languagechanger($r);
     }elsif($env{'form.action'} eq 'verify_and_change_languages'){
         &verify_and_change_languages($r);
+        $ended = 1;
     }elsif($env{'form.action'} eq 'changewysiwyg'){
         &wysiwygchanger($r);
     }elsif($env{'form.action'} eq 'set_wysiwyg'){
@@ -2308,10 +2318,12 @@
         &discussionchanger($r);
     }elsif($env{'form.action'} eq 'verify_and_change_discussion'){
         &verify_and_change_discussion($r);
+        $ended = 1;
     }elsif($env{'form.action'} eq 'changerolespref'){
         &rolesprefchanger($r);
     }elsif($env{'form.action'} eq 'verify_and_change_rolespref'){
         &verify_and_change_rolespref($r);
+        $ended = 1;
     }elsif($env{'form.action'} eq 'changetexenginepref'){
         &texenginechanger($r);
     }elsif($env{'form.action'} eq 'verify_and_change_texengine'){
@@ -2320,6 +2332,7 @@
         &iconchanger($r);
     }elsif($env{'form.action'} eq 'verify_and_change_icons'){
         &verify_and_change_icons($r);
+        $ended = 1;
     }elsif($env{'form.action'} eq 'changeclicker'){
         &clickerchanger($r);
     }elsif($env{'form.action'} eq 'verify_and_change_clicker'){
@@ -2328,6 +2341,7 @@
         &domcoordchanger($r);
     }elsif($env{'form.action'} eq 'verify_and_change_domcoord'){
         &verify_and_change_domcoord($r);
+        $ended = 1;
     }elsif($env{'form.action'} eq 'lockwarning'){
         &lockwarning($r);
     }elsif($env{'form.action'} eq 'verify_and_change_locks'){
@@ -2336,6 +2350,7 @@
         &coursedisplaychanger($r);
     }elsif($env{'form.action'} eq 'verify_and_change_coursepage'){
         &verify_and_change_coursepage($r);
+        $ended = 1;
     }elsif($env{'form.action'} eq 'authorsettings'){
         &author_space_settings($r);
     }elsif($env{'form.action'} eq 'change_authoring_settings'){
@@ -2345,17 +2360,18 @@
             &toggle_debug();
         }
 	&print_main_menu($r);
+        $ended = 1;
     } elsif ($env{'form.action'} eq 'changelockednames') {
         &lockednameschanger($r);
     } elsif ($env{'form.action'} eq 'verify_and_change_lockednames') {
         &verify_and_change_lockednames($r);
+        $ended = 1;
     }
 
     # Properly end the HTML page of all preference pages
     # started in each sub routine
     # Exception: print_main_menu has its own end_page call
-    unless (!exists $env{'form.action'} ||
-            $env{'form.action'} eq 'debugtoggle') {
+    unless ($ended) {
         $r->print(&Apache::loncommon::end_page());
     }
 




More information about the LON-CAPA-cvs mailing list