ftimme
2013-03-27 8536f368e086d61cc50e9b08d514886110891e3d
- Fixed FS#2723 - ISPConfig doesn't allow multiple Slave DNS zones on different servers.
1 files added
4 files modified
30 ■■■■■ changed files
install/sql/incremental/upd_0050.sql 2 ●●●●● patch | view | raw | blame | history
install/sql/ispconfig3.sql 2 ●●● patch | view | raw | blame | history
interface/web/dns/dns_mx_edit.php 11 ●●●●● patch | view | raw | blame | history
interface/web/dns/dns_slave_edit.php 11 ●●●●● patch | view | raw | blame | history
interface/web/dns/form/dns_slave.tform.php 4 ●●● patch | view | raw | blame | history
install/sql/incremental/upd_0050.sql
New file
@@ -0,0 +1,2 @@
ALTER TABLE `dns_slave` DROP INDEX `origin`;
ALTER TABLE `dns_slave` ADD CONSTRAINT `slave` UNIQUE (`origin`,`server_id`);
install/sql/ispconfig3.sql
@@ -418,7 +418,7 @@
  `active` enum('N','Y') NOT NULL,
  `xfer` varchar(255) NOT NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `origin` (`origin`),
  UNIQUE KEY `slave` (`origin`,`server_id`),
  KEY `active` (`active`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
interface/web/dns/dns_mx_edit.php
@@ -119,6 +119,17 @@
        parent::onInsert();
    }
    
    function onUpdate() {
        global $app, $conf;
        // Check if record is existing already
        $duplicate_mx = $app->db->queryOneRecord("SELECT * FROM dns_rr WHERE zone = ".$app->functions->intval($this->dataRecord["zone"])." AND name = '".$this->dataRecord["name"]."' AND type = '".$this->dataRecord["type"]."' AND data = '".$this->dataRecord["data"]."' AND id != ".$app->functions->intval($this->dataRecord["id"])." AND ".$app->tform->getAuthSQL('r'));
        if(is_array($duplicate_mx) && !empty($duplicate_mx)) $app->error($app->tform->wordbook["duplicate_mx_record_txt"]);
        parent::onUpdate();
    }
    function onAfterInsert() {
        global $app, $conf;
        
interface/web/dns/dns_slave_edit.php
@@ -158,6 +158,17 @@
        parent::onSubmit();
    }
    
    function onInsert() {
        global $app, $conf;
        // Check if record is existing already
        $duplicate_slave = $app->db->queryOneRecord("SELECT * FROM dns_slave WHERE origin = '".$this->dataRecord["origin"]."' AND server_id = ".$app->functions->intval($this->dataRecord["server_id"])." AND ".$app->tform->getAuthSQL('r'));
        if(is_array($duplicate_slave) && !empty($duplicate_slave)) $app->error($app->tform->wordbook["origin_error_unique"]);
        parent::onInsert();
    }
    function onAfterInsert() {
        global $app, $conf;
        
interface/web/dns/form/dns_slave.tform.php
@@ -91,9 +91,11 @@
                                ),
            'validators'    => array (     0 => array (    'type'    => 'NOTEMPTY',
                                                        'errmsg'=> 'origin_error_empty'),
                                        /*
                                        1 => array (    'type'    => 'UNIQUE',
                                                        'errmsg'=> 'origin_error_unique'),
                                        2 => array (    'type'    => 'REGEX',
                                        */
                                        1 => array (    'type'    => 'REGEX',
                                                        'regex' => '/^[\w\.\-\/]{2,255}\.[a-zA-Z0-9\-]{2,10}[\.]{0,1}$/',
                                                        'errmsg'=> 'origin_error_regex'),
                                    ),