Diff for /loncom/lond between versions 1.421 and 1.424

version 1.421, 2009/08/16 21:49:21 version 1.424, 2009/08/22 19:52:08
Line 4870  sub enrollment_enabled_handler { Line 4870  sub enrollment_enabled_handler {
 &register_handler("autorun", \&enrollment_enabled_handler, 0, 1, 0);  &register_handler("autorun", \&enrollment_enabled_handler, 0, 1, 0);
   
 #  #
 #   Validate an institutional code use for a LON-CAPA course.            #   Validate an institutional code used for a LON-CAPA course.          
 #  #
 # Formal Parameters:  # Formal Parameters:
 #   $cmd          - The command request that got us dispatched.  #   $cmd          - The command request that got us dispatched.
 #   $tail         - The tail of the command.  In this case,  #   $tail         - The tail of the command.  In this case,
 #                   this is a colon separated set of words that will be split  #                   this is a colon separated set of words that will be split
 #                   into:  #                   into:
 #                        $inst_course_id - The institutional cod3 from the  #                        $dom      - The domain for which the check of 
 #                                          institutions point of view.  #                                    institutional course code will occur.
 #                        $cdom           - The domain from the institutions  #
 #                                          point of view.  #                        $instcode - The institutional code for the course
   #                                    being requested, or validated for rights
   #                                    to request.
   #
   #                        $owner    - The course requestor (who will be the
   #                                    course owner, in the form username:domain
   #
 #   $client       - Socket open on the client.  #   $client       - Socket open on the client.
 # Returns:  # Returns:
 #    1           - Indicating processing should continue.  #    1           - Indicating processing should continue.
Line 4889  sub validate_instcode_handler { Line 4895  sub validate_instcode_handler {
     my ($cmd, $tail, $client) = @_;      my ($cmd, $tail, $client) = @_;
     my $userinput = "$cmd:$tail";      my $userinput = "$cmd:$tail";
     my ($dom,$instcode,$owner) = split(/:/, $tail);      my ($dom,$instcode,$owner) = split(/:/, $tail);
       $instcode = &unescape($instcode);
       $owner = &unescape($owner);
     my $outcome=&localenroll::validate_instcode($dom,$instcode,$owner);      my $outcome=&localenroll::validate_instcode($dom,$instcode,$owner);
     &Reply($client, \$outcome, $userinput);      &Reply($client, \$outcome, $userinput);
   
Line 5099  sub retrieve_auto_file_handler { Line 5107  sub retrieve_auto_file_handler {
 }  }
 &register_handler("autoretrieve", \&retrieve_auto_file_handler, 0,1,0);  &register_handler("autoretrieve", \&retrieve_auto_file_handler, 0,1,0);
   
   sub crsreq_checks_handler {
       my ($cmd, $tail, $client) = @_;
       my $userinput = "$cmd:$tail";
       my $dom = $tail;
       my $result;
       my @reqtypes = ('official','unofficial','community');
       eval {
           local($SIG{__DIE__})='DEFAULT';
           my %validations;
           my $response = &localenroll::crsreq_checks($dom,\@reqtypes,
                                                      \%validations);
           if ($response eq 'ok') { 
               foreach my $key (keys(%validations)) {
                   $result .= &escape($key).'='.&Apache::lonnet::freeze_escape($validations{$key}).'&';
               }
               $result =~ s/\&$//;
           } else {
               $result = 'error';
           }
       };
       if (!$@) {
           &Reply($client, \$result, $userinput);
       } else {
           &Failure($client,"unknown_cmd\n",$userinput);
       }
       return 1;
   }
   &register_handler("autocrsreqchecks", \&crsreq_checks_handler, 0, 1, 0);
   
   sub validate_crsreq_handler {
       my ($cmd, $tail, $client) = @_;
       my $userinput = "$cmd:$tail";
       my ($dom,$owner,$crstype,$inststatuslist,$instcode,$instseclist) = split(/:/, $tail);
       $instcode = &unescape($instcode);
       $owner = &unescape($owner);
       $crstype = &unescape($crstype);
       $inststatuslist = &unescape($inststatuslist);
       $instcode = &unescape($instcode);
       $instseclist = &unescape($instseclist);
       my $outcome;
       eval {
           local($SIG{__DIE__})='DEFAULT';
           $outcome = &localenroll::validate_crsreq($dom,$owner,$crstype,
                                                    $inststatuslist,$instcode,
                                                    $instseclist);
       };
       if (!$@) {
           &Reply($client, \$outcome, $userinput);
       } else {
           &Failure($client,"unknown_cmd\n",$userinput);
       }
       return 1;
   }
   &register_handler("autocrsreqvalidation", \&validate_crsreq_handler, 0, 1, 0);
   
 #  #
 #   Read and retrieve institutional code format (for support form).  #   Read and retrieve institutional code format (for support form).
 # Formal Parameters:  # Formal Parameters:

Removed from v.1.421  
changed lines
  Added in v.1.424


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