diff --git a/html/forms/update-config-item.inc.php b/html/forms/update-config-item.inc.php index 1671d2f27..b7604a325 100644 --- a/html/forms/update-config-item.inc.php +++ b/html/forms/update-config-item.inc.php @@ -22,12 +22,7 @@ if (!is_numeric($_POST['config_id'])) { $message = 'ERROR: No alert selected'; exit; } else { - if($_POST['config_value'] === true) { - $state = TRUE; - } else { - $state = FALSE; - } - $state = $_POST['config_value']; + $state = mres($_POST['config_value']); $update = dbUpdate(array('config_value' => $state), 'config', '`config_id`=?', array($_POST['config_id'])); if(!empty($update) || $update == '0') { @@ -39,4 +34,4 @@ if (!is_numeric($_POST['config_id'])) { } $response = array('status'=>$status,'message'=>$message); -echo _json_encode($response); \ No newline at end of file +echo _json_encode($response); diff --git a/html/pages/settings/alerting.inc.php b/html/pages/settings/alerting.inc.php index 66a058440..0cc6811a1 100644 --- a/html/pages/settings/alerting.inc.php +++ b/html/pages/settings/alerting.inc.php @@ -22,6 +22,7 @@ if (isset($_GET['account']) && isset($_GET['service_key']) && isset($_GET['servi set_config_name('alert,pagerduty,service',$_GET['service_name']); } +// Default settings config $admin_config = get_config_by_name('alert,admins'); if (strcasecmp($admin_config[0]['config_value'],"true") == 0) { $admin_checked = 'checked'; @@ -41,6 +42,31 @@ if (strcasecmp($default_only_config[0]['config_value'],"true") == 0) { $default_only_checked = ''; } $default_mail_config = get_config_by_name('alert,default_mail'); +$tolerance_window_config = get_config_by_name('alert,tolerance_window'); + +// Mail transport config +$email_transport_config = get_config_by_name('alert,transports,mail'); +if (strcasecmp($email_transport_config[0]['config_value'],"true") == 0) { + $email_transport_checked = 'checked'; +} else { + $email_transport_checked = ''; +} +$email_backend_config = get_config_by_name('email_backend'); +$email_from_config = get_config_by_name('email_from'); +$email_user_config = get_config_by_name('email_user'); +$email_sendmail_path_config = get_config_by_name('email_sendmail_path'); +$email_smtp_host_config = get_config_by_name('email_smtp_host'); +$email_smtp_port_config = get_config_by_name('email_smtp_port'); +$email_smtp_timeout_config = get_config_by_name('email_smtp_timeout'); +$email_smtp_secure_config = get_config_by_name('email_smtp_secure'); +$email_smtp_auth_config = get_config_by_name('email_smtp_auth'); +if (strcasecmp($email_smtp_auth_config[0]['config_value'],"true") == 0) { + $email_smtp_auth_checked = 'checked'; +} else { + $email_smtp_auth_checked = ''; +} +$email_smtp_username_config = get_config_by_name('email_smtp_username'); +$email_smtp_password_config = get_config_by_name('email_smtp_password'); if (isset($config['base_url'])) { $callback = $config['base_url'].'/'.$_SERVER['REQUEST_URI'].'/'; @@ -50,48 +76,203 @@ if (isset($config['base_url'])) { $callback = urlencode($callback); echo ' -
-
-
-
-
- -
- +
+ +
+ +
+
+
+ +
+
+ +
+
+
+ +
+
+ +
+
+
+ +
+
+ +
+
+
+ +
+
+ + +
+
+
+ +
+
+ + +
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
-
- Connect to PagerDuty -
-
- +
-
+
+
+

+ Email transport +

+
+
+
+
+ +
+
+ +
+
+
+ +
+
+ + +
+
+
+ +
+
+ + +
+
+
+ +
+
+ + +
+
+
+ +
+
+ + +
+
+
+ +
+
+ + +
+
+
+ +
+
+ + +
+
+
+ +
+
+ + +
+
+
+ +
+
+ + +
+
+
+ +
+
+ +
+
+
+ +
+
+ + +
+
+
+ +
+
+ + +
+
+
+
+
+
+
+

+ API transport +

+
+
+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+ Connect to PagerDuty +
+
+
+
+
+
'; ?>