Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions library/Director/Core/CoreApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Icinga\Module\Director\Core;

use Exception;
use Icinga\Authentication\Auth;
use Icinga\Exception\NotFoundError;
use Icinga\Module\Director\Db;
use Icinga\Module\Director\Hook\DeploymentHook;
Expand Down Expand Up @@ -834,6 +835,11 @@ public function dumpConfig(IcingaConfig $config, Db $db, $packageName = null)
if ($packageName === null) {
$packageName = $db->settings()->get('icinga_package_name');
}
$username = null;
$auth = Auth::getInstance();
if ($auth->isAuthenticated()) {
$username = $auth->getUser()->getUsername();
}
$start = microtime(true);
/** @var DirectorDeploymentLog $deployment */
$deployment = DirectorDeploymentLog::create(array(
Expand All @@ -842,9 +848,9 @@ public function dumpConfig(IcingaConfig $config, Db $db, $packageName = null)
'peer_identity' => $this->client->getPeerIdentity(),
'start_time' => date('Y-m-d H:i:s'),
'config_checksum' => $config->getChecksum(),
'last_activity_checksum' => $config->getLastActivityChecksum()
'last_activity_checksum' => $config->getLastActivityChecksum(),
'username' => $username
// 'triggered_by' => Util::getUsername(),
// 'username' => Util::getUsername(),
// 'module_name' => $moduleName,
));

Expand Down
1 change: 1 addition & 0 deletions library/Director/Web/Widget/DeploymentInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ protected function createInfoTable()
$table->addNameValuePairs([
$this->translate('Deployment time') => $dep->start_time,
$this->translate('Sent to') => $dep->peer_identity,
$this->translate('Triggered by') => $dep->username,
]);
if ($this->config !== null) {
$table->addNameValuePairs([
Expand Down
Loading