PSR2 Cleanup: /html edition

Travis tests for code conformance. Ignore warnings for now.
Fixed all errors, left most warnings.
This commit is contained in:
Tony Murray
2016-08-18 20:28:22 -05:00
parent f0c82498b5
commit 8c639aa5a4
468 changed files with 6605 additions and 7629 deletions

View File

@@ -154,9 +154,8 @@ if (device_permitted($vars['device']) || $check_device == $vars['device']) {
}
// $loadbalancer_tabs is used in device/loadbalancer/ to build the submenu. we do it here to save queries
if ($device['os'] == 'netscaler')
if ($device['os'] == 'netscaler') {
// Netscaler
{
$device_loadbalancer_count['netscaler_vsvr'] = dbFetchCell('SELECT COUNT(*) FROM `netscaler_vservers` WHERE `device_id` = ?', array($device['device_id']));
if ($device_loadbalancer_count['netscaler_vsvr']) {
$loadbalancer_tabs[] = 'netscaler_vsvr';
@@ -214,7 +213,7 @@ if (device_permitted($vars['device']) || $check_device == $vars['device']) {
$component = new component();
$options['type'] = 'Cisco-OTV';
$options['filter']['device_id'] = array('=',$device['device_id']);
$otv = $component->getComponents(null,$options);
$otv = $component->getComponents(null, $options);
$device_routing_count['cisco-otv'] = count($otv);
if ($device_routing_count['cisco-otv'] > 0) {
$routing_tabs[] = 'cisco-otv';
@@ -265,8 +264,7 @@ if (device_permitted($vars['device']) || $check_device == $vars['device']) {
<img src="images/16/bricks.png" align="absmiddle" border="0" /> Inventory
</a>
</li>';
}
else if (device_permitted($device['device_id']) && $config['enable_inventory'] && @dbFetchCell("SELECT * FROM `hrDevice` WHERE device_id = '".$device['device_id']."'") > '0') {
} elseif (device_permitted($device['device_id']) && $config['enable_inventory'] && @dbFetchCell("SELECT * FROM `hrDevice` WHERE device_id = '".$device['device_id']."'") > '0') {
echo '<li class="'.$select['hrdevice'].'">
<a href="'.generate_device_url($device, array('tab' => 'hrdevice')).'">
<img src="images/16/bricks.png" align="absmiddle" border="0" /> Inventory
@@ -326,11 +324,9 @@ if (device_permitted($vars['device']) || $check_device == $vars['device']) {
if (is_file($configs.$device['hostname'])) {
$device_config_file = $configs.$device['hostname'];
}
elseif (is_file($configs.strtok($device['hostname'], '.'))) { // Strip domain
} elseif (is_file($configs.strtok($device['hostname'], '.'))) { // Strip domain
$device_config_file = $configs.strtok($device['hostname'], '.');
}
else {
} else {
if (!empty($config['mydomain'])) { // Try with domain name if set
if (is_file($configs.$device['hostname'].'.'.$config['mydomain'])) {
$device_config_file = $configs.$device['hostname'].'.'.$config['mydomain'];
@@ -345,13 +341,13 @@ if (device_permitted($vars['device']) || $check_device == $vars['device']) {
}
if ($device_config_file) {
if (dbFetchCell("SELECT COUNT(device_id) FROM devices_attribs WHERE device_id = ? AND attrib_type = 'override_Oxidized_disable' AND attrib_value='true'",array($device['device_id']) ) == '0') {
if (dbFetchCell("SELECT COUNT(device_id) FROM devices_attribs WHERE device_id = ? AND attrib_type = 'override_Oxidized_disable' AND attrib_value='true'", array($device['device_id'])) == '0') {
echo '<li class="'.$select['showconfig'].'">
<a href="'.generate_device_url($device, array('tab' => 'showconfig')).'">
<img src="images/16/page_white_text.png" align="absmiddle" border="0" /> Config
</a>
</li>';
}
}
}
if ($config['nfsen_enable']) {
@@ -415,18 +411,17 @@ if (device_permitted($vars['device']) || $check_device == $vars['device']) {
<li><a href="https://'.$device['hostname'].'" target="_blank"><img src="images/16/http.png" alt="https" title="Launch browser to https://'.$device['hostname'].'" border="0" width="16" height="16" target="_blank"> Web</a></li>
<li><a href="ssh://'.$device['hostname'].'" target="_blank"><img src="images/16/ssh.png" alt="ssh" title="SSH to '.$device['hostname'].'" border="0" width="16" height="16"> SSH</a></li>
<li><a href="telnet://'.$device['hostname'].'" target="_blank"><img src="images/16/telnet.png" alt="telnet" title="Telnet to '.$device['hostname'].'" border="0" width="16" height="16"> Telnet</a></li>';
if (is_admin()) {
echo '<li>
if (is_admin()) {
echo '<li>
<a href="'.generate_device_url($device, array('tab' => 'edit')).'">
<img src="images/16/wrench.png" align="absmiddle" border="0" />
Edit
</a>
</li>';
}
}
echo '</ul>
</div>';
echo '</ul>';
}//end if
if (device_permitted($device['device_id']) || $check_device == $vars['device']) {
@@ -435,8 +430,7 @@ if (device_permitted($vars['device']) || $check_device == $vars['device']) {
require 'pages/device/'.mres(basename($tab)).'.inc.php';
echo '</div>';
}
else {
} else {
require 'includes/error-no-perm.inc.php';
}
}//end if