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()
|
||||
{
|
||||
if ($id = $this->params->get('id')) {
|
||||
$this->view->entry = $this->db()->fetchActivityLogEntry($id);
|
||||
$this->view->title = $this->translate('Activity');
|
||||
$this->view->entry = $this->db()->fetchActivityLogEntryById($id);
|
||||
} 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();
|
||||
}
|
||||
|
||||
public function fetchActivityLogEntry($id)
|
||||
public function fetchActivityLogEntryById($id)
|
||||
{
|
||||
$sql = 'SELECT * FROM director_activity_log WHERE id = ' . (int) $id;
|
||||
|
||||
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()
|
||||
{
|
||||
$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);
|
||||
$result = $this->db->fetchRow($query);
|
||||
$this->checksum = $result->checksum;
|
||||
$this->last_activity_checksum = $result->last_activity_checksum;
|
||||
$this->lastActivityChecksum = $result->last_activity_checksum;
|
||||
$query = $this->db->select()->from(
|
||||
array('cf' => 'director_generated_config_file'),
|
||||
array(
|
||||
|
|
Loading…
Reference in New Issue