Diff for /loncom/lond between versions 1.396 and 1.398

version 1.396, 2008/02/24 22:59:06 version 1.398, 2008/03/08 03:17:38
Line 3446  sub dump_course_id_handler { Line 3446  sub dump_course_id_handler {
     my $userinput = "$cmd:$tail";      my $userinput = "$cmd:$tail";
   
     my ($udom,$since,$description,$instcodefilter,$ownerfilter,$coursefilter,      my ($udom,$since,$description,$instcodefilter,$ownerfilter,$coursefilter,
         $typefilter,$regexp_ok,$rtn_as_hash) =split(/:/,$tail);          $typefilter,$regexp_ok,$rtn_as_hash,$selfenrollonly) =split(/:/,$tail);
       my $now = time;
     if (defined($description)) {      if (defined($description)) {
  $description=&unescape($description);   $description=&unescape($description);
     } else {      } else {
Line 3496  sub dump_course_id_handler { Line 3497  sub dump_course_id_handler {
     my $hashref = &tie_domain_hash($udom, "nohist_courseids", &GDBM_WRCREAT());      my $hashref = &tie_domain_hash($udom, "nohist_courseids", &GDBM_WRCREAT());
     if ($hashref) {      if ($hashref) {
  while (my ($key,$value) = each(%$hashref)) {   while (my ($key,$value) = each(%$hashref)) {
             my ($unesc_key,$lasttime_key,$lasttime,$is_hash,%val,%unesc_val);              my ($unesc_key,$lasttime_key,$lasttime,$is_hash,%val,
                   %unesc_val,$selfenroll_end,$selfenroll_types);
             $unesc_key = &unescape($key);              $unesc_key = &unescape($key);
             if ($unesc_key =~ /^lasttime:/) {              if ($unesc_key =~ /^lasttime:/) {
                 next;                  next;
Line 3515  sub dump_course_id_handler { Line 3517  sub dump_course_id_handler {
                     $unesc_val{'inst_code'} = $items->{'inst_code'};                      $unesc_val{'inst_code'} = $items->{'inst_code'};
                     $unesc_val{'owner'} = $items->{'owner'};                      $unesc_val{'owner'} = $items->{'owner'};
                     $unesc_val{'type'} = $items->{'type'};                      $unesc_val{'type'} = $items->{'type'};
                       $selfenroll_types = $items->{'selfenroll_types'};
                       $selfenroll_end = $items->{'selfenroll_end_date'};
                       if ($selfenrollonly) {
                           next if (!$selfenroll_types);
                           if (($selfenroll_end > 0) && ($selfenroll_end <= $now)) {
                               next;
                           }
                       }
                 }                  }
             } else {              } else {
                 $is_hash =  0;                  $is_hash =  0;
Line 4703  sub get_institutional_id_rules { Line 4713  sub get_institutional_id_rules {
 }  }
 &register_handler("instidrules",\&get_institutional_id_rules,0,1,0);  &register_handler("instidrules",\&get_institutional_id_rules,0,1,0);
   
 sub get_institutional_selfenroll_rules {  sub get_institutional_selfcreate_rules {
     my ($cmd, $tail, $client)   = @_;      my ($cmd, $tail, $client)   = @_;
     my $userinput               = "$cmd:$tail";      my $userinput               = "$cmd:$tail";
     my $dom = &unescape($tail);      my $dom = &unescape($tail);
Line 4711  sub get_institutional_selfenroll_rules { Line 4721  sub get_institutional_selfenroll_rules {
     my $outcome;      my $outcome;
     eval {      eval {
         local($SIG{__DIE__})='DEFAULT';          local($SIG{__DIE__})='DEFAULT';
         $outcome = &localenroll::selfenroll_rules($dom,\%rules_hash,\@rules_order);          $outcome = &localenroll::selfcreate_rules($dom,\%rules_hash,\@rules_order);
     };      };
     if (!$@) {      if (!$@) {
         if ($outcome eq 'ok') {          if ($outcome eq 'ok') {
Line 4735  sub get_institutional_selfenroll_rules { Line 4745  sub get_institutional_selfenroll_rules {
         &Failure($client,"unknown_cmd\n",$userinput);          &Failure($client,"unknown_cmd\n",$userinput);
     }      }
 }  }
 &register_handler("instemailrules",\&get_institutional_selfenroll_rules,0,1,0);  &register_handler("instemailrules",\&get_institutional_selfcreate_rules,0,1,0);
   
   
 sub institutional_username_check {  sub institutional_username_check {
Line 4796  sub institutional_id_check { Line 4806  sub institutional_id_check {
 }  }
 &register_handler("instidrulecheck",\&institutional_id_check,0,1,0);  &register_handler("instidrulecheck",\&institutional_id_check,0,1,0);
   
 sub institutional_selfenroll_check {  sub institutional_selfcreate_check {
     my ($cmd, $tail, $client)   = @_;      my ($cmd, $tail, $client)   = @_;
     my $userinput               = "$cmd:$tail";      my $userinput               = "$cmd:$tail";
     my %rulecheck;      my %rulecheck;
Line 4807  sub institutional_selfenroll_check { Line 4817  sub institutional_selfenroll_check {
     @rules = map {&unescape($_);} (@rules);      @rules = map {&unescape($_);} (@rules);
     eval {      eval {
         local($SIG{__DIE__})='DEFAULT';          local($SIG{__DIE__})='DEFAULT';
         $outcome = &localenroll::selfenroll_check($udom,$email,\@rules,\%rulecheck);          $outcome = &localenroll::selfcreate_check($udom,$email,\@rules,\%rulecheck);
     };      };
     if (!$@) {      if (!$@) {
         if ($outcome eq 'ok') {          if ($outcome eq 'ok') {
Line 4823  sub institutional_selfenroll_check { Line 4833  sub institutional_selfenroll_check {
         &Failure($client,"unknown_cmd\n",$userinput);          &Failure($client,"unknown_cmd\n",$userinput);
     }      }
 }  }
 &register_handler("instselfenrollcheck",\&institutional_selfenroll_check,0,1,0);  &register_handler("instselfcreatecheck",\&institutional_selfcreate_check,0,1,0);
   
 # Get domain specific conditions for import of student photographs to a course  # Get domain specific conditions for import of student photographs to a course
 #  #

Removed from v.1.396  
changed lines
  Added in v.1.398


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