Ticket #2086: manual-dns.patch

File manual-dns.patch, 16.7 KB (added by blondak, 6 months ago)

Rewriten Manual DNS events handling

  • configs/common/database/database.sql

    diff -NbBru 1/configs/common/database/database.sql 2/configs/common/database/database.sql
    1 2  
    126126('PREVENT_EXTERNAL_LOGIN_ADMIN', '1'), 
    127127('PREVENT_EXTERNAL_LOGIN_RESELLER', '1'), 
    128128('PREVENT_EXTERNAL_LOGIN_CLIENT', '1'), 
    129 ('DATABASE_REVISION', '45'); 
     129('DATABASE_REVISION', '46'); 
    130130 
    131131-- -------------------------------------------------------- 
    132132 
     
    211211  `domain_type` enum('A','AAAA','CERT','CNAME','DNAME','GPOS','KEY','KX','MX','NAPTR','NSAP','NS','NXT','PTR','PX','SIG','SRV','TXT') collate utf8_unicode_ci NOT NULL default 'A', 
    212212  `domain_text` varchar(128) collate utf8_unicode_ci NOT NULL, 
    213213  `protected` varchar(3) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'no',  
     214  `domain_dns_status` VARCHAR(255) COLLATE utf8_unicode_ci, 
    214215  PRIMARY KEY  (`domain_dns_id`), 
    215216  UNIQUE KEY `domain_id` (`domain_id`,`alias_id`,`domain_dns`,`domain_class`,`domain_type`,`domain_text`) 
    216217) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 
  • engine/ispcp-als-mngr

    diff -NbBru 1/engine/ispcp-als-mngr 2/engine/ispcp-als-mngr
    1 2  
    5858        push_el(\@main::el, 'als_mngr_start_up()', 'Starting...'); 
    5959 
    6060        # checking for master process; 
    61         $rs = check_master(); 
    62         return $rs if ($rs != 0); 
     61#       $rs = check_master(); 
     62#       return $rs if ($rs != 0); 
    6363 
    6464        # Let's clear Execution Logs, if any. 
    6565        if (-e $main::ispcp_als_mngr_el) { 
     
    533533        $rs = getSerialNumber(\$alsName, \$tplDbEntries, \$wrkFile); 
    534534        return $rs if ($rs != 0); 
    535535 
    536         # Custom DNS support - Begin 
    537  
    538         if($alsStatus eq 'dnschange' || $alsStatus eq 'change') { 
    539  
    540                 my $sql = " 
    541                         SELECT 
    542                                 `domain_dns_id`, `domain_id`, `alias_id`, `domain_dns`, 
    543                                 `domain_text`, `domain_class`, `domain_type` 
    544                         FROM 
    545                                 `domain_dns` 
    546                         WHERE 
    547                                 `domain_dns`.`alias_id` = @${data[0]} 
    548                         AND 
    549                                 `domain_dns`.`domain_id` = @${data[1]} 
    550                         ORDER BY 
    551                                 `domain_dns_id` 
    552                         ; 
    553                 "; 
    554  
    555                 my $rows; 
    556  
    557                 ($rs, $rows) = doSQL($sql); 
    558                 return $rs if ($rs != 0); 
    559  
    560                 if (@$rows > 0) { 
    561  
    562                         # Get needed templates for custom dns entries - Begin 
    563                         my ($tplDnsEntryB, $tplDnsEntry, $tplDnsEntryE); 
    564                         ($rs, $tplDnsEntryB, $tplDnsEntry, $tplDnsEntryE) = get_tpl( 
    565                                 "$main::cfg{'CONF_DIR'}/bind/parts", 'db_dns_entry_b.tpl', 
    566                                 'db_dns_entry.tpl', 'db_dns_entry_e.tpl' 
    567                         ); 
    568                         return $rs if($rs != 0); 
    569  
    570                         my ($dnsEntryBv, $dnsEntryV, $dnsEntryEv, $dnsEntries); 
    571  
    572                         foreach (@$rows) { 
    573  
    574                                 # Variables replacement 
    575                                 ($rs, $dnsEntryBv, $dnsEntryV, $dnsEntryEv) = prep_tpl( 
    576                                         { 
    577                                                 '{MANUAL_DNS_NAME}' => $_->[3], 
    578                                                 '{MANUAL_DNS_ID}' => $_->[0], 
    579                                                 '{MANUAL_DNS_DATA}' => $_->[4], 
    580                                                 '{MANUAL_DNS_CLASS}' => $_->[5], 
    581                                                 '{MANUAL_DNS_TYPE}' => $_->[6] 
    582                                         }, 
    583                                         $tplDnsEntryB, $tplDnsEntry, $tplDnsEntryE 
    584                                 ); 
    585  
    586                                 # Concatenates custom DNS entries 
    587                                 $dnsEntries .= "$dnsEntryBv$dnsEntryV$dnsEntryEv\n"; 
    588                         } 
    589  
    590                         # Put the custom DNS entries in db zone file 
    591                         ($rs, $tplDbEntries) = add_tag( 
    592                                 $tplDnsEntryB, $tplDnsEntryE, $tplDbEntries, $dnsEntries 
    593                         ); 
    594                         return $rs if($rs != 0); 
    595                 } 
    596         } 
    597  
    598         # Custom DNS support - End 
    599  
    600536        # Install new domain db file 
    601537        foreach("$main::cfg{'CONF_DIR'}/bind/working", $main::cfg{'BIND_DB_DIR'}) { 
    602538                $rs = store_file( 
     
    666602 
    667603################################################################################ 
    668604## 
     605## Handle Manual DNS changes 
     606## 
     607## @param   $data Ref to an array that contains domain data 
     608## @access  private 
     609## 
     610sub _als_dns_change_db_data { 
     611         
     612        push_el(\@main::el, '_als_dns_change_db_data()', 'Starting...'); 
     613 
     614        my ($data) = @_; 
     615        my ($alsName) = (@$data[2]); 
     616 
     617        if (!defined($data) || $data eq '') { 
     618                push_el( 
     619                        \@main::el, '_als_dns_change_db_data()', 
     620                        'ERROR: Undefined Input Data...' 
     621                ); 
     622 
     623                return -1; 
     624        } 
     625 
     626        my ($rs, $rows); 
     627         
     628        my $sql = " 
     629                SELECT 
     630                        `domain_dns_id`, `domain_id`, `alias_id`, `domain_dns`, 
     631                        `domain_text`, `domain_class`, `domain_type`, `domain_dns_status` 
     632                FROM 
     633                        `domain_dns` 
     634                WHERE 
     635                        `domain_dns`.`alias_id` = @${data[0]} 
     636                AND     `domain_dns`.`domain_id` = @${data[1]} 
     637                AND `domain_dns`.`domain_dns_status` in ('delete','toadd','change') 
     638                ORDER BY 
     639                        `domain_dns_id` 
     640                ; 
     641        "; 
     642 
     643        ($rs, $rows) = doSQL($sql); 
     644        return $rs if ($rs != 0); 
     645 
     646        my ($tplDnsEntryB, $tplDnsEntry, $tplDnsEntryE); 
     647        ($rs, $tplDnsEntryB, $tplDnsEntry, $tplDnsEntryE) = get_tpl( 
     648                "$main::cfg{'CONF_DIR'}/bind/parts", 'db_dns_entry_b.tpl', 
     649                'db_dns_entry.tpl', 'db_dns_entry_e.tpl' 
     650        ); 
     651        return $rs if($rs != 0); 
     652 
     653         
     654        if (@$rows > 0) { 
     655                my $bkp_dir = "$main::cfg{'CONF_DIR'}/bind/backup"; 
     656                 
     657                my ($dnsEntryBv, $dnsEntryV, $dnsEntryEv, $dnsEntries, $wrkFile); 
     658 
     659                ($rs, $wrkFile) = get_file("$main::cfg{'CONF_DIR'}/bind/working/$alsName.db"); 
     660                return $rs if ($rs != 0); 
     661 
     662                foreach (@$rows) { 
     663                        ($rs, $dnsEntryBv, $dnsEntryV, $dnsEntryEv) = prep_tpl( 
     664                                { 
     665                                        '{MANUAL_DNS_NAME}' => $_->[3], 
     666                                        '{MANUAL_DNS_ID}' => $_->[0], 
     667                                        '{MANUAL_DNS_DATA}' => $_->[4], 
     668                                        '{MANUAL_DNS_CLASS}' => $_->[5], 
     669                                        '{MANUAL_DNS_TYPE}' => $_->[6] 
     670                                }, 
     671                                $tplDnsEntryB, $tplDnsEntry, $tplDnsEntryE 
     672                        ); 
     673                                 
     674                        if ($_->[7] eq 'delete'){ 
     675                                push_el(\@main::el, '_als_dns_change_db_data()', 'Deleting ...'); 
     676                                 
     677                                ($rs, $wrkFile) = del_tag($dnsEntryBv, "$dnsEntryEv\n", $wrkFile); 
     678                        return $rs if ($rs != 0 && $rs != -5); 
     679                        }elsif ($_->[7] eq 'toadd'){ 
     680                                push_el(\@main::el, '_als_dns_change_db_data()', 'Adding ...'); 
     681 
     682                                ($rs, $wrkFile) = add_tag( 
     683                                        $tplDnsEntryB, $tplDnsEntryE, $wrkFile, "$dnsEntryBv$dnsEntryV$dnsEntryEv\n" 
     684                                ); 
     685                        return $rs if ($rs != 0); 
     686                        }elsif ($_->[7] eq 'change'){ 
     687                                push_el(\@main::el, '_als_dns_change_db_data()', 'Changing ...'); 
     688 
     689                                ($rs, $wrkFile) = repl_tag( 
     690                                        $dnsEntryBv, "$dnsEntryEv\n", $wrkFile, "$dnsEntryBv$dnsEntryV$dnsEntryEv\n" 
     691                                ); 
     692                        return $rs if ($rs != 0); 
     693                        } 
     694                } 
     695 
     696                my $cmd = "$main::cfg{'CMD_CP'} -p $main::cfg{'CONF_DIR'}/bind/working/$alsName.db $bkp_dir/$alsName.db" . time; 
     697                $rs = sys_command_rs($cmd); 
     698        return $rs if ($rs != 0); 
     699 
     700        $rs = getSerialNumber(\$alsName, \$wrkFile, \$wrkFile); 
     701        return $rs if ($rs != 0); 
     702 
     703                foreach("$main::cfg{'CONF_DIR'}/bind/working", $main::cfg{'BIND_DB_DIR'}) { 
     704                        $rs = store_file( 
     705                                "$_/$alsName.db", $wrkFile, $main::cfg{'ROOT_USER'}, 
     706                                $main::cfg{'ROOT_GROUP'}, 0644 
     707                        ); 
     708                        return $rs if($rs != 0); 
     709                } 
     710 
     711                $sql = " 
     712                        DELETE FROM 
     713                                `domain_dns` 
     714                        WHERE 
     715                                `domain_dns`.`alias_id` = @${data[0]} 
     716                        AND     `domain_dns`.`domain_id` = @${data[1]} 
     717                        AND `domain_dns`.`domain_dns_status` = 'delete' 
     718                        ; 
     719                "; 
     720                ($rs) = doSQL($sql); 
     721         
     722                $sql = " 
     723                        UPDATE 
     724                                `domain_dns` 
     725                        SET 
     726                                `domain_dns_status` = 'ok' 
     727                        WHERE 
     728                                `domain_dns`.`alias_id` = @${data[0]} 
     729                        AND     `domain_dns`.`domain_id` = @${data[1]} 
     730                        AND `domain_dns`.`domain_dns_status` in ('toadd', 'change') 
     731                        ; 
     732                "; 
     733                ($rs) = doSQL($sql); 
     734                 
     735        } 
     736         
     737        push_el(\@main::el, '_als_dns_change_db_data()', 'Ending...'); 
     738        0; 
     739} 
     740################################################################################ 
     741## 
    669742## Adds all DNS configuration data related to a domain alias 
    670743## See als_add_named_cfg_data() && _als_add_named_db_data() 
    671744## 
     
    38103883                return $rs if ($rs != 0); 
    38113884        } elsif ($als_status eq 'dnschange'){ 
    38123885                        # changing DNS 
    3813                         $rs = _als_add_named_db_data($entry); 
     3886                        $rs = _als_dns_change_db_data($entry); 
    38143887 
    38153888                        $timestamp = time(); 
    38163889                        if ($rs == 0) { 
     
    38403913                        ($rs, $rdata) = doSQL($sql); 
    38413914                        return $rs if ($rs != 0); 
    38423915 
     3916                        $sql = " 
     3917                                DELETE FROM 
     3918                                        domain_dns 
     3919                                WHERE 
     3920                                        alias_id = $als_id 
     3921                                ; 
     3922                        "; 
     3923 
     3924                        ($rs, $rdata) = doSQL($sql); 
     3925                        return $rs if ($rs != 0); 
     3926 
    38433927                } else { 
    38443928                        my ($sub_name, $msg) = split(/$main::el_sep/, pop_el(\@main::el)); 
    38453929 
  • engine/ispcp-dmn-mngr

    diff -NbBru 1/engine/ispcp-dmn-mngr 2/engine/ispcp-dmn-mngr
    1 2  
    330330 
    331331################################################################################ 
    332332## 
     333## Handle Manual DNS changes 
     334## 
     335## @param   $data Ref to an array that contains domain data 
     336## @access  private 
     337## 
     338sub _dmn_dns_change_db_data { 
     339         
     340        push_el(\@main::el, '_dmn_dns_change_db_data()', 'Starting...'); 
     341 
     342        my ($data) = @_; 
     343        my ($dmnName) = (@$data[1]); 
     344 
     345        if (!defined($data) || $data eq '') { 
     346                push_el( 
     347                        \@main::el, '_dmn_dns_change_db_data()', 
     348                        'ERROR: Undefined Input Data...' 
     349                ); 
     350 
     351                return -1; 
     352        } 
     353 
     354        my ($rs, $rows); 
     355         
     356        my $sql = " 
     357                SELECT 
     358                        `domain_dns_id`, `domain_id`, `alias_id`, `domain_dns`, 
     359                        `domain_text`, `domain_class`, `domain_type`, `domain_dns_status` 
     360                FROM 
     361                        `domain_dns` 
     362                WHERE 
     363                        `domain_dns`.`alias_id` = 0 
     364                AND     `domain_dns`.`domain_id` = @${data[0]} 
     365                AND `domain_dns`.`domain_dns_status` in ('delete','toadd','change') 
     366                ORDER BY 
     367                        `domain_dns_id` 
     368                ; 
     369        "; 
     370 
     371        ($rs, $rows) = doSQL($sql); 
     372        return $rs if ($rs != 0); 
     373 
     374        my ($tplDnsEntryB, $tplDnsEntry, $tplDnsEntryE); 
     375        ($rs, $tplDnsEntryB, $tplDnsEntry, $tplDnsEntryE) = get_tpl( 
     376                "$main::cfg{'CONF_DIR'}/bind/parts", 'db_dns_entry_b.tpl', 
     377                'db_dns_entry.tpl', 'db_dns_entry_e.tpl' 
     378        ); 
     379        return $rs if($rs != 0); 
     380 
     381         
     382        if (@$rows > 0) { 
     383                my $bkp_dir = "$main::cfg{'CONF_DIR'}/bind/backup"; 
     384                 
     385                my ($dnsEntryBv, $dnsEntryV, $dnsEntryEv, $dnsEntries, $wrkFile); 
     386 
     387                ($rs, $wrkFile) = get_file("$main::cfg{'CONF_DIR'}/bind/working/$dmnName.db"); 
     388                return $rs if ($rs != 0); 
     389 
     390                foreach (@$rows) { 
     391                        ($rs, $dnsEntryBv, $dnsEntryV, $dnsEntryEv) = prep_tpl( 
     392                                { 
     393                                        '{MANUAL_DNS_NAME}' => $_->[3], 
     394                                        '{MANUAL_DNS_ID}' => $_->[0], 
     395                                        '{MANUAL_DNS_DATA}' => $_->[4], 
     396                                        '{MANUAL_DNS_CLASS}' => $_->[5], 
     397                                        '{MANUAL_DNS_TYPE}' => $_->[6] 
     398                                }, 
     399                                $tplDnsEntryB, $tplDnsEntry, $tplDnsEntryE 
     400                        ); 
     401                                 
     402                        if ($_->[7] eq 'delete'){ 
     403                                push_el(\@main::el, '_dmn_dns_change_db_data()', 'Deleting ...'); 
     404                                 
     405                                ($rs, $wrkFile) = del_tag($dnsEntryBv, "$dnsEntryEv\n", $wrkFile); 
     406                        return $rs if ($rs != 0 && $rs != -5); 
     407                        }elsif ($_->[7] eq 'toadd'){ 
     408                                push_el(\@main::el, '_dmn_dns_change_db_data()', 'Adding ...'); 
     409 
     410                                ($rs, $wrkFile) = add_tag( 
     411                                        $tplDnsEntryB, $tplDnsEntryE, $wrkFile, "$dnsEntryBv$dnsEntryV$dnsEntryEv\n" 
     412                                ); 
     413                        return $rs if ($rs != 0); 
     414                        }elsif ($_->[7] eq 'change'){ 
     415                                push_el(\@main::el, '_dmn_dns_change_db_data()', 'Changing ...'); 
     416 
     417                                ($rs, $wrkFile) = repl_tag( 
     418                                        $dnsEntryBv, "$dnsEntryEv\n", $wrkFile, "$dnsEntryBv$dnsEntryV$dnsEntryEv\n" 
     419                                ); 
     420                        return $rs if ($rs != 0); 
     421                        } 
     422                } 
     423 
     424                my $cmd = "$main::cfg{'CMD_CP'} -p $main::cfg{'CONF_DIR'}/bind/working/$dmnName.db $bkp_dir/$dmnName.db" . time; 
     425                $rs = sys_command_rs($cmd); 
     426        return $rs if ($rs != 0); 
     427 
     428        $rs = getSerialNumber(\$dmnName, \$wrkFile, \$wrkFile); 
     429        return $rs if ($rs != 0); 
     430 
     431                foreach("$main::cfg{'CONF_DIR'}/bind/working", $main::cfg{'BIND_DB_DIR'}) { 
     432                        $rs = store_file( 
     433                                "$_/$dmnName.db", $wrkFile, $main::cfg{'ROOT_USER'}, 
     434                                $main::cfg{'ROOT_GROUP'}, 0644 
     435                        ); 
     436                        return $rs if($rs != 0); 
     437                } 
     438 
     439                $sql = " 
     440                        DELETE FROM 
     441                                `domain_dns` 
     442                        WHERE 
     443                                `domain_dns`.`alias_id` = 0 
     444                        AND     `domain_dns`.`domain_id` = @${data[0]} 
     445                        AND `domain_dns`.`domain_dns_status` = 'delete' 
     446                        ; 
     447                "; 
     448                ($rs) = doSQL($sql); 
     449         
     450                $sql = " 
     451                        UPDATE 
     452                                `domain_dns` 
     453                        SET 
     454                                `domain_dns_status` = 'ok' 
     455                        WHERE 
     456                                `domain_dns`.`alias_id` = 0 
     457                        AND     `domain_dns`.`domain_id` = @${data[0]} 
     458                        AND `domain_dns`.`domain_dns_status` in ('toadd', 'change') 
     459                        ; 
     460                "; 
     461                ($rs) = doSQL($sql); 
     462                 
     463        } 
     464         
     465        push_el(\@main::el, '_dmn_dns_change_db_data()', 'Ending...'); 
     466        0; 
     467} 
     468 
     469################################################################################ 
     470## 
    333471## Create domain DNS zone file in (eg. /var/cache/bind) 
    334472## 
    335473## @param   arrayref $data Ref to an array that contains domain data 
     
    407545        $rs = getSerialNumber(\$dmnName, \$tplDbEntries, \$wrkFile); 
    408546        return $rs if ($rs != 0); 
    409547 
    410         # Custom DNS support - Begin 
    411  
    412         if($dmnStatus eq 'dnschange' || $dmnStatus eq 'change') { 
    413  
    414                 my $sql = " 
    415                         SELECT 
    416                                 `domain_dns_id`, `domain_id`, `alias_id`, `domain_dns`, 
    417                                 `domain_text`, `domain_class`, `domain_type` 
    418                         FROM 
    419                                 `domain_dns` 
    420                         WHERE 
    421                                 `domain_dns`.`alias_id` = 0 
    422                         AND 
    423                                 `domain_dns`.`domain_id` = @${data[0]} 
    424                         ORDER BY 
    425                                 `domain_dns_id` 
    426                         ; 
    427                 "; 
    428  
    429                 my $rows; 
    430  
    431                 ($rs, $rows) = doSQL($sql); 
    432                 return $rs if ($rs != 0); 
    433  
    434                 if (@$rows > 0) { 
    435  
    436                         # Get needed templates for custom dns entries - Begin 
    437                         my ($tplDnsEntryB, $tplDnsEntry, $tplDnsEntryE); 
    438                         ($rs, $tplDnsEntryB, $tplDnsEntry, $tplDnsEntryE) = get_tpl( 
    439                                 "$main::cfg{'CONF_DIR'}/bind/parts", 'db_dns_entry_b.tpl', 
    440                                 'db_dns_entry.tpl', 'db_dns_entry_e.tpl' 
    441                         ); 
    442                         return $rs if($rs != 0); 
    443  
    444                         my ($dnsEntryBv, $dnsEntryV, $dnsEntryEv, $dnsEntries); 
    445  
    446                         foreach (@$rows) { 
    447  
    448                                 # Variables replacement 
    449                                 ($rs, $dnsEntryBv, $dnsEntryV, $dnsEntryEv) = prep_tpl( 
    450                                         { 
    451                                                 '{MANUAL_DNS_NAME}' => $_->[3], 
    452                                                 '{MANUAL_DNS_ID}' => $_->[0], 
    453                                                 '{MANUAL_DNS_DATA}' => $_->[4], 
    454                                                 '{MANUAL_DNS_CLASS}' => $_->[5], 
    455                                                 '{MANUAL_DNS_TYPE}' => $_->[6] 
    456                                         }, 
    457                                         $tplDnsEntryB, $tplDnsEntry, $tplDnsEntryE 
    458                                 ); 
    459  
    460                                 # Concatenates custom DNS entries 
    461                                 $dnsEntries .= "$dnsEntryBv$dnsEntryV$dnsEntryEv\n"; 
    462                         } 
    463  
    464                         # Put the custom DNS entries in db zone file 
    465                         ($rs, $tplDbEntries) = add_tag( 
    466                                 $tplDnsEntryB, $tplDnsEntryE, $tplDbEntries, $dnsEntries 
    467                         ); 
    468                         return $rs if($rs != 0); 
    469                 } 
    470         } 
    471  
    472         # Custom DNS support - End 
    473  
    474548        # Install new domain db file 
    475549        foreach("$main::cfg{'CONF_DIR'}/bind/working", $main::cfg{'BIND_DB_DIR'}) { 
    476550                $rs = store_file( 
     
    41614235        } elsif ($dmn_status eq 'dnschange'){ 
    41624236 
    41634237                # Adds custom DNS entry 
    4164                 $rs = _dmn_add_named_db_data($entry); 
     4238                $rs = _dmn_dns_change_db_data($entry); 
    41654239 
    41664240                if ($rs == 0) { 
    41674241                        $sql = " 
    41684242                                UPDATE 
    41694243                                        `domain` 
    41704244                                SET 
    4171                                         `domain_status` = 'ok' 
     4245                                        `domain_status` = '$main::after_change_status' 
    41724246                                WHERE 
    41734247                                        `domain_id` = $dmn_id 
    41744248                                ; 
     
    42074281 
    42084282                        $sql = " 
    42094283                                DELETE FROM 
     4284                                        `domain_dns` 
     4285                                WHERE 
     4286                                        `domain_id` = $dmn_id 
     4287                                ; 
     4288                        "; 
     4289                         
     4290                        ($rs, undef) = doSQL($sql); 
     4291                        return $rs if ($rs != 0); 
     4292 
     4293                        $sql = " 
     4294                                DELETE FROM 
    42104295                                        `admin` 
    42114296                                WHERE 
    42124297                                        `admin_id` = $dmn_admin_id 
  • gui/client/dns_delete.php

    diff -NbBru 1/gui/client/dns_delete.php 2/gui/client/dns_delete.php
    1 2  
    7373 
    7474        // Delete DNS record from the database 
    7575        $query = " 
    76                 DELETE FROM 
     76                UPDATE  
    7777                        `domain_dns` 
     78                SET 
     79                        `domain_dns_status` 
    7880                WHERE 
    7981                        `domain_dns_id` = ? 
    8082                ; 
    8183        "; 
    8284 
    83         $rs = exec_query($sql, $query, $dns_id); 
     85        $rs = exec_query($sql, $query, $dns_id, $cfg->ITEM_DELETE_STATUS); 
    8486 
    8587        if (empty($alias_id)) { 
    8688 
  • gui/client/dns_edit.php

    diff -NbBru 1/gui/client/dns_edit.php 2/gui/client/dns_edit.php
    1 2  
    572572                                INSERT INTO 
    573573                                        `domain_dns` ( 
    574574                                                `domain_id`, `alias_id`, `domain_dns`, `domain_class`, 
    575                                                 `domain_type`, `domain_text` 
     575                                                `domain_type`, `domain_text`, `domain_dns_status` 
    576576                                        ) VALUES ( 
    577                                                 ?, ?, ?, ?, ?, ? 
     577                                                ?, ?, ?, ?, ?, ?, ? 
    578578                                        ) 
    579579                                ; 
    580580                        "; 
    581581 
    582582                        $rs = exec_query( 
    583583                                $sql, $query, 
    584                                 array($dmn_id, $alias_id, $_dns, $_class, $_type, $_text), 
     584                                array($dmn_id, $alias_id, $_dns, $_class, $_type, $_text, $cfg->ITEM_ADD_STATUS), 
    585585                                false 
    586586                        ); 
    587587 
     
    608608                                        `domain_dns` 
    609609                                SET 
    610610                                        `domain_dns` = ?, `domain_class` = ?, `domain_type` = ?, 
    611                                         `domain_text` = ? 
     611                                        `domain_text` = ?, `domain_dns_status` = ? 
    612612                                WHERE 
    613613                                        `domain_dns_id` = ? 
    614614                                ; 
    615615                        "; 
    616616 
    617617                        exec_query( 
    618                                 $sql, $query, array($_dns, $_class, $_type, $_text, $edit_id) 
     618                                $sql, $query, array($_dns, $_class, $_type, $_text, $cfg->ITEM_CHANGE_STATUS, $edit_id) 
    619619                        ); 
    620620                } 
    621621 
  • gui/include/ispCP/Update/Database.php

    diff -NbBru 1/gui/include/ispCP/Update/Database.php 2/gui/include/ispCP/Update/Database.php
    1 2  
    18551855        return $sqlUpd; 
    18561856    } 
    18571857     
     1858    protected function _databaseUpdate_46(){ 
     1859        $sqlUpd = array(); 
     1860        $sqlUpd[] = "ALTER IGNORE TABLE `domain_dns` ADD `domain_dns_status` VARCHAR(255) COLLATE utf8_unicode_ci;"; 
     1861        $sqlUpd[] = "UPDATE `domain_dns` SET `domain_dns_status` = 'ok';" 
     1862        return $sqlUpd; 
     1863    } 
     1864 
    18581865        /* 
    18591866         * DO NOT CHANGE ANYTHING BELOW THIS LINE! 
    18601867         */