data = $data; } public function apply() { $transportConfig = $this->data['transportConfig']; $transportName = $transportConfig['name']; unset($transportConfig['name']); try { Config::fromArray(array($transportName => $transportConfig)) ->setConfigFile(Config::resolvePath('modules/monitoring/commandtransports.ini')) ->saveIni(); } catch (Exception $e) { $this->error = $e; return false; } $this->error = false; return true; } public function getSummary() { switch ($this->data['transportConfig']['transport']) { case 'local': $details = '
' . sprintf( mt( 'monitoring', 'Icinga Web 2 will use the named pipe located at "%s"' . ' to send commands to your monitoring instance.' ), $this->data['transportConfig']['path'] ) . '
'; break; case 'remote': $details = '' . sprintf( mt( 'monitoring', 'Icinga Web 2 will use the named pipe located on a remote machine at "%s" to send commands' . ' to your monitoring instance by using the connection details listed below:' ), $this->data['transportConfig']['path'] ) . '
' . '' . mt('monitoring', 'Remote Host') . ' | ' . '' . $this->data['transportConfig']['host'] . ' | ' . '
' . mt('monitoring', 'Remote SSH Port') . ' | ' . '' . $this->data['transportConfig']['port'] . ' | ' . '
' . mt('monitoring', 'Remote SSH User') . ' | ' . '' . $this->data['transportConfig']['user'] . ' | ' . '
' . mt( 'monitoring', 'Icinga Web 2 will use the Icinga 2 API to send commands' . ' to your monitoring instance by using the connection details listed below:' ) . '
' . '' . mt('monitoring', 'Host') . ' | ' . '' . $this->data['transportConfig']['host'] . ' | ' . '
' . mt('monitoring', 'Port') . ' | ' . '' . $this->data['transportConfig']['port'] . ' | ' . '
' . mt('monitoring', 'Username') . ' | ' . '' . $this->data['transportConfig']['username'] . ' | ' . '
' . mt('monitoring', 'Password') . ' | ' . '' . str_repeat('*', strlen($this->data['transportConfig']['password'])) . ' | ' . '