Changeset 2333


Ignore:
Timestamp:
01/30/20 22:43:01 (4 years ago)
Author:
nanardon
Message:

Encode name to unicode in dns zone

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Json/List.pm

    r1841 r2333  
    3030    my @objects = $base->list_objects($otype); 
    3131    if (my $term = $c->req->param('term')) { 
    32         @objects = grep { /\Q$term\E/ } @objects; 
     32        @objects = grep { /\Q$term\E/i } @objects; 
    3333    } 
    3434 
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Buildnet.pm

    r2312 r2333  
    1313use Net::IPv4Addr; 
    1414use Net::IPv6Addr; 
     15use URI; 
    1516 
    1617=head1 NAME 
     
    512513                $dbzone .= sprintf( 
    513514                    "%-30s IN    %-4s     %s\n", 
    514                     $res, 
     515                    URI->new("http://$res")->host, 
    515516                    ($ip =~ /:/ ? 'AAAA' : 'A'), 
    516517                    $ip 
     
    521522                    $dbzone .= sprintf( 
    522523                        "%-30s IN    %-4s     %s\n", 
    523                         $_, 
     524                        URI->new("http://$_")->host, 
    524525                        ($ip =~ /:/ ? 'AAAA' : 'A'), 
    525526                        $ip 
     
    539540                    $dbzone .= "; $msg\n"; 
    540541                } else { 
    541                     $dbzone .= sprintf("%-30s IN    CNAME    %s\n", $_, $res,); 
     542                    $dbzone .= sprintf("%-30s IN    CNAME    %s\n", URI->new("http://$_")->host, URI->new("http://$res")->host,); 
    542543                } 
    543544            } 
     
    547548                    $dbzone .= sprintf( 
    548549                        "%-30s IN    SSHFP    %s\n", 
    549                         $name, 
     550                        URI->new("http://$name")->host, 
    550551                        $sshfp, 
    551552                    ); 
     
    562563 
    563564    my $domain = $ozone->get_attributes('domain') || ''; 
     565    my $punyDomain = URI->new("http://$domain")->host; 
    564566    my $dbzone = ''; 
    565567    if ($ozone->get_attributes('net')) { 
     
    631633            $dbzone .= sprintf($fmt, $revip, 
    632634                $reverse =~ /\.$/ 
    633                     ? ($reverse, ($domain ? "$domain." : '.')) 
    634                     : ($reverse, '.')); 
     635                    ? (URI->new("http://$reverse")->host, ($punyDomain ? "$punyDomain." : '.')) 
     636                    : (URI->new("http://$reverse")->host, '.')); 
    635637        } 
    636638    } 
Note: See TracChangeset for help on using the changeset viewer.