solve some php warnings

git-svn-id: http://www.observium.org/svn/observer/trunk@1689 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2010-08-21 14:02:24 +00:00
parent a92ce17f21
commit 05b189a0c7
3 changed files with 14 additions and 7 deletions

View File

@@ -29,7 +29,9 @@ $config['nagios_plugins'] = "/usr/lib/nagios/plugins";
### Web Interface Settings
$config['base_url'] = "http://" . $_SERVER["SERVER_NAME"] .":".$_SERVER["SERVER_PORT"];
if(isset($_SERVER["SERVER_NAME"]) && isset($_SERVER["SERVER_PORT"])) {
$config['base_url'] = "http://" . $_SERVER["SERVER_NAME"] .":".$_SERVER["SERVER_PORT"];
}
$config['title_image'] = "images/observium-logo.png";
$config['stylesheet'] = "css/styles.css";
$config['mono_font'] = "DejaVuSansMono";

View File

@@ -276,7 +276,7 @@ function addHost($host, $community, $snmpver, $port = 161)
function scanUDP ($host, $port, $timeout)
{
$handle = fsockopen($host, $port, &$errno, &$errstr, 2);
$handle = fsockopen($host, $port, $errno, $errstr, 2);
if (!$handle) {
}
socket_set_timeout ($handle, $timeout);

View File

@@ -725,15 +725,18 @@ if (isset($config['enable_printers']) && $config['enable_printers'])
$config['version'] = "0.10";
$config['rrdgraph_def_text'] = str_replace(" ", " ", $config['rrdgraph_def_text']);
$config['rrd_opts_array'] = explode(" ", trim($config['rrdgraph_def_text']));
if(isset($config['rrdgraph_def_text']))
{
$config['rrdgraph_def_text'] = str_replace(" ", " ", $config['rrdgraph_def_text']);
$config['rrd_opts_array'] = explode(" ", trim($config['rrdgraph_def_text']));
}
if(!isset($config['log_file']))
{
$config['log_file'] = $config['install_dir'] . "/observium.log";
}
if(!$config['mibdir'])
if(isset($config['mibdir']))
{
$config['mibdir'] = $config['install_dir']."/mibs/";
}
@@ -749,13 +752,15 @@ $nagios_db = mysql_select_db($config['nagios_db_name'], $nagios_link);
}
# If we're on SSL, let's properly detect it
if(isset($_SERVER['HTTPS'])) {
if(isset($_SERVER['HTTPS']))
{
$config['base_url'] = preg_replace('/^http:/','https:', $config['base_url']);
}
### Connect to database
$observium_link = mysql_pconnect($config['db_host'], $config['db_user'], $config['db_pass']);
if (!$observium_link) {
if (!$observium_link)
{
echo "<h2>Observer MySQL Error</h2>";
echo mysql_error();
die;