--- loncom/interface/lonpreferences.pm 2016/09/19 03:19:12 1.224 +++ loncom/interface/lonpreferences.pm 2019/04/24 01:44:30 1.228 @@ -1,7 +1,7 @@ # The LearningOnline Network # Preferences # -# $Id: lonpreferences.pm,v 1.224 2016/09/19 03:19:12 raeburn Exp $ +# $Id: lonpreferences.pm,v 1.228 2019/04/24 01:44:30 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -477,7 +477,6 @@ sub verify_and_change_rolespref { } - ################################################################ # Anonymous Discussion Name Change Subroutines # ################################################################ @@ -757,8 +756,10 @@ sub domcoordchanger { my $text=&mt('By default, the Domain Coordinator can enter your Authoring Space.'); my $construction=&mt('Block access to Authoring Space'); my $change=&mt('Save'); + my $returnurl = &HTML::Entities::encode($env{'form.returnurl'},'"<>&\''); $r->print(< + $text

@@ -783,7 +784,11 @@ sub verify_and_change_domcoord { } my $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]',''.&mt('Block access to Authoring Space').'',''.$status.'')); $message=&Apache::loncommon::confirmwrapper($message); - &print_main_menu($r,$message); + if ($env{'form.returnurl'}) { + &do_redirect($r,$env{'form.returnurl'},$message); + } else { + &print_main_menu($r,$message); + } } ################################################################# @@ -1258,7 +1263,7 @@ sub verify_and_change_colors { # password handler subroutines # ###################################################### sub passwordchanger { - my ($r,$errormessage,$caller,$mailtoken) = @_; + my ($r,$errormessage,$caller,$mailtoken,$timelimit,$extrafields) = @_; # This function is a bit of a mess.... # Passwords are encrypted using londes.js (DES encryption) $errormessage = ($errormessage || ''); @@ -1294,7 +1299,7 @@ sub passwordchanger { return; } if (defined($data{time})) { - if (time - $data{'time'} < 7200) { + if (time - $data{'time'} < $timelimit) { $user = $data{'username'}; $domain = $data{'domain'}; $currentpass = $data{'temppasswd'}; @@ -1357,7 +1362,7 @@ sub passwordchanger { my $jsh=Apache::File->new($include."/londes.js"); $r->print(<$jsh>); } - $r->print(&jscript_send($caller)); + $r->print(&jscript_send($caller,$extrafields)); $r->print(< ENDFORM - $r->print(&server_form($logtoken,$caller,$mailtoken)); - $r->print(&client_form($caller,\%hexkey,$currentpass,$domain)); + $r->print(&server_form($logtoken,$caller,$mailtoken,$extrafields)); + $r->print(&client_form($caller,\%hexkey,$currentpass,$domain,$extrafields)); # return; } sub jscript_send { - my ($caller) = @_; + my ($caller,$extrafields) = @_; my $output = qq|