monitoring/commands: Fix code compliance

refs #6593
This commit is contained in:
Eric Lippmann 2014-09-12 16:53:48 +02:00
parent 9b5c1f06d0
commit 33e0fbb7d9
3 changed files with 13 additions and 11 deletions

View File

@ -27,7 +27,7 @@ class ToggleInstanceFeaturesCommandForm extends CommandForm
*/ */
public function init() public function init()
{ {
$this->setAttrib('class', 'inline'); $this->setAttrib('class', 'inline instance-features');
} }
/** /**
@ -60,19 +60,19 @@ class ToggleInstanceFeaturesCommandForm extends CommandForm
public function createElements(array $formData = array()) public function createElements(array $formData = array())
{ {
if ((bool) $this->status->notifications_enabled) { if ((bool) $this->status->notifications_enabled) {
$description = sprintf( $notificationDescription = sprintf(
'<a title="%s" href="%s" data-base-target="_next">%s</a>', '<a title="%s" href="%s" data-base-target="_next">%s</a>',
mt('monitoring', 'Disable notifications for a specific time on a program-wide basis'), mt('monitoring', 'Disable notifications for a specific time on a program-wide basis'),
$this->getView()->href('monitoring/process/disable-notifications'), $this->getView()->href('monitoring/process/disable-notifications'),
mt('monitoring', 'Disable temporarily') mt('monitoring', 'Disable temporarily')
); );
} elseif ($this->status->disable_notif_expire_time) { } elseif ($this->status->disable_notif_expire_time) {
$description = sprintf( $notificationDescription = sprintf(
mt('monitoring', 'Notifications will be re-enabled in <strong>%s</strong>'), mt('monitoring', 'Notifications will be re-enabled in <strong>%s</strong>'),
$this->getView()->timeUntil($this->status->disable_notif_expire_time) $this->getView()->timeUntil($this->status->disable_notif_expire_time)
); );
} else { } else {
$description = ''; $notificationDescription = null;
} }
$this->addElements(array( $this->addElements(array(
array( array(
@ -113,17 +113,17 @@ class ToggleInstanceFeaturesCommandForm extends CommandForm
array( array(
'label' => mt('monitoring', 'Notifications Enabled'), 'label' => mt('monitoring', 'Notifications Enabled'),
'autosubmit' => true, 'autosubmit' => true,
'description' => $description, 'description' => $notificationDescription,
'decorators' => array( 'decorators' => array(
'ViewHelper', 'ViewHelper',
'Errors', 'Errors',
array( array(
'Description', 'Description',
array('tag' => 'span', 'class' => 'feature-instance-notifications', 'escape' => false) array('tag' => 'span', 'class' => 'description', 'escape' => false)
), ),
'Label', 'Label',
array('HtmlTag', array('tag' => 'div')) array('HtmlTag', array('tag' => 'div'))
), )
) )
), ),
array( array(

View File

@ -7,4 +7,6 @@ namespace Icinga\Module\Monitoring\Command\Transport;
/** /**
* Interface for Icinga command transports * Interface for Icinga command transports
*/ */
interface CommandTransportInterface {} interface CommandTransportInterface
{
}

View File

@ -183,8 +183,8 @@ class RemoteCommandFile implements CommandTransportInterface
$this->path $this->path
) )
); );
$ssh = sprintf('ssh -o BatchMode=yes -p %u', $this->port); // -o BatchMode=yes for disabling interactive $ssh = sprintf('ssh -o BatchMode=yes -p %u', $this->port);
// authentication methods // -o BatchMode=yes for disabling interactive authentication methods
if (isset($this->user)) { if (isset($this->user)) {
$ssh .= sprintf(' -l %s', escapeshellarg($this->user)); $ssh .= sprintf(' -l %s', escapeshellarg($this->user));
} }