2007-04-03 14:10:23 +00:00
|
|
|
<?php
|
|
|
|
|
2017-11-27 17:45:02 +00:00
|
|
|
$no_refresh = true;
|
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
if ($_SESSION['userlevel'] < '10') {
|
|
|
|
include 'includes/error-no-perm.inc.php';
|
2016-08-18 20:28:22 -05:00
|
|
|
} else {
|
2016-03-16 08:37:15 +10:00
|
|
|
if ($vars['addsrv']) {
|
2015-07-13 20:10:26 +02:00
|
|
|
if ($_SESSION['userlevel'] >= '10') {
|
|
|
|
$updated = '1';
|
|
|
|
|
2016-03-22 07:35:39 +10:00
|
|
|
$service_id = add_service($vars['device'], $vars['type'], $vars['descr'], $vars['ip'], $vars['params'], 0);
|
2015-07-13 20:10:26 +02:00
|
|
|
if ($service_id) {
|
|
|
|
$message .= $message_break.'Service added ('.$service_id.')!';
|
|
|
|
$message_break .= '<br />';
|
|
|
|
}
|
|
|
|
}
|
2011-03-17 00:09:20 +00:00
|
|
|
}
|
2018-01-21 20:56:57 +01:00
|
|
|
foreach (list_available_services() as $current_service) {
|
|
|
|
$servicesform .= "<option value='$current_service'>$current_service</option>";
|
2015-07-13 20:10:26 +02:00
|
|
|
}
|
2011-10-18 14:41:19 +00:00
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
foreach (dbFetchRows('SELECT * FROM `devices` ORDER BY `hostname`') as $device) {
|
2017-05-05 12:25:58 +01:00
|
|
|
$devicesform .= "<option value='".$device['device_id']."'>".format_hostname($device).'</option>';
|
2015-07-13 20:10:26 +02:00
|
|
|
}
|
2015-05-19 17:18:39 +01:00
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
if ($updated) {
|
|
|
|
print_message('Device Settings Saved');
|
|
|
|
}
|
2015-05-19 17:18:39 +01:00
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
$pagetitle[] = 'Add service';
|
2015-05-19 17:18:39 +01:00
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
echo "<div class='row'>
|
|
|
|
<div class='col-sm-6'>";
|
2007-04-03 14:10:23 +00:00
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
include_once 'includes/print-service-add.inc.php';
|
2007-04-03 14:10:23 +00:00
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
echo '</div>
|
|
|
|
</div>';
|
|
|
|
}//end if
|