Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- weathermap-for-observium-master/data-pick.php 2017-07-26 09:04:57.000000000 +0200
- +++ /opt/observium/html/weathermap/data-pick.php 2017-11-17 11:38:03.424615338 +0100
- @@ -38,7 +38,6 @@
- or die('Could not connect: ' . mysqli_error());
- mysqli_select_db($link,$config['db_name']) or die('Could not select database: '.mysqli_error());
- -
- // ******************************************
- function js_escape($str)
- @@ -268,10 +267,11 @@
- // Link query
- //$result = mysql_query("SELECT device_id,hostname FROM devices ORDER BY hostname");
- - $result = mysqli_query($link, "SELECT device_id,hostname FROM devices ORDER BY hostname");
- + $result = mysqli_query($link, "SELECT device_id, device_id as id, hostname FROM devices ORDER BY hostname");
- //$hosts = mysql_fetch_assoc($result);
- //$result = mysql_query($SQL_picklist);
- +
- $hosts = 1;
- ?>
- @@ -304,7 +304,7 @@
- $query = "SELECT devices.device_id,hostname,ports.port_id,ports.ifAlias,ports.ifIndex,ports.ifDescr FROM devices LEFT JOIN ports ON devices.device_id=ports.device_id WHERE ports.disabled=0";
- if($host_id > 0) {
- - $query .= " AND devices.device_id='$host_id'";
- + $query .= " AND devices.device_id=" . (int)$host_id;
- }
- $query .= " ORDER BY hostname,ports.ifAlias";
- @@ -368,9 +368,7 @@
- //$query = mysql_query("SELECT id,hostname AS name FROM `devices` ORDER BY hostname");
- //$hosts = mysql_fetch_assoc($query);
- - $query = mysqli_query("SELECT id,hostname AS name FROM `devices` ORDER BY hostname");
- - $hosts = mysqli_fetch_assoc($query);
- -
- + $query = mysqli_query($link, "SELECT device_id, `device_id` as id,hostname AS name FROM `devices` ORDER BY hostname");
- ?>
- <html>
- <head>
- @@ -469,30 +467,28 @@
- <form name="mini">
- <?php
- -if(sizeof($hosts) > 0) {
- print 'Host: <select name="host_id" onChange="applyDSFilterChange(document.mini)">';
- print '<option '.($host_id==-1 ? 'SELECTED' : '' ).' value="-1">Any</option>';
- print '<option '.($host_id==0 ? 'SELECTED' : '' ).' value="0">None</option>';
- - foreach ($hosts as $host)
- - {
- + while ($host = mysqli_fetch_assoc($result))
- + {
- print '<option ';
- if($host_id==$host['id']) print " SELECTED ";
- print 'value="'.$host['id'].'">'.$host['name'].'</option>';
- }
- print '</select><br />';
- -}
- print '<span class="filter" style="display: none;">Filter: <input id="filterstring" name="filterstring" size="20"> (case-sensitive)<br /></span>';
- print '<input id="overlib" name="overlib" type="checkbox" value="yes" '.($overlib ? 'CHECKED' : '' ).'> <label for="overlib">Set both OVERLIBGRAPH and INFOURL.</label><br />';
- print '</form><div class="listcontainer"><ul id="dslist">';
- //$result = mysql_query($SQL_picklist);
- - $result = mysqli_query($SQL_picklist);
- - if( mysql_num_rows($result) > 0)
- + $result = mysqli_query($link, $SQL_picklist);
- + if( mysqli_num_rows($result) > 0)
- {
- $i=0;
- - while($queryrows = mysql_fetch_assoc($result)) {
- + while($queryrows = mysqli_fetch_assoc($result)) {
- echo "<li class=\"row".($i%2)."\">";
- $key = $queryrows['id'];
- $name = $queryrows['name'];
- diff -ur weathermap-for-observium-master/editor.php /opt/observium/html/weathermap/editor.php
- --- weathermap-for-observium-master/editor.php 2017-07-26 09:04:57.000000000 +0200
- +++ /opt/observium/html/weathermap/editor.php 2017-09-27 22:41:01.000000000 +0200
- @@ -1,10 +1,11 @@
- <?php
- +require_once 'observium-auth.php';
- require_once 'lib/editor.inc.php';
- require_once 'lib/Weathermap.class.php';
- // so that you can't have the editor active, and not know about it.
- -$ENABLED=false;
- +$ENABLED=true; // false;
- if(! $ENABLED)
- {
- Only in /opt/observium/html/weathermap: maps
- Only in /opt/observium/html/weathermap: observium-auth.php
- diff -ur weathermap-for-observium-master/weathermap /opt/observium/html/weathermap/weathermap
- --- weathermap-for-observium-master/weathermap 2017-07-26 09:04:57.000000000 +0200
- +++ /opt/observium/html/weathermap/weathermap 2017-09-27 22:41:01.000000000 +0200
- @@ -283,8 +283,10 @@
- {
- fwrite($fd,
- "<div id=\"overDiv\" style=\"position:absolute; visibility:hidden; z-index:1000;\"></div>\n");
- + fwrite($fd,
- + "<script type=\"text/javascript\">window.ol_fgcolor='#FFFFFF'; window.ol_hauto = true; window.ol_width = 512;</script>\n");
- fwrite($fd,
- - "<script type=\"text/javascript\" src=\"/overlib.js\"><!-- overLIB (c) Erik Bosrup --></script> \n");
- + "<script type=\"text/javascript\" src=\"overlib.js\"><!-- overLIB (c) Erik Bosrup --></script> \n");
- }
- fwrite($fd, $map->MakeHTML());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement