Changeset 11595 for trunk

Show
Ignore:
Timestamp:
11/09/08 16:36:51 (2 months ago)
Author:
ejhernandez@…
Message:

Applied patch from Víctor Jímenez to add an IP address for the domain optionally. Thanks very much for your addition!

Location:
trunk/client/dns
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/client/dns/src/EBox/DNS.pm.in

    r11209 r11595  
    219219# 
    220220#           name - String the domain's name 
     221#           ipaddr - String the domain's ip address 
    221222# 
    222223sub domains 
     
    232233 
    233234        $domaindata->{'name'} = $row->valueByName('domain'); 
     235        $domaindata->{'ipaddr'} = $row->valueByName('ipaddr'); 
    234236 
    235237        push(@array, $domaindata); 
     
    453455# 
    454456#  'name': domain name 
     457#  'ipaddr': domain ip address 
    455458#  'hosts': an array ref returned by <EBox::DNS::_hostnames> method. 
    456459# 
     
    463466    my $row = $model->find(domain => $domain->{'name'}); 
    464467    $domdata->{'name'} = $domain->{'name'}; 
     468    $domdata->{'ipaddr'} = $domain->{'ipaddr'}; 
    465469    $domdata->{'hosts'} = $self->_hostnames( 
    466470            $row->subModel('hostnames')->rows()); 
  • trunk/client/dns/src/EBox/Model/DomainTable.pm

    r10319 r11595  
    1515 
    1616# Class: 
    17 #  
     17# 
    1818#   EBox::DNS::Model::DomainTable 
    1919# 
    20 #   This class inherits from <EBox::Model::DataTable> and represents the 
    21 #   object table which basically contains domains names and a reference 
    22 #   to a member <EBox::DNS::Model::HostnameTable> 
     20#   This class inherits from <EBox::Model::DataTable> and represents 
     21#   the object table which basically contains domains names, the IP 
     22#   address for the domain and a reference to a member 
     23#   <EBox::DNS::Model::HostnameTable> 
    2324# 
    24 #    
    2525package EBox::DNS::Model::DomainTable; 
    2626 
     
    3333use EBox::Types::DomainName; 
    3434use EBox::Types::HasMany; 
     35use EBox::Types::HostIP; 
    3536use EBox::Sudo; 
    3637 
     
    8586                                'backView' => '/ebox/DNS/View/DomainTable', 
    8687                             ), 
     88            new EBox::Types::HostIP 
     89                            ( 
     90                                'fieldName' => 'ipaddr', 
     91                                'printableName' => __('IP Address'), 
     92                                'size' => '20', 
     93                                'optional' => 1, 
     94                                'editable' => 1 
     95                            ), 
    8796          ); 
    8897 
  • trunk/client/dns/stubs/db.mas

    r11269 r11595  
    77 
    88      name - String the domain's name 
     9      ipaddr - String the domain's ip address 
    910      hosts - Array ref containing hash refs with the following elements: 
    1011         ip   - String the IP address for that host 
     
    3738                NS      <% $nameserverHostname %>.<% $domain{'name'} %>.        ;nameserver 
    3839; 
     40% if($domain{'ipaddr'}) {        
     41                A       <% $domain{'ipaddr'} %> 
     42% } 
    3943% unless (@hosts > 0 and (scalar(grep { $_->{'name'} eq $nameserverHostname } @hosts))) { 
    4044<% $nameserverHostname %>               A       127.0.0.1