mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-09-25 18:59:05 +02:00
SyncJob: really run, add check for changes
This commit is contained in:
parent
2007dee6c0
commit
cea75ead0e
@ -5,18 +5,30 @@ namespace Icinga\Module\Director\Job;
|
|||||||
use Icinga\Module\Director\Db;
|
use Icinga\Module\Director\Db;
|
||||||
use Icinga\Module\Director\Hook\JobHook;
|
use Icinga\Module\Director\Hook\JobHook;
|
||||||
use Icinga\Module\Director\Web\Form\QuickForm;
|
use Icinga\Module\Director\Web\Form\QuickForm;
|
||||||
|
use Icinga\Module\Director\Objects\SyncRule;
|
||||||
|
|
||||||
class SyncJob extends JobHook
|
class SyncJob extends JobHook
|
||||||
{
|
{
|
||||||
|
protected $rule;
|
||||||
|
|
||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
if ($this->getSetting('apply_changes') === 'y') {
|
if ($this->getSetting('apply_changes') === 'y') {
|
||||||
$this->syncRule()->applyChanges();
|
$this->syncRule()->applyChanges();
|
||||||
} else{
|
} else {
|
||||||
$this->syncRule()->checkForChanges();
|
$this->syncRule()->checkForChanges();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function syncRule()
|
||||||
|
{
|
||||||
|
if ($this->rule === null) {
|
||||||
|
$this->rule = SyncRule::load($this->getSetting('rule_id'), $this->db());
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->rule;
|
||||||
|
}
|
||||||
|
|
||||||
public static function getDescription(QuickForm $form)
|
public static function getDescription(QuickForm $form)
|
||||||
{
|
{
|
||||||
return $form->translate(
|
return $form->translate(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user