--- loncom/lond 2024/07/01 14:58:42 1.489.2.46 +++ loncom/lond 2024/12/29 16:44:03 1.489.2.47 @@ -2,7 +2,7 @@ # The LearningOnline Network # lond "LON Daemon" Server (port "LOND" 5663) # -# $Id: lond,v 1.489.2.46 2024/07/01 14:58:42 raeburn Exp $ +# $Id: lond,v 1.489.2.47 2024/12/29 16:44:03 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -63,7 +63,7 @@ my $DEBUG = 0; # Non zero to ena my $status=''; my $lastlog=''; -my $VERSION='$Revision: 1.489.2.46 $'; #' stupid emacs +my $VERSION='$Revision: 1.489.2.47 $'; #' stupid emacs my $remoteVERSION; my $currenthostid="default"; my $currentdomainid; @@ -5491,12 +5491,13 @@ sub enrollment_enabled_handler { my ($cmd, $tail, $client) = @_; my $userinput = $cmd.":".$tail; # For logging purposes. - my ($cdom) = split(/:/, $tail, 2); # Domain we're asking about. - - my $outcome = &localenroll::run($cdom); + my $outcome; + eval { + local($SIG{__DIE__})='DEFAULT'; + $outcome = &localenroll::run($cdom); + }; &Reply($client, \$outcome, $userinput); - return 1; } ®ister_handler("autorun", \&enrollment_enabled_handler, 0, 1, 0); @@ -5529,8 +5530,12 @@ sub validate_instcode_handler { my ($dom,$instcode,$owner) = split(/:/, $tail); $instcode = &unescape($instcode); $owner = &unescape($owner); - my ($outcome,$description,$credits) = - &localenroll::validate_instcode($dom,$instcode,$owner); + my ($outcome,$description,$credits); + eval { + local($SIG{__DIE__})='DEFAULT'; + ($outcome,$description,$credits) = + &localenroll::validate_instcode($dom,$instcode,$owner); + }; my $result = &escape($outcome).'&'.&escape($description).'&'. &escape($credits); &Reply($client, \$result, $userinput); @@ -5564,10 +5569,14 @@ sub validate_instcrosslist_handler { $instcode = &unescape($instcode); $inst_xlist = &unescape($inst_xlist); $coowner = &unescape($coowner); - my $outcome = &localenroll::validate_crosslist_access($dom,$instcode, - $inst_xlist,$coowner); - &Reply($client, \$outcome, $userinput); + my $outcome; + eval { + local($SIG{__DIE__})='DEFAULT'; + $outcome = &localenroll::validate_crosslist_access($dom,$instcode, + $inst_xlist,$coowner); + }; + &Reply($client, \$outcome, $userinput); return 1; } ®ister_handler("autovalidateinstcrosslist", \&validate_instcrosslist_handler, 0, 1, 0); @@ -5590,12 +5599,13 @@ sub get_sections_handler { my $userinput = "$cmd:$tail"; my ($coursecode, $cdom) = split(/:/, $tail); - my @secs = &localenroll::get_sections($coursecode,$cdom); - my $seclist = &escape(join(':',@secs)); - + my $seclist; + eval { + local($SIG{__DIE__})='DEFAULT'; + my @secs = &localenroll::get_sections($coursecode,$cdom); + $seclist = &escape(join(':',@secs)); + }; &Reply($client, \$seclist, $userinput); - - return 1; } ®ister_handler("autogetsections", \&get_sections_handler, 0, 1, 0); @@ -5615,6 +5625,7 @@ sub get_sections_handler { # Returns: # 1 - Processing should continue. # + sub validate_course_owner_handler { my ($cmd, $tail, $client) = @_; my $userinput = "$cmd:$tail"; @@ -5622,11 +5633,12 @@ sub validate_course_owner_handler { $owner = &unescape($owner); $coowners = &unescape($coowners); - my $outcome = &localenroll::new_course($inst_course_id,$owner,$cdom,$coowners); + my $outcome; + eval { + local($SIG{__DIE__})='DEFAULT'; + $outcome = &localenroll::new_course($inst_course_id,$owner,$cdom,$coowners); + }; &Reply($client, \$outcome, $userinput); - - - return 1; } ®ister_handler("autonewcourse", \&validate_course_owner_handler, 0, 1, 0); @@ -5652,11 +5664,12 @@ sub validate_course_section_handler { my ($cmd, $tail, $client) = @_; my $userinput = "$cmd:$tail"; my ($inst_course_id, $cdom) = split(/:/, $tail); - - my $outcome=&localenroll::validate_courseID($inst_course_id,$cdom); + my $outcome; + eval { + local($SIG{__DIE__})='DEFAULT'; + $outcome=&localenroll::validate_courseID($inst_course_id,$cdom); + }; &Reply($client, \$outcome, $userinput); - - return 1; } ®ister_handler("autovalidatecourse", \&validate_course_section_handler, 0, 1, 0); @@ -5823,10 +5836,12 @@ sub create_auto_enroll_password_handler my ($authparam, $cdom) = split(/:/, $userinput); my ($create_passwd,$authchk); - ($authparam, - $create_passwd, - $authchk) = &localenroll::create_password($authparam,$cdom); - + eval { + local($SIG{__DIE__})='DEFAULT'; + ($authparam, + $create_passwd, + $authchk) = &localenroll::create_password($authparam,$cdom); + }; &Reply($client, &escape($authparam.':'.$create_passwd.':'.$authchk)."\n", $userinput); @@ -6062,12 +6077,16 @@ sub get_institutional_code_format_handle my ($key,$value) = split/=/,$_; $instcodes{&unescape($key)} = &unescape($value); } - my $formatreply = &localenroll::instcode_format($cdom, - \%instcodes, - \%codes, - \@codetitles, - \%cat_titles, - \%cat_order); + my $formatreply; + eval { + local($SIG{__DIE__})='DEFAULT'; + $formatreply = &localenroll::instcode_format($cdom, + \%instcodes, + \%codes, + \@codetitles, + \%cat_titles, + \%cat_order); + }; if ($formatreply eq 'ok') { my $codes_str = &Apache::lonnet::hash2str(%codes); my $codetitles_str = &Apache::lonnet::array2str(@codetitles); @@ -6127,11 +6146,15 @@ sub get_possible_instcodes_handler { my $reply; my $cdom = $tail; my (@codetitles,%cat_titles,%cat_order,@code_order); - my $formatreply = &localenroll::possible_instcodes($cdom, - \@codetitles, - \%cat_titles, - \%cat_order, - \@code_order); + my $formatreply; + eval { + local($SIG{__DIE__})='DEFAULT'; + $formatreply = &localenroll::possible_instcodes($cdom, + \@codetitles, + \%cat_titles, + \%cat_order, + \@code_order); + }; if ($formatreply eq 'ok') { my $result = join('&',map {&escape($_);} (@codetitles)).':'; $result .= join('&',map {&escape($_);} (@code_order)).':';