mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-30 01:04:12 +02:00
IcingaConfig: fix activity links
This commit is contained in:
parent
48d876556c
commit
32cca9d2c6
@ -9,8 +9,11 @@ class Director_ShowController extends ActionController
|
|||||||
public function activitylogAction()
|
public function activitylogAction()
|
||||||
{
|
{
|
||||||
if ($id = $this->params->get('id')) {
|
if ($id = $this->params->get('id')) {
|
||||||
$this->view->entry = $this->db()->fetchActivityLogEntry($id);
|
$this->view->entry = $this->db()->fetchActivityLogEntryById($id);
|
||||||
$this->view->title = $this->translate('Activity');
|
} elseif ($checksum = $this->params->get('checksum')) {
|
||||||
|
$this->view->entry = $this->db()->fetchActivityLogEntry(pack('H*', $checksum));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->view->title = $this->translate('Activity');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,13 +17,20 @@ class Db extends DbConnection
|
|||||||
return $this->getDbAdapter();
|
return $this->getDbAdapter();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function fetchActivityLogEntry($id)
|
public function fetchActivityLogEntryById($id)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT * FROM director_activity_log WHERE id = ' . (int) $id;
|
$sql = 'SELECT * FROM director_activity_log WHERE id = ' . (int) $id;
|
||||||
|
|
||||||
return $this->db()->fetchRow($sql);
|
return $this->db()->fetchRow($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function fetchActivityLogEntry($checksum)
|
||||||
|
{
|
||||||
|
$sql = 'SELECT * FROM director_activity_log WHERE checksum = ?';
|
||||||
|
|
||||||
|
return $this->db()->fetchRow($sql, $checksum);
|
||||||
|
}
|
||||||
|
|
||||||
public function getLastActivityChecksum()
|
public function getLastActivityChecksum()
|
||||||
{
|
{
|
||||||
$select = "SELECT checksum FROM (SELECT * FROM (SELECT 1 AS pos, LOWER(HEX(checksum)) AS checksum FROM director_activity_log ORDER BY change_time DESC LIMIT 1) a UNION SELECT 2 AS pos, '' AS checksum) u ORDER BY pos LIMIT 1";
|
$select = "SELECT checksum FROM (SELECT * FROM (SELECT 1 AS pos, LOWER(HEX(checksum)) AS checksum FROM director_activity_log ORDER BY change_time DESC LIMIT 1) a UNION SELECT 2 AS pos, '' AS checksum) u ORDER BY pos LIMIT 1";
|
||||||
|
@ -202,7 +202,7 @@ class IcingaConfig
|
|||||||
)->where('checksum = ?', $checksum);
|
)->where('checksum = ?', $checksum);
|
||||||
$result = $this->db->fetchRow($query);
|
$result = $this->db->fetchRow($query);
|
||||||
$this->checksum = $result->checksum;
|
$this->checksum = $result->checksum;
|
||||||
$this->last_activity_checksum = $result->last_activity_checksum;
|
$this->lastActivityChecksum = $result->last_activity_checksum;
|
||||||
$query = $this->db->select()->from(
|
$query = $this->db->select()->from(
|
||||||
array('cf' => 'director_generated_config_file'),
|
array('cf' => 'director_generated_config_file'),
|
||||||
array(
|
array(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user