mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +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\Hook\JobHook;
|
||||
use Icinga\Module\Director\Web\Form\QuickForm;
|
||||
use Icinga\Module\Director\Objects\SyncRule;
|
||||
|
||||
class SyncJob extends JobHook
|
||||
{
|
||||
protected $rule;
|
||||
|
||||
public function run()
|
||||
{
|
||||
if ($this->getSetting('apply_changes') === 'y') {
|
||||
$this->syncRule()->applyChanges();
|
||||
} else{
|
||||
} else {
|
||||
$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)
|
||||
{
|
||||
return $form->translate(
|
||||
|
Loading…
x
Reference in New Issue
Block a user