Diff for /loncom/interface/createaccount.pm between versions 1.64 and 1.67

version 1.64, 2014/04/23 10:11:26 version 1.67, 2014/05/30 16:46:03
Line 170  sub handler { Line 170  sub handler {
         if (grep(/^sso$/,@{$cancreate})) {          if (grep(/^sso$/,@{$cancreate})) {
             $msg = '<h3>'.&mt('Account creation').'</h3>'.              $msg = '<h3>'.&mt('Account creation').'</h3>'.
                    &mt("Although your username and password were authenticated by your institution's Single Sign On system, you do not currently have a LON-CAPA account at this institution.").'<br />';                     &mt("Although your username and password were authenticated by your institution's Single Sign On system, you do not currently have a LON-CAPA account at this institution.").'<br />';
               my $shibenv;
               if (($r->dir_config('lonOtherAuthen') eq 'yes') && 
                   ($r->dir_config('lonOtherAuthenType') eq 'Shibboleth')) {
                   if (ref($domconfig{'usercreation'}) eq 'HASH') {
                       if (ref($domconfig{'usercreation'}{'cancreate'}) eq 'HASH') {
                           if (ref($domconfig{'usercreation'}{'cancreate'}{'shibenv'}) eq 'HASH') {
                               my @possfields = ('firstname','middlename','lastname','generation',
                                                 'permanentemail','id');
                               my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($domain);
                               $shibenv= {};
                               foreach my $key (keys(%{$domconfig{'usercreation'}{'cancreate'}{'shibenv'}})) {
                                   if ($key eq 'inststatus') {
                                       if (ref($usertypes) eq 'HASH') {
                                           if ($domconfig{'usercreation'}{'cancreate'}{'shibenv'}{$key} ne '') {
                                               if (exists($usertypes->{$domconfig{'usercreation'}{'cancreate'}{'shibenv'}{$key}})) {
                                                   $shibenv->{$key} = $domconfig{'usercreation'}{'cancreate'}{'shibenv'}{$key};
                                                }
                                           }
                                       }
                                   } elsif (grep(/^\Q$key\E/,@possfields)) {
                                       if ($domconfig{'usercreation'}{'cancreate'}{'shibenv'}{$key} ne '') {
                                           $shibenv->{$key} = $domconfig{'usercreation'}{'cancreate'}{'shibenv'}{$key};
                                       }
                                   }
                               }
                           }
                       }
                   }
               }
             $msg .= &username_check($sso_username,$domain,$domdesc,$courseid,               $msg .= &username_check($sso_username,$domain,$domdesc,$courseid, 
                                     $lonhost,$contact_email,$contact_name,                                      $lonhost,$contact_email,$contact_name,
                                     $sso_logout,$statustocreate);                                      $sso_logout,$statustocreate,$shibenv);
         } else {          } else {
             $msg = '<h3>'.&mt('Account creation unavailable').'</h3>'.              $msg = '<h3>'.&mt('Account creation unavailable').'</h3>'.
                    '<span class="LC_warning">'.&mt("Although your username and password were authenticated by your institution's Single Sign On system, you do not currently have a LON-CAPA account at this institution, and you are not permitted to create one.").'</span><br /><br />'.&mt('Please contact the [_1] ([_2]) for assistance.',$contact_name,$contact_email).'<hr />'.                     '<span class="LC_warning">'.&mt("Although your username and password were authenticated by your institution's Single Sign On system, you do not currently have a LON-CAPA account at this institution, and you are not permitted to create one.").'</span><br /><br />'.&mt('Please contact the [_1] ([_2]) for assistance.',$contact_name,$contact_email).'<hr />'.
Line 975  sub get_creation_controls { Line 1003  sub get_creation_controls {
             if (ref($usercreation->{'cancreate'}{'emailusername'}) eq 'HASH') {              if (ref($usercreation->{'cancreate'}{'emailusername'}) eq 'HASH') {
                 $emailusername = $usercreation->{'cancreate'}{'emailusername'};                  $emailusername = $usercreation->{'cancreate'}{'emailusername'};
             } else {              } else {
                 $emailusername =  {'lastname' => '1', 'firstname' => 1, };                  $emailusername = {
                                       default =>  {
                                                      'lastname' => '1',
                                                      'firstname' => 1,
                                                   },
                                    };
             }              }
         }          }
     }      }
Line 1164  sub login_failure_msg { Line 1197  sub login_failure_msg {
   
 sub username_check {  sub username_check {
     my ($username,$domain,$domdesc,$courseid,$lonhost,$contact_email,      my ($username,$domain,$domdesc,$courseid,$lonhost,$contact_email,
         $contact_name,$sso_logout,$statustocreate) = @_;          $contact_name,$sso_logout,$statustocreate,$shibenv) = @_;
     my (%rulematch,%inst_results,$checkfail,$rowcount,$editable,$output,$msg,      my (%rulematch,%inst_results,$checkfail,$rowcount,$editable,$output,$msg,
         %alerts,%curr_rules,%got_rules);          %alerts,%curr_rules,%got_rules);
     &call_rulecheck($username,$domain,\%alerts,\%rulematch,      &call_rulecheck($username,$domain,\%alerts,\%rulematch,
Line 1200  sub username_check { Line 1233  sub username_check {
     }      }
     if (!$checkfail) {      if (!$checkfail) {
         $output = '<form method="post" action="/adm/createaccount">';          $output = '<form method="post" action="/adm/createaccount">';
           if (ref($shibenv) eq 'HASH') {
               foreach my $key (keys(%{$shibenv})) {
                   if ($ENV{$shibenv->{$key}} ne '') {
                       $inst_results{$username.':'.$domain}{$key} = $ENV{$shibenv->{$key}};
                   }
               }
           }
         (my $datatable,$rowcount,$editable) =           (my $datatable,$rowcount,$editable) = 
             &Apache::loncreateuser::personal_data_display($username,$domain,1,'selfcreate',              &Apache::loncreateuser::personal_data_display($username,$domain,1,'selfcreate',
                                                          $inst_results{$username.':'.$domain});                                                           $inst_results{$username.':'.$domain});

Removed from v.1.64  
changed lines
  Added in v.1.67


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