diff --git a/server/lib/classes/cron.d/550-bind_dnssec.inc.php b/server/lib/classes/cron.d/550-bind_dnssec.inc.php index cf5918e5c0b2475aaed8e2cf3616e7049e7ab145..ed831ea9100e09b1f47891e8961bcc5d11222285 100644 --- a/server/lib/classes/cron.d/550-bind_dnssec.inc.php +++ b/server/lib/classes/cron.d/550-bind_dnssec.inc.php @@ -35,6 +35,23 @@ class cronjob_bind_dnssec extends cronjob { // job schedule protected $_schedule = '30 3 * * *'; //daily at 3:30 a.m. + protected $_run_at_new = true; + + private $_tools = null; + + /* this function is optional if it contains no custom code */ + public function onPrepare() { + global $app; + + parent::onPrepare(); + } + + /* this function is optional if it contains no custom code */ + public function onBeforeRun() { + global $app; + + return parent::onBeforeRun(); + } private function increase_serial($serial){ global $app, $conf; @@ -71,7 +88,7 @@ class cronjob_bind_dnssec extends cronjob { //TODO : change this when distribution information has been integrated into server record $filespre = (file_exists('/etc/gentoo-release')) ? 'pri/' : 'pri.'; - $soas = $app->db->queryAllRecords('SELECT `id`,`serial`,`origin` FROM dns_soa WHERE server_id=? AND active=\'Y\' AND dnssec_wanted=\'Y\' AND dnssec_initialized=\'Y\' AND (dnssec_last_signed < ? OR dnssec_last_signed > ?)', intval($conf['server_id']), time()-(3600*24*5)+900, time()+900); //Resign zones every 5 days (expiry is 16 days so we have enough safety, 15 minutes tolerance) + $soas = $app->db->queryAllRecords("SELECT id,serial,origin FROM dns_soa WHERE server_id = ? AND active= 'Y' AND dnssec_wanted = 'Y' AND dnssec_initialized = 'Y' AND (dnssec_last_signed < ? OR dnssec_last_signed > ?)", $conf['server_id'], time()-(3600*24*5)+900, time()+900); //Resign zones every 5 days (expiry is 16 days so we have enough safety, 15 minutes tolerance) foreach ($soas as $data) { $domain = substr($data['origin'], 0, strlen($data['origin'])-1); @@ -84,6 +101,13 @@ class cronjob_bind_dnssec extends cronjob { parent::onRunJob(); } + /* this function is optional if it contains no custom code */ + public function onAfterRun() { + global $app; + + parent::onAfterRun(); + } + } -?> \ No newline at end of file +?>