Till Brehm
2015-12-03 1fbf0d38c82aaa4fe20ef7a7158cdcbac81e16ee
server/plugins-available/bind_plugin.inc.php
@@ -106,13 +106,18 @@
         if(is_array($records) && !empty($records)){
            for($i=0;$i<sizeof($records);$i++){
               if($records[$i]['ttl'] == 0) $records[$i]['ttl'] = '';
               if($records[$i]['name'] == '') $records[$i]['name'] = '@';
               //* Split TXT records, if nescessary
               if($records[$i]['type'] == 'TXT' && strlen($records[$i]['data']) > 255) {
                  $records[$i]['data'] = implode('" "',str_split( $records[$i]['data'], 255));
               }
            }
         }
         $tpl->setLoop('zones', $records);
         //TODO : change this when distribution information has been integrated into server record
         if (file_exists('/etc/gentoo-release')) {
            $filename = escapeshellcmd($dns_config['bind_zonefiles_dir'].'/pri.'.str_replace("/", "_", substr($zone['origin'], 0, -1)));
            $filename = escapeshellcmd($dns_config['bind_zonefiles_dir'].'/pri/'.str_replace("/", "_", substr($zone['origin'], 0, -1)));
         }
         else {
            $filename = escapeshellcmd($dns_config['bind_zonefiles_dir'].'/pri.'.str_replace("/", "_", substr($zone['origin'], 0, -1)));
@@ -146,7 +151,7 @@
      if($data['old']['origin'] != $data['new']['origin']) {
         //TODO : change this when distribution information has been integrated into server record
         if (file_exists('/etc/gentoo-release')) {
            $filename = $dns_config['bind_zonefiles_dir'].'/pri.'.str_replace("/", "_", substr($data['old']['origin'], 0, -1));
            $filename = $dns_config['bind_zonefiles_dir'].'/pri/'.str_replace("/", "_", substr($data['old']['origin'], 0, -1));
         }
         else {
            $filename = $dns_config['bind_zonefiles_dir'].'/pri.'.str_replace("/", "_", substr($data['old']['origin'], 0, -1));
@@ -156,8 +161,12 @@
         if(is_file($filename.'.err')) unlink($filename.'.err');
      }
      //* Reload bind nameserver
      $app->services->restartServiceDelayed('bind', 'reload');
      //* Restart bind nameserver if update_acl is not empty, otherwise reload it
      if($data['new']['update_acl'] != '') {
         $app->services->restartServiceDelayed('bind', 'restart');
      } else {
         $app->services->restartServiceDelayed('bind', 'reload');
      }
   }