--- loncom/interface/createaccount.pm 2020/09/09 02:12:01 1.72.4.5 +++ loncom/interface/createaccount.pm 2021/09/25 20:35:26 1.83 @@ -4,7 +4,7 @@ # kerberos, or SSO) or an e-mail address. Requests to use an e-mail address as # username may be processed automatically, or may be queued for approval. # -# $Id: createaccount.pm,v 1.72.4.5 2020/09/09 02:12:01 raeburn Exp $ +# $Id: createaccount.pm,v 1.83 2021/09/25 20:35:26 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -982,7 +982,8 @@ sub send_token { $msg .= '

'; return $msg; } - my %info = ('ip' => $ENV{'REMOTE_ADDR'}, + my $ip = &Apache::lonnet::get_requestor_ip(); + my %info = ('ip' => $ip, 'time' => $now, 'domain' => $domain, 'username' => $email, @@ -1098,8 +1099,9 @@ sub process_mailtoken { &create_account($r,$domain,$domdesc,\%data); if ($result eq 'ok') { $msg = $output; + my $ip = &Apache::lonnet::get_requestor_ip(); my $shownow = &Apache::lonlocal::locallocaltime($now); - my $mailmsg = &mt('A LON-CAPA account for the institution: [_1] has been created [_2] from IP address: [_3]. If you did not perform this action or authorize it, please contact the [_4] ([_5]).',$domdesc,$shownow,$ENV{'REMOTE_ADDR'},$contact_name,$contact_email)."\n"; + my $mailmsg = &mt('A LON-CAPA account for the institution: [_1] has been created [_2] from IP address: [_3]. If you did not perform this action or authorize it, please contact the [_4] ([_5]).',$domdesc,$shownow,$ip,$contact_name,$contact_email)."\n"; my $mailresult = &Apache::resetpw::send_mail($domdesc,$data{'email'}, $mailmsg,$contact_name, $contact_email); @@ -1195,15 +1197,14 @@ sub print_dataentry_form { $output .= ' +

'; } elsif ($captcha eq 'recaptcha') { - if ($recaptchaversion eq '2') { - $output .= "$captchaform\n"; - undef($captchaform); - } else { + unless ($recaptchaversion eq '2') { $output .= ' +

'; } } @@ -1578,7 +1579,8 @@ sub username_check { ''."\n". ''; my $now = time; - my %info = ('ip' => $ENV{'REMOTE_ADDR'}, + my $ip = &Apache::lonnet::get_requestor_ip(); + my %info = ('ip' => $ip, 'time' => $now, 'domain' => $domain, 'username' => $username);