2007-04-03 14:10:23 +00:00
|
|
|
<?php
|
|
|
|
|
2011-03-17 00:09:20 +00:00
|
|
|
if ($_SESSION['userlevel'] < '10')
|
|
|
|
{
|
2011-03-28 10:39:55 +00:00
|
|
|
include("includes/error-no-perm.inc.php");
|
2007-04-03 14:10:23 +00:00
|
|
|
}
|
2011-03-17 00:09:20 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
if ($_POST['addsrv'])
|
|
|
|
{
|
|
|
|
if ($_SESSION['userlevel'] == '10')
|
|
|
|
{
|
|
|
|
include("includes/service-add.inc.php");
|
|
|
|
}
|
|
|
|
}
|
2007-04-03 14:10:23 +00:00
|
|
|
|
2011-03-17 00:09:20 +00:00
|
|
|
if ($handle = opendir($config['install_dir'] . "/includes/services/"))
|
|
|
|
{
|
|
|
|
while (false !== ($file = readdir($handle)))
|
|
|
|
{
|
|
|
|
if ($file != "." && $file != ".." && !strstr($file, "."))
|
|
|
|
{
|
|
|
|
$servicesform .= "<option value='$file'>$file</option>";
|
|
|
|
}
|
2007-04-03 14:10:23 +00:00
|
|
|
}
|
|
|
|
closedir($handle);
|
2011-03-17 00:09:20 +00:00
|
|
|
}
|
2007-04-03 14:10:23 +00:00
|
|
|
|
2011-10-04 09:10:21 +00:00
|
|
|
foreach (dbFetchRows("SELECT * FROM `devices` ORDER BY `hostname`") as $device)
|
2011-03-17 00:09:20 +00:00
|
|
|
{
|
|
|
|
$devicesform .= "<option value='" . $device['device_id'] . "'>" . $device['hostname'] . "</option>";
|
|
|
|
}
|
2007-04-03 14:10:23 +00:00
|
|
|
|
2011-03-17 00:09:20 +00:00
|
|
|
if ($updated) { print_message("Device Settings Saved"); }
|
2007-04-03 14:10:23 +00:00
|
|
|
|
2011-03-17 00:09:20 +00:00
|
|
|
echo("
|
2007-04-03 14:10:23 +00:00
|
|
|
<h4>Add Service</h4>
|
|
|
|
<form id='addsrv' name='addsrv' method='post' action=''>
|
|
|
|
<input type=hidden name='addsrv' value='yes'>
|
|
|
|
<table width='200' border='0'>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
Device
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<select name='device'>
|
|
|
|
$devicesform
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
Type
|
2011-03-17 00:09:20 +00:00
|
|
|
</td>
|
2007-04-03 14:10:23 +00:00
|
|
|
<td>
|
|
|
|
<select name='type'>
|
|
|
|
$servicesform
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td width='300'><div align='right'>Description</div></td>
|
|
|
|
<td colspan='2'><textarea name='descr' cols='50'></textarea></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td width='300'><div align='right'>IP Address</div></td>
|
|
|
|
<td colspan='2'><input name='ip'></textarea></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td width='300'><div align='right'>Parameters</div></td>
|
|
|
|
<td colspan='2'><input name='params'></textarea></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
</table>
|
|
|
|
<input type='submit' name='Submit' value='Add' />
|
|
|
|
<label><br />
|
|
|
|
</label>
|
|
|
|
</form>");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2011-05-13 13:52:01 +00:00
|
|
|
?>
|