Commit 83d3c44c authored by Till Brehm's avatar Till Brehm
Browse files

Merge branch 'stable-3.1' into 'stable-3.1'

add functions to 550-bind_dnssec.inc.php (see https://www.howtoforge.com/communi…

…ty/threads/dnssec-problem-expire-too-soon-ispconfig-3-1.74682/#post-351381)

See merge request !481
parents 435a99fb 6715f2c8
......@@ -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
?>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment