[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface createaccount.pm

raeburn raeburn at source.lon-capa.org
Sun Jan 3 23:42:13 EST 2021


raeburn		Mon Jan  4 04:42:13 2021 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	createaccount.pm 
  Log:
  - For 2.11
    Backport 1.82
  
  
Index: loncom/interface/createaccount.pm
diff -u loncom/interface/createaccount.pm:1.72.4.5 loncom/interface/createaccount.pm:1.72.4.6
--- loncom/interface/createaccount.pm:1.72.4.5	Wed Sep  9 02:12:01 2020
+++ loncom/interface/createaccount.pm	Mon Jan  4 04:42:13 2021
@@ -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.72.4.6 2021/01/04 04:42:13 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -982,7 +982,8 @@
             $msg .= '</form></p>';
             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 @@
                             &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);
@@ -1578,7 +1580,8 @@
                     '<input type="hidden" name="udom" value="'.$domain.'" />'."\n".
                     '<input type="hidden" name="phase" value="username_activation" />';
         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);




More information about the LON-CAPA-cvs mailing list