Diff for /loncom/auth/lonauth.pm between versions 1.101.8.7 and 1.101.8.8

version 1.101.8.7, 2011/09/27 20:18:45 version 1.101.8.8, 2011/09/29 14:05:41
Line 40  use Apache::lonmenu(); Line 40  use Apache::lonmenu();
 use Apache::createaccount;  use Apache::createaccount;
 use Fcntl qw(:flock);  use Fcntl qw(:flock);
 use Apache::lonlocal;  use Apache::lonlocal;
   use Apache::File();
 use HTML::Entities;  use HTML::Entities;
     
 # ------------------------------------------------------------ Successful login  # ------------------------------------------------------------ Successful login
Line 331  sub handler { Line 332  sub handler {
     }      }
   
 # ---------------------------------------------------------------- Authenticate  # ---------------------------------------------------------------- Authenticate
     my @cancreate;  
     my %domconfig = &Apache::lonnet::get_dom('configuration',['usercreation'],$form{'udom'});      my %domconfig = &Apache::lonnet::get_dom('configuration',['usercreation'],$form{'udom'});
     if (ref($domconfig{'usercreation'}) eq 'HASH') {      my ($cancreate,$statustocreate) =
         if (ref($domconfig{'usercreation'}{'cancreate'}) eq 'HASH') {          &Apache::createaccount::get_creation_controls($form{'udom'},$domconfig{'usercreation'});
             if (ref($domconfig{'usercreation'}{'cancreate'}{'selfcreate'}) eq 'ARRAY') {  
                 @cancreate = @{$domconfig{'usercreation'}{'cancreate'}{'selfcreate'}};  
             } elsif (($domconfig{'usercreation'}{'cancreate'}{'selfcreate'} ne 'none') &&   
                      ($domconfig{'usercreation'}{'cancreate'}{'selfcreate'} ne '')) {  
                 @cancreate = ($domconfig{'usercreation'}{'cancreate'}{'selfcreate'});  
             }  
         }  
     }  
     my $defaultauth;      my $defaultauth;
     if (grep(/^login$/,@cancreate)) {      if (ref($cancreate) eq 'ARRAY') {
         $defaultauth = 1;          if (grep(/^login$/,@{$cancreate})) {
               $defaultauth = 1;
           }
     }      }
     my $clientcancheckhost = 1;      my $clientcancheckhost = 1;
     my $authhost=Apache::lonnet::authenticate($form{'uname'},$upass,      my $authhost=Apache::lonnet::authenticate($form{'uname'},$upass,
Line 359  sub handler { Line 354  sub handler {
  \%form);   \%form);
         return OK;          return OK;
     } elsif ($authhost eq 'no_account_on_host') {      } elsif ($authhost eq 'no_account_on_host') {
         my %domconfig =           if ($defaultauth) {
             &Apache::lonnet::get_dom('configuration',['usercreation'],$form{'udom'});  
         if (grep(/^login$/,@cancreate)) {  
             my $domdesc = &Apache::lonnet::domain($form{'udom'},'description');              my $domdesc = &Apache::lonnet::domain($form{'udom'},'description');
             unless (&check_can_host($r,\%form,'no_account_on_host',$domdesc)) {              unless (&check_can_host($r,\%form,'no_account_on_host',$domdesc)) {
                 return OK;                       return OK;
             }              }
             my $start_page =               my $start_page = 
                 &Apache::loncommon::start_page('Create a user account in LON-CAPA',                  &Apache::loncommon::start_page('Create a user account in LON-CAPA',
Line 375  sub handler { Line 368  sub handler {
                 &Apache::loncommon::build_recipient_list(undef,'helpdeskmail',                  &Apache::loncommon::build_recipient_list(undef,'helpdeskmail',
                                                         $form{'udom'},$origmail);                                                          $form{'udom'},$origmail);
             my ($contact_email) = split(',',$contacts);               my ($contact_email) = split(',',$contacts); 
             my $output = &Apache::createaccount::username_check($form{'uname'},               my $output =
                                                                 $form{'udom'},$domdesc,'',                  &Apache::createaccount::username_check($form{'uname'},$form{'udom'},
                                                                 $lonhost,$contact_email,$contact_name);                                                         $domdesc,'',$lonhost,
                                                          $contact_email,$contact_name,
                                                          undef,$statustocreate);
             &Apache::loncommon::content_type($r,'text/html');              &Apache::loncommon::content_type($r,'text/html');
             $r->send_http_header;              $r->send_http_header;
             &Apache::createaccount::print_header($r,$start_page);              &Apache::createaccount::print_header($r,$start_page);

Removed from v.1.101.8.7  
changed lines
  Added in v.1.101.8.8


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