diff --git a/html/includes/authenticate.inc.php b/html/includes/authenticate.inc.php
index ae08a9664..598e36e6f 100644
--- a/html/includes/authenticate.inc.php
+++ b/html/includes/authenticate.inc.php
@@ -1,20 +1,20 @@
-RRD Log Directory is missing ({$config['rrd_dir']}). Graphing may fail.");
-if(!is_dir($config['temp_dir']))
+if (!is_dir($config['temp_dir']))
echo("
Temp Directory is missing ({$config['tmp_dir']}). Graphing may fail.
");
-if(!is_writable($config['temp_dir']))
+if (!is_writable($config['temp_dir']))
echo("Temp Directory is not writable ({$config['tmp_dir']}). Graphing may fail.
");
-if(isset($_GET['logout']) && $_SESSION['authenticated']) {
+if (isset($_GET['logout']) && $_SESSION['authenticated']) {
mysql_query("INSERT INTO authlog (`user`,`address`,`result`) VALUES ('" . $_SESSION['username'] . "', '".$_SERVER["REMOTE_ADDR"]."', 'logged out')");
unset($_SESSION);
session_destroy();
@@ -24,13 +24,13 @@ if(isset($_GET['logout']) && $_SESSION['authenticated']) {
$auth_message = "Logged Out";
}
-if(isset($_GET['username']) && isset($_GET['password'])){
+if (isset($_GET['username']) && isset($_GET['password'])){
$_SESSION['username'] = mres($_GET['username']);
$_SESSION['password'] = mres($_GET['password']);
-} elseif(isset($_POST['username']) && isset($_POST['password'])){
+} elseif (isset($_POST['username']) && isset($_POST['password'])){
$_SESSION['username'] = mres($_POST['username']);
$_SESSION['password'] = mres($_POST['password']);
-} elseif(isset($_COOKIE['username']) && isset($_COOKIE['password'])){
+} elseif (isset($_COOKIE['username']) && isset($_COOKIE['password'])){
$_SESSION['username'] = mres($_COOKIE['username']);
$_SESSION['password'] = mres($_COOKIE['password']);
}
@@ -58,25 +58,25 @@ if (isset($_SESSION['username']))
{
$_SESSION['userlevel'] = get_userlevel($_SESSION['username']);
$_SESSION['user_id'] = get_userid($_SESSION['username']);
- if(!$_SESSION['authenticated'])
+ if (!$_SESSION['authenticated'])
{
$_SESSION['authenticated'] = true;
mysql_query("INSERT INTO authlog (`user`,`address`,`result`) VALUES ('".$_SESSION['username']."', '".$_SERVER["REMOTE_ADDR"]."', 'logged in')");
header("Location: ".$_SERVER['REQUEST_URI']);
}
- if(isset($_POST['remember']))
+ if (isset($_POST['remember']))
{
setcookie("username", $_SESSION['username'], time()+60*60*24*100, "/");
setcookie("password", $_SESSION['password'], time()+60*60*24*100, "/");
}
$permissions = permissions_cache($_SESSION['user_id']);
- }
- elseif (isset($_SESSION['username']))
- {
- $auth_message = "Authentication Failed";
+ }
+ elseif (isset($_SESSION['username']))
+ {
+ $auth_message = "Authentication Failed";
unset ($_SESSION['authenticated']);
mysql_query("INSERT INTO authlog (`user`,`address`,`result`) VALUES ('".$_SESSION['username']."', '".$_SERVER["REMOTE_ADDR"]."', 'authentication failure')");
}
-}
+}
?>
diff --git a/html/includes/authentication/http-auth.inc.php b/html/includes/authentication/http-auth.inc.php
index 35c32c465..a66fa2b1a 100644
--- a/html/includes/authentication/http-auth.inc.php
+++ b/html/includes/authentication/http-auth.inc.php
@@ -4,14 +4,14 @@ function authenticate($username,$password)
{
global $config;
- if(isset($_SERVER['REMOTE_USER']))
+ if (isset($_SERVER['REMOTE_USER']))
{
$_SESSION['username'] = mres($_SERVER['REMOTE_USER']);
$sql = "SELECT username FROM `users` WHERE `username`='".$_SESSION['username'] . "'";;
$query = mysql_query($sql);
$row = @mysql_fetch_array($query);
- if($row['username'] && $row['username'] == $_SESSION['username'])
+ if ($row['username'] && $row['username'] == $_SESSION['username'])
{
return 1;
}
diff --git a/html/includes/authentication/mysql.inc.php b/html/includes/authentication/mysql.inc.php
index 9885c45fb..74ae3f307 100644
--- a/html/includes/authentication/mysql.inc.php
+++ b/html/includes/authentication/mysql.inc.php
@@ -6,7 +6,7 @@ function authenticate($username,$password)
$sql = "SELECT username FROM `users` WHERE `username`='".$username."' AND `password`='".$encrypted."'";
$query = mysql_query($sql);
$row = @mysql_fetch_array($query);
- if($row['username'] && $row['username'] == $username)
+ if ($row['username'] && $row['username'] == $username)
{
return 1;
}
diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php
index 12999f34c..94617298f 100644
--- a/html/includes/functions.inc.php
+++ b/html/includes/functions.inc.php
@@ -1,6 +1,6 @@
".$device['hostname'];
- if($device['hardware']) { $contents .= " - ".$device['hardware']; }
+ if ($device['hardware']) { $contents .= " - ".$device['hardware']; }
$contents .= "";
$contents .= "";
- if($device['os']) { $contents .= mres($config['os'][$device['os']]['text']); }
- if($device['version']) { $contents .= " ".mres($device['version']); }
- if($device['features']) { $contents .= " (".mres($device['features']).")"; }
-# if($device['hardware']) { $contents .= " - ".$device['hardware']; }
+ if ($device['os']) { $contents .= mres($config['os'][$device['os']]['text']); }
+ if ($device['version']) { $contents .= " ".mres($device['version']); }
+ if ($device['features']) { $contents .= " (".mres($device['features']).")"; }
+# if ($device['hardware']) { $contents .= " - ".$device['hardware']; }
$contents .= "
";
-
# if (isset($device['location'])) { $contents .= "" . htmlentities($device['location'])."
@@ -219,15 +233,15 @@ function generate_port_link($args, $text = NULL, $type = NULL)
{
global $twoday; global $now; global $config; global $day; global $month;
$args = ifNameDescr($args);
- if(!$text) { $text = fixIfName($args['label']); }
- if($type) { $args['graph_type'] = $type; }
- if(!$args['graph_type']) { $args['graph_type'] = 'port_bits'; }
-
+ if (!$text) { $text = fixIfName($args['label']); }
+ if ($type) { $args['graph_type'] = $type; }
+ if (!$args['graph_type']) { $args['graph_type'] = 'port_bits'; }
+
$class = ifclass($args['ifOperStatus'], $args['ifAdminStatus']);
- if(!isset($args['hostname'])) { $args = array_merge($args, device_by_id_cache($args['device_id'])); }
+ if (!isset($args['hostname'])) { $args = array_merge($args, device_by_id_cache($args['device_id'])); }
$content = "
".$args['hostname']." - " . fixifName($args['label']) . "
";
- if($args['ifAlias']) { $content .= $args['ifAlias']."
"; }
+ if ($args['ifAlias']) { $content .= $args['ifAlias']."
"; }
$content .= "
";
$graph_array['type'] = $args['graph_type'];
$graph_array['legend'] = "yes";
@@ -244,26 +258,24 @@ function generate_port_link($args, $text = NULL, $type = NULL)
$graph_array['from'] = $config['year'];
$content .= generate_graph_tag($graph_array);
$content .= "
";
-
+
$url = $config['base_url']."/device/".$args['device_id']."/interface/" . $args['interface_id'] . "/";
- if(port_permitted($args['interface_id'])) {
+ if (port_permitted($args['interface_id'])) {
return overlib_link($url, $text, $content, $class);
} else {
return fixifName($text);
}
-
}
-function generate_port_thumbnail($args)
+function generate_port_thumbnail($args)
{
- if(!$args['bg']) { $args['bg'] = "FFFFF"; }
+ if (!$args['bg']) { $args['bg'] = "FFFFF"; }
$args['content'] = "

";
- $output = generate_port_link($args, $args['content']);
- echo($output);
+ echo generate_port_link($args, $args['content']);
}
-function print_optionbar_start ($height = 20, $width = 0, $marginbottom = 5)
+function print_optionbar_start ($height = 20, $width = 0, $marginbottom = 5)
{
echo("
@@ -278,20 +290,20 @@ function print_optionbar_start ($height = 20, $width = 0, $marginbottom = 5)
}
-function print_optionbar_end ()
+function print_optionbar_end()
{
- echo("
+ echo('
-