Example #1
0
                <button class="btn btn-success" id="submit-boxcar">Add config</button>
                <a href="#" class="btn" data-dismiss="modal">Cancel</a>
            </div>
        </div>
    </div>
</div>
<!-- End Boxcar Modal -->

<?php 
if (isset($_GET['error'])) {
    print_error('We had issues connecting to your Pager Duty account, please try again');
}
if (isset($_GET['account']) && isset($_GET['service_key']) && isset($_GET['service_name'])) {
    set_config_name('alert.transports.pagerduty', $_GET['service_key']);
    set_config_name('alert.pagerduty.account', $_GET['account']);
    set_config_name('alert.pagerduty.service', $_GET['service_name']);
}
$config_groups = get_config_by_group('alerting');
if (isset($config['base_url'])) {
    $callback = $config['base_url'] . '/' . $_SERVER['REQUEST_URI'] . '/';
} else {
    $callback = get_url() . '/';
}
$callback = urlencode($callback);
$general_conf = array(array('name' => 'alert.disable', 'descr' => 'Disable alerting', 'type' => 'checkbox'), array('name' => 'alert.admins', 'descr' => 'Issue alerts to admins', 'type' => 'checkbox'), array('name' => 'alert.globals', 'descr' => 'Issue alerts to read only users', 'type' => 'checkbox'), array('name' => 'alert.syscontact', 'descr' => 'Issue alerts to sysContact', 'type' => 'checkbox'), array('name' => 'alert.default_only', 'descr' => 'Send alerts to default contact only', 'type' => 'checkbox'), array('name' => 'alert.default_mail', 'descr' => 'Default contact', 'type' => 'text'), array('name' => 'alert.tolerance_window', 'descr' => 'Tolerance window for cron', 'type' => 'text'), array('name' => 'alert.fixed-contacts', 'descr' => 'Updates to contact email addresses not honored', 'type' => 'checkbox'));
$mail_conf = array(array('name' => 'alert.transports.mail', 'descr' => 'Enable email alerting', 'type' => 'checkbox'), array('name' => 'email_backend', 'descr' => 'How to deliver mail', 'options' => $dyn_config['email_backend'], 'type' => 'select'), array('name' => 'email_user', 'descr' => 'From name', 'type' => 'text'), array('name' => 'email_from', 'descr' => 'From email address', 'type' => 'text'), array('name' => 'email_html', 'descr' => 'Use HTML emails', 'type' => 'checkbox'), array('name' => 'email_sendmail_path', 'descr' => 'Sendmail path', 'type' => 'text'), array('name' => 'email_smtp_host', 'descr' => 'SMTP Host', 'type' => 'text'), array('name' => 'email_smtp_port', 'descr' => 'SMTP Port', 'type' => 'text'), array('name' => 'email_smtp_timeout', 'descr' => 'SMTP Timeout', 'type' => 'text'), array('name' => 'email_smtp_secure', 'descr' => 'SMTP Secure', 'type' => 'select', 'options' => $dyn_config['email_smtp_secure']), array('name' => 'email_smtp_auth', 'descr' => 'SMTP Authentication', 'type' => 'checkbox'), array('name' => 'email_smtp_username', 'descr' => 'SMTP Authentication Username', 'type' => 'text'), array('name' => 'email_smtp_password', 'descr' => 'SMTP Authentication Password', 'type' => 'text'));
echo '
<div class="panel-group" id="accordion">
    <form class="form-horizontal" role="form" action="" method="post">
';
echo generate_dynamic_config_panel('General alert settings', $config_groups, $general_conf);
Example #2
0
</div>
<!-- End Boxcar Modal -->

<?php 
if (isset($_GET['error'])) {
    print_error('We had issues connecting to your Pager Duty account, please try again');
}
if (isset($_GET['account']) && isset($_GET['service_key']) && isset($_GET['service_name'])) {
    set_config_name('alert.transports.pagerduty', $_GET['service_key']);
    set_config_name('alert.pagerduty.account', $_GET['account']);
    set_config_name('alert.pagerduty.service', $_GET['service_name']);
}
if (isset($vars['del_pagerduty']) && $vars['del_pagerduty'] == true && is_admin() === true) {
    set_config_name('alert.transports.pagerduty', '');
    set_config_name('alert.pagerduty.account', '');
    set_config_name('alert.pagerduty.service', '');
}
$config_groups = get_config_by_group('alerting');
if (isset($config['base_url'])) {
    $callback = $config['base_url'] . '/' . $_SERVER['REQUEST_URI'] . '/';
} else {
    $callback = get_url() . '/';
}
$callback = urlencode($callback);
$general_conf = array(array('name' => 'alert.disable', 'descr' => 'Disable alerting', 'type' => 'checkbox'), array('name' => 'alert.admins', 'descr' => 'Issue alerts to admins', 'type' => 'checkbox'), array('name' => 'alert.globals', 'descr' => 'Issue alerts to read only users', 'type' => 'checkbox'), array('name' => 'alert.syscontact', 'descr' => 'Issue alerts to sysContact', 'type' => 'checkbox'), array('name' => 'alert.default_only', 'descr' => 'Send alerts to default contact only', 'type' => 'checkbox'), array('name' => 'alert.default_mail', 'descr' => 'Default contact', 'type' => 'text'), array('name' => 'alert.tolerance_window', 'descr' => 'Tolerance window for cron', 'type' => 'text'), array('name' => 'alert.fixed-contacts', 'descr' => 'Updates to contact email addresses not honored', 'type' => 'checkbox'));
$mail_conf = array(array('name' => 'alert.transports.mail', 'descr' => 'Enable email alerting', 'type' => 'checkbox'), array('name' => 'email_backend', 'descr' => 'How to deliver mail', 'options' => $dyn_config['email_backend'], 'type' => 'select'), array('name' => 'email_user', 'descr' => 'From name', 'type' => 'text'), array('name' => 'email_from', 'descr' => 'From email address', 'type' => 'text'), array('name' => 'email_html', 'descr' => 'Use HTML emails', 'type' => 'checkbox'), array('name' => 'email_sendmail_path', 'descr' => 'Sendmail path', 'type' => 'text'), array('name' => 'email_smtp_host', 'descr' => 'SMTP Host', 'type' => 'text'), array('name' => 'email_smtp_port', 'descr' => 'SMTP Port', 'type' => 'text'), array('name' => 'email_smtp_timeout', 'descr' => 'SMTP Timeout', 'type' => 'text'), array('name' => 'email_smtp_secure', 'descr' => 'SMTP Secure', 'type' => 'select', 'options' => $dyn_config['email_smtp_secure']), array('name' => 'email_smtp_auth', 'descr' => 'SMTP Authentication', 'type' => 'checkbox'), array('name' => 'email_smtp_username', 'descr' => 'SMTP Authentication Username', 'type' => 'text'), array('name' => 'email_smtp_password', 'descr' => 'SMTP Authentication Password', 'type' => 'password'));
echo '
<div class="panel-group" id="accordion">
    <form class="form-horizontal" role="form" action="" method="post">
';
echo generate_dynamic_config_panel('General alert settings', $config_groups, $general_conf);