Unverified Commit 203bf497 authored by Julien1498's avatar Julien1498 Committed by GitHub
Browse files

Merge pull request #104 from EyesOfNetworkCommunity/admin_notifier

🔒 Fix missing insert in database
parents 98c0eddd 220e1fae
......@@ -208,7 +208,9 @@ function get_field($field1, $base=false, $field2=false) {
$sql_sort_key = sql($database_notifier,"select max(sort_key+1) as sort_key from rules where type=?", array($rule_type));
$rule_sort_key = $sql_sort_key[0]["sort_key"];
$sql_add = "INSERT INTO rules VALUES('',?,?,?,?,?,?,?,?,?,?,?)";
$rule_id = sql($database_notifier,$sql_add, array($rule_name, $rule_type, $rule_debug, $rule_contact, $rule_host, $rule_service, $rule_state, $rule_notification, $rule_timeperiod_id, $rule_sort_key, $rule_track));
sql($database_notifier,$sql_add, array($rule_name, $rule_type, $rule_debug, $rule_contact, $rule_host, $rule_service, $rule_state, $rule_notification, $rule_timeperiod_id, $rule_sort_key, $rule_track));
$rule_id = sql($database_notifier, "SELECT id FROM rules ORDER BY id DESC LIMIT 1");
$rule_id = $rule_id[0][0];
$methodze=explode(",",$rule_method_ids);
foreach($methodze as $selected){
sql($database_notifier,"INSERT INTO rule_method VALUES(?, ?)", array($rule_id, $selected));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment