[LON-CAPA-cvs] cvs: loncom /cgi lonauthcgi.pm

raeburn raeburn at source.lon-capa.org
Sat Dec 22 16:04:56 EST 2018


raeburn		Sat Dec 22 21:04:56 2018 EDT

  Modified files:              
    /loncom/cgi	lonauthcgi.pm 
  Log:
  - &Apache::lonnet::hostname expects to be passed a hostID not an IP address.
  
  
Index: loncom/cgi/lonauthcgi.pm
diff -u loncom/cgi/lonauthcgi.pm:1.15 loncom/cgi/lonauthcgi.pm:1.16
--- loncom/cgi/lonauthcgi.pm:1.15	Mon Jul 25 19:50:01 2016
+++ loncom/cgi/lonauthcgi.pm	Sat Dec 22 21:04:56 2018
@@ -1,7 +1,7 @@
 #
 # LON-CAPA authorization for cgi-bin scripts
 #
-# $Id: lonauthcgi.pm,v 1.15 2016/07/25 19:50:01 raeburn Exp $
+# $Id: lonauthcgi.pm,v 1.16 2018/12/22 21:04:56 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -197,10 +197,10 @@
     my %remote_doms;
     my $allowed;
     if ($remote_ip ne '') {
-        if (&Apache::lonnet::hostname($remote_ip) ne '') {
+        my @remote_hosts = &Apache::lonnet::get_hosts_from_ip($remote_ip);
+        if (@remote_hosts) {
             my @poss_domains = &Apache::lonnet::current_machine_domains();
             if (@poss_domains > 0) {
-                my @remote_hosts = &Apache::lonnet::get_hosts_from_ip($remote_ip);
                 foreach my $hostid (@remote_hosts) {
                     my $hostdom = &Apache::lonnet::host_domain($hostid);
                     if ($hostdom ne '') {




More information about the LON-CAPA-cvs mailing list