mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
More changes
This commit is contained in:
@@ -179,9 +179,11 @@ else if ($action == 'add-clickatell') {
|
|||||||
$status = 'ok';
|
$status = 'ok';
|
||||||
$message = 'Config item created';
|
$message = 'Config item created';
|
||||||
$mobiles = explode('\n', $config_to);
|
$mobiles = explode('\n', $config_to);
|
||||||
|
$x=0;
|
||||||
foreach ($mobiles as $mobile) {
|
foreach ($mobiles as $mobile) {
|
||||||
if (!empty($mobile)) {
|
if (!empty($mobile)) {
|
||||||
dbInsert(array('config_name' => 'alert.transports.clickatell.'.$config_id.'.to.', 'config_value' => $mobile, 'config_group' => $config_group, 'config_sub_group' => $config_sub_group, 'config_default' => $v, 'config_descr' => 'Clickatell mobile'), 'config');
|
dbInsert(array('config_name' => 'alert.transports.clickatell.'.$config_id.'.to.'.$x, 'config_value' => $mobile, 'config_group' => $config_group, 'config_sub_group' => $config_sub_group, 'config_default' => $v, 'config_descr' => 'Clickatell mobile'), 'config');
|
||||||
|
$x++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -210,9 +212,11 @@ elseif ($action == 'add-playsms') {
|
|||||||
$status = 'ok';
|
$status = 'ok';
|
||||||
$message = 'Config item created';
|
$message = 'Config item created';
|
||||||
$mobiles = explode('\n', $config_to);
|
$mobiles = explode('\n', $config_to);
|
||||||
|
$x=0;
|
||||||
foreach ($mobiles as $mobile) {
|
foreach ($mobiles as $mobile) {
|
||||||
if (!empty($mobile)) {
|
if (!empty($mobile)) {
|
||||||
dbInsert(array('config_name' => 'alert.transports.playsms.'.$config_id.'.to.', 'config_value' => $mobile, 'config_group' => $config_group, 'config_sub_group' => $config_sub_group, 'config_default' => $v, 'config_descr' => 'PlaySMS mobile'), 'config');
|
dbInsert(array('config_name' => 'alert.transports.playsms.'.$config_id.'.to.'.$x, 'config_value' => $mobile, 'config_group' => $config_group, 'config_sub_group' => $config_sub_group, 'config_default' => $v, 'config_descr' => 'PlaySMS mobile'), 'config');
|
||||||
|
$x++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ if (!is_numeric($config_id)) {
|
|||||||
}
|
}
|
||||||
elseif ($action == 'update-textarea') {
|
elseif ($action == 'update-textarea') {
|
||||||
$extras = explode(PHP_EOL, $_POST['config_value']);
|
$extras = explode(PHP_EOL, $_POST['config_value']);
|
||||||
|
$x=0;
|
||||||
foreach ($extras as $option) {
|
foreach ($extras as $option) {
|
||||||
list($k,$v) = explode('=', $option, 2);
|
list($k,$v) = explode('=', $option, 2);
|
||||||
if (!empty($k) || !empty($v)) {
|
if (!empty($k) || !empty($v)) {
|
||||||
@@ -43,10 +44,12 @@ elseif ($action == 'update-textarea') {
|
|||||||
$db_id[] = dbInsert(array('config_name' => 'alert.transports.boxcar.'.$config_id.'.'.$k, 'config_value' => $v, 'config_group' => 'alerting', 'config_sub_group' => 'transports', 'config_default' => $v, 'config_descr' => 'Boxcar Transport'), 'config');
|
$db_id[] = dbInsert(array('config_name' => 'alert.transports.boxcar.'.$config_id.'.'.$k, 'config_value' => $v, 'config_group' => 'alerting', 'config_sub_group' => 'transports', 'config_default' => $v, 'config_descr' => 'Boxcar Transport'), 'config');
|
||||||
}
|
}
|
||||||
elseif ($config_type == 'clickatell') {
|
elseif ($config_type == 'clickatell') {
|
||||||
$db_id[] = dbInsert(array('config_name' => 'alert.transports.clickatell.'.$config_id.'.to.', 'config_value' => $k, 'config_group' => 'alerting', 'config_sub_group' => 'transports', 'config_default' => $v, 'config_descr' => 'Clickatell Transport'), 'config');
|
$db_id[] = dbInsert(array('config_name' => 'alert.transports.clickatell.'.$config_id.'.to.'.$x, 'config_value' => $k, 'config_group' => 'alerting', 'config_sub_group' => 'transports', 'config_default' => $v, 'config_descr' => 'Clickatell Transport'), 'config');
|
||||||
|
$x++;
|
||||||
}
|
}
|
||||||
elseif ($config_type == 'playsms') {
|
elseif ($config_type == 'playsms') {
|
||||||
$db_id[] = dbInsert(array('config_name' => 'alert.transports.playsms.'.$config_id.'.to.', 'config_value' => $k, 'config_group' => 'alerting', 'config_sub_group' => 'transports', 'config_default' => $v, 'config_descr' => 'PlaySMS Transport'), 'config');
|
$db_id[] = dbInsert(array('config_name' => 'alert.transports.playsms.'.$config_id.'.to.'.$x, 'config_value' => $k, 'config_group' => 'alerting', 'config_sub_group' => 'transports', 'config_default' => $v, 'config_descr' => 'PlaySMS Transport'), 'config');
|
||||||
|
$x++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user