Diff for /loncom/lond between versions 1.489.2.28.2.2 and 1.489.2.29

version 1.489.2.28.2.2, 2018/04/29 00:45:43 version 1.489.2.29, 2018/04/29 00:40:49
Line 1497  sub ls_handler { Line 1497  sub ls_handler {
     }      }
  } else {   } else {
             unless (($ulsdir =~ m{^/home/httpd/lonUsers/$LONCAPA::match_domain(?:/[\w\-.@]){3}/$LONCAPA::match_name/}) ||              unless (($ulsdir =~ m{^/home/httpd/lonUsers/$LONCAPA::match_domain(?:/[\w\-.@]){3}/$LONCAPA::match_name/}) ||
                     ($ulsdir =~ m{^/home/httpd/html/(?:res|userfiles)/$LONCAPA::match_domain/$LONCAPA::match_name/})) {                      ($ulsdir =~ m{^/home/httpd/html/(?:res|userfiles)/$LONCAPA::match_domain/$LONCAPA::match_name/})) { 
                 &Failure($client,"refused\n",$userinput);                  &Failure($client,"refused\n",$userinput);
                 return 1;                  return 1;
             }              }
Line 3219  sub get_profile_entry { Line 3219  sub get_profile_entry {
 #  #
 #  Parameters:  #  Parameters:
 #     $cmd               - Command keyword of request (eget).  #     $cmd               - Command keyword of request (eget).
 #     $tail              - Tail of the command.  See GetProfileEntry  #     $tail              - Tail of the command.  See GetProfileEntry #                          for more information about this.
 #                          for more information about this.  
 #     $client            - File open on the client.  #     $client            - File open on the client.
 #  Returns:  #  Returns:
 #     1      - Continue processing  #     1      - Continue processing
Line 4568  sub get_domain_handler { Line 4567  sub get_domain_handler {
     my ($cmd, $tail, $client) = @_;      my ($cmd, $tail, $client) = @_;
   
   
     my $userinput = "$cmd:$tail";      my $userinput = "$client:$tail";
   
     my ($udom,$namespace,$what)=split(/:/,$tail,3);  
     chomp($what);  
     if ($namespace =~ /^enc/) {  
         &Failure( $client, "refused\n", $userinput);  
     } else {  
         my @queries=split(/\&/,$what);  
         my $qresult='';  
         my $hashref = &tie_domain_hash($udom, "$namespace", &GDBM_READER());  
         if ($hashref) {  
             for (my $i=0;$i<=$#queries;$i++) {  
                 $qresult.="$hashref->{$queries[$i]}&";  
             }  
             if (&untie_domain_hash($hashref)) {  
                 $qresult=~s/\&$//;  
                 &Reply($client, \$qresult, $userinput);  
             } else {  
                 &Failure( $client, "error: ".($!+0)." untie(GDBM) Failed ".  
                           "while attempting getdom\n",$userinput);  
             }  
         } else {  
             &Failure($client, "error: ".($!+0)." tie(GDBM) Failed ".  
                      "while attempting getdom\n",$userinput);  
         }  
     }  
   
     return 1;  
 }  
 &register_handler("getdom", \&get_domain_handler, 0, 1, 0);  
   
 sub encrypted_get_domain_handler {  
     my ($cmd, $tail, $client) = @_;  
   
     my $userinput = "$cmd:$tail";  
   
     my ($udom,$namespace,$what)=split(/:/,$tail,3);      my ($udom,$namespace,$what)=split(/:/,$tail,3);
     chomp($what);      chomp($what);
Line 4615  sub encrypted_get_domain_handler { Line 4580  sub encrypted_get_domain_handler {
         }          }
         if (&untie_domain_hash($hashref)) {          if (&untie_domain_hash($hashref)) {
             $qresult=~s/\&$//;              $qresult=~s/\&$//;
             if ($cipher) {              &Reply($client, \$qresult, $userinput);
                 my $cmdlength=length($qresult);  
                 $qresult.="         ";  
                 my $encqresult='';  
                 for (my $encidx=0;$encidx<=$cmdlength;$encidx+=8) {  
                     $encqresult.= unpack("H16",  
                                          $cipher->encrypt(substr($qresult,  
                                                                  $encidx,  
                                                                  8)));  
                 }  
                 &Reply( $client, "enc:$cmdlength:$encqresult\n", $userinput);  
             } else {  
                 &Failure( $client, "error:no_key\n", $userinput);  
             }  
         } else {          } else {
             &Failure( $client, "error: ".($!+0)." untie(GDBM) Failed ".              &Failure( $client, "error: ".($!+0)." untie(GDBM) Failed ".
                       "while attempting egetdom\n",$userinput);                        "while attempting getdom\n",$userinput);
         }          }
     } else {      } else {
         &Failure($client, "error: ".($!+0)." tie(GDBM) Failed ".          &Failure($client, "error: ".($!+0)." tie(GDBM) Failed ".
                  "while attempting egetdom\n",$userinput);                   "while attempting getdom\n",$userinput);
     }      }
   
     return 1;      return 1;
 }  }
 &register_handler("egetdom", \&encrypted_get_domain_handler, 1, 1, 0);  &register_handler("getdom", \&get_domain_handler, 0, 1, 0);
   
 #  #
 #  Puts an id to a domains id database.   #  Puts an id to a domains id database. 
Line 5590  sub auto_export_grades_handler { Line 5543  sub auto_export_grades_handler {
     return 1;      return 1;
 }  }
 &register_handler("autoexportgrades", \&auto_export_grades_handler,  &register_handler("autoexportgrades", \&auto_export_grades_handler,
                   1, 1, 0);                    0, 1, 0);
   
   
 #   Retrieve and remove temporary files created by/during autoenrollment.  #   Retrieve and remove temporary files created by/during autoenrollment.

Removed from v.1.489.2.28.2.2  
changed lines
  Added in v.1.489.2.29


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