Diff for /loncom/lond between versions 1.489.2.45 and 1.489.2.47

version 1.489.2.45, 2022/02/27 02:13:24 version 1.489.2.47, 2024/12/29 16:44:03
Line 5491  sub enrollment_enabled_handler { Line 5491  sub enrollment_enabled_handler {
     my ($cmd, $tail, $client) = @_;      my ($cmd, $tail, $client) = @_;
     my $userinput = $cmd.":".$tail; # For logging purposes.      my $userinput = $cmd.":".$tail; # For logging purposes.
   
       
     my ($cdom) = split(/:/, $tail, 2);   # Domain we're asking about.      my ($cdom) = split(/:/, $tail, 2);   # Domain we're asking about.
       my $outcome;
     my $outcome  = &localenroll::run($cdom);      eval {
           local($SIG{__DIE__})='DEFAULT';
           $outcome = &localenroll::run($cdom);
       };
     &Reply($client, \$outcome, $userinput);      &Reply($client, \$outcome, $userinput);
   
     return 1;      return 1;
 }  }
 &register_handler("autorun", \&enrollment_enabled_handler, 0, 1, 0);  &register_handler("autorun", \&enrollment_enabled_handler, 0, 1, 0);
Line 5529  sub validate_instcode_handler { Line 5530  sub validate_instcode_handler {
     my ($dom,$instcode,$owner) = split(/:/, $tail);      my ($dom,$instcode,$owner) = split(/:/, $tail);
     $instcode = &unescape($instcode);      $instcode = &unescape($instcode);
     $owner = &unescape($owner);      $owner = &unescape($owner);
     my ($outcome,$description,$credits) =       my ($outcome,$description,$credits);
         &localenroll::validate_instcode($dom,$instcode,$owner);      eval {
           local($SIG{__DIE__})='DEFAULT';
           ($outcome,$description,$credits) =
               &localenroll::validate_instcode($dom,$instcode,$owner);
       };
     my $result = &escape($outcome).'&'.&escape($description).'&'.      my $result = &escape($outcome).'&'.&escape($description).'&'.
                  &escape($credits);                   &escape($credits);
     &Reply($client, \$result, $userinput);      &Reply($client, \$result, $userinput);
Line 5564  sub validate_instcrosslist_handler  { Line 5569  sub validate_instcrosslist_handler  {
     $instcode = &unescape($instcode);      $instcode = &unescape($instcode);
     $inst_xlist = &unescape($inst_xlist);      $inst_xlist = &unescape($inst_xlist);
     $coowner = &unescape($coowner);      $coowner = &unescape($coowner);
     my $outcome = &localenroll::validate_crosslist_access($dom,$instcode,      my $outcome;
                                                           $inst_xlist,$coowner);      eval {
     &Reply($client, \$outcome, $userinput);          local($SIG{__DIE__})='DEFAULT';
           $outcome = &localenroll::validate_crosslist_access($dom,$instcode,
                                                              $inst_xlist,$coowner);
       };
   
       &Reply($client, \$outcome, $userinput);
     return 1;      return 1;
 }  }
 &register_handler("autovalidateinstcrosslist", \&validate_instcrosslist_handler, 0, 1, 0);  &register_handler("autovalidateinstcrosslist", \&validate_instcrosslist_handler, 0, 1, 0);
Line 5590  sub get_sections_handler { Line 5599  sub get_sections_handler {
     my $userinput = "$cmd:$tail";      my $userinput = "$cmd:$tail";
   
     my ($coursecode, $cdom) = split(/:/, $tail);      my ($coursecode, $cdom) = split(/:/, $tail);
     my @secs = &localenroll::get_sections($coursecode,$cdom);      my $seclist;
     my $seclist = &escape(join(':',@secs));      eval {
           local($SIG{__DIE__})='DEFAULT';
           my @secs = &localenroll::get_sections($coursecode,$cdom);
           $seclist = &escape(join(':',@secs));
       };
     &Reply($client, \$seclist, $userinput);      &Reply($client, \$seclist, $userinput);
       
   
     return 1;      return 1;
 }  }
 &register_handler("autogetsections", \&get_sections_handler, 0, 1, 0);  &register_handler("autogetsections", \&get_sections_handler, 0, 1, 0);
Line 5615  sub get_sections_handler { Line 5625  sub get_sections_handler {
 # Returns:  # Returns:
 #   1        - Processing should continue.  #   1        - Processing should continue.
 #  #
   
 sub validate_course_owner_handler {  sub validate_course_owner_handler {
     my ($cmd, $tail, $client)  = @_;      my ($cmd, $tail, $client)  = @_;
     my $userinput = "$cmd:$tail";      my $userinput = "$cmd:$tail";
Line 5622  sub validate_course_owner_handler { Line 5633  sub validate_course_owner_handler {
           
     $owner = &unescape($owner);      $owner = &unescape($owner);
     $coowners = &unescape($coowners);      $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);      &Reply($client, \$outcome, $userinput);
   
   
   
     return 1;      return 1;
 }  }
 &register_handler("autonewcourse", \&validate_course_owner_handler, 0, 1, 0);  &register_handler("autonewcourse", \&validate_course_owner_handler, 0, 1, 0);
Line 5652  sub validate_course_section_handler { Line 5664  sub validate_course_section_handler {
     my ($cmd, $tail, $client) = @_;      my ($cmd, $tail, $client) = @_;
     my $userinput = "$cmd:$tail";      my $userinput = "$cmd:$tail";
     my ($inst_course_id, $cdom) = split(/:/, $tail);      my ($inst_course_id, $cdom) = split(/:/, $tail);
       my $outcome;
     my $outcome=&localenroll::validate_courseID($inst_course_id,$cdom);      eval {
           local($SIG{__DIE__})='DEFAULT';
           $outcome=&localenroll::validate_courseID($inst_course_id,$cdom);
       };
     &Reply($client, \$outcome, $userinput);      &Reply($client, \$outcome, $userinput);
   
   
     return 1;      return 1;
 }  }
 &register_handler("autovalidatecourse", \&validate_course_section_handler, 0, 1, 0);  &register_handler("autovalidatecourse", \&validate_course_section_handler, 0, 1, 0);
Line 5823  sub create_auto_enroll_password_handler Line 5836  sub create_auto_enroll_password_handler
     my ($authparam, $cdom) = split(/:/, $userinput);      my ($authparam, $cdom) = split(/:/, $userinput);
   
     my ($create_passwd,$authchk);      my ($create_passwd,$authchk);
     ($authparam,      eval {
      $create_passwd,          local($SIG{__DIE__})='DEFAULT';
      $authchk) = &localenroll::create_password($authparam,$cdom);          ($authparam,
            $create_passwd,
            $authchk) = &localenroll::create_password($authparam,$cdom);
       };
     &Reply($client, &escape($authparam.':'.$create_passwd.':'.$authchk)."\n",      &Reply($client, &escape($authparam.':'.$create_passwd.':'.$authchk)."\n",
    $userinput);     $userinput);
   
Line 6062  sub get_institutional_code_format_handle Line 6077  sub get_institutional_code_format_handle
  my ($key,$value) = split/=/,$_;   my ($key,$value) = split/=/,$_;
  $instcodes{&unescape($key)} = &unescape($value);   $instcodes{&unescape($key)} = &unescape($value);
     }      }
     my $formatreply = &localenroll::instcode_format($cdom,      my $formatreply;
     \%instcodes,      eval {
     \%codes,          local($SIG{__DIE__})='DEFAULT';
     \@codetitles,          $formatreply = &localenroll::instcode_format($cdom,
     \%cat_titles,         \%instcodes,
     \%cat_order);       \%codes,
        \@codetitles,
        \%cat_titles,
        \%cat_order);
       };
     if ($formatreply eq 'ok') {      if ($formatreply eq 'ok') {
  my $codes_str = &Apache::lonnet::hash2str(%codes);   my $codes_str = &Apache::lonnet::hash2str(%codes);
  my $codetitles_str = &Apache::lonnet::array2str(@codetitles);   my $codetitles_str = &Apache::lonnet::array2str(@codetitles);
Line 6127  sub get_possible_instcodes_handler { Line 6146  sub get_possible_instcodes_handler {
     my $reply;      my $reply;
     my $cdom = $tail;      my $cdom = $tail;
     my (@codetitles,%cat_titles,%cat_order,@code_order);      my (@codetitles,%cat_titles,%cat_order,@code_order);
     my $formatreply = &localenroll::possible_instcodes($cdom,      my $formatreply;
                                                        \@codetitles,      eval {
                                                        \%cat_titles,          local($SIG{__DIE__})='DEFAULT';
                                                        \%cat_order,          $formatreply = &localenroll::possible_instcodes($cdom,
                                                        \@code_order);                                                          \@codetitles,
                                                           \%cat_titles,
                                                           \%cat_order,
                                                           \@code_order);
       };
     if ($formatreply eq 'ok') {      if ($formatreply eq 'ok') {
         my $result = join('&',map {&escape($_);} (@codetitles)).':';          my $result = join('&',map {&escape($_);} (@codetitles)).':';
         $result .= join('&',map {&escape($_);} (@code_order)).':';          $result .= join('&',map {&escape($_);} (@code_order)).':';
Line 6810  undef $perlvarref; Line 6833  undef $perlvarref;
 # ----------------------------- Make sure this process is running from user=www  # ----------------------------- Make sure this process is running from user=www
 my $wwwid=getpwnam('www');  my $wwwid=getpwnam('www');
 if ($wwwid!=$<) {  if ($wwwid!=$<) {
    my $emailto="$perlvar{'lonAdmEMail'},$perlvar{'lonSysEMail'}";     my $emailto="$perlvar{'lonAdmEMail'} $perlvar{'lonSysEMail'}";
    my $subj="LON: $currenthostid User ID mismatch";     my $subj="LON: $currenthostid User ID mismatch";
    system("echo 'User ID mismatch.  lond must be run as user www.' |".     system("echo 'User ID mismatch.  lond must be run as user www.' |".
           " mail -s '$subj' $emailto > /dev/null");            " mail -s '$subj' $emailto > /dev/null");
Line 8018  sub currentversion { Line 8041  sub currentversion {
     if (-e $ulsdir) {      if (-e $ulsdir) {
  if(-d $ulsdir) {   if(-d $ulsdir) {
     if (opendir(LSDIR,$ulsdir)) {      if (opendir(LSDIR,$ulsdir)) {
                   if (-e $fname) {
                       $version=0;
                   }
  my $ulsfn;   my $ulsfn;
  while ($ulsfn=readdir(LSDIR)) {   while ($ulsfn=readdir(LSDIR)) {
 # see if this is a regular file (ignore links produced earlier)  # see if this is a regular file (ignore links produced earlier)

Removed from v.1.489.2.45  
changed lines
  Added in v.1.489.2.47


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>