--- loncom/interface/lonpreferences.pm 2018/04/27 20:14:16 1.225
+++ loncom/interface/lonpreferences.pm 2018/04/27 22:42:20 1.227
@@ -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.227 2018/04/27 22:42:20 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1511,7 +1511,7 @@ sub server_form {
}
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 @@ ENDERROR
$r->print($message.'
');
} else {
&print_main_menu($r, $message);
+ if (ref($ended)) {
+ $$ended = 1;
+ }
}
} else {
# error error: run in circles, scream and shout
@@ -1670,6 +1673,9 @@ ENDERROR
&mt("The password for user [_1] was not changed.",''.$user.'').' '.&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 @@ sub handler {
['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 @@ sub handler {
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,38 +2304,47 @@ sub handler {
&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'){
&verify_and_change_wysiwyg($r);
+ $ended = 1;
}elsif($env{'form.action'} eq 'changediscussions'){
&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'){
&verify_and_change_texengine($r);
+ $ended = 1;
}elsif($env{'form.action'} eq 'changeicons'){
&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'){
&verify_and_change_clicker($r);
+ $ended = 1;
}elsif($env{'form.action'} eq 'changedomcoord'){
&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,26 +2353,29 @@ sub handler {
&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'){
&change_authoring_settings($r);
+ $ended = 1;
}elsif($env{'form.action'} eq 'debugtoggle'){
if (&can_toggle_debug()) {
&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());
}