Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,17 @@ IMPORTANT NOTE: This version only works on CACTI 1.x++!
## Changes

--- 1.6 ---
* security#205: weathermap_group_move() uses raw SQL instead of parameterized queries
* security#216: Security: defense-in-depth audit findings
* issue#214: In weathermap v1.5, the Hover Graph’s height and width values cannot be modified.
* issue#212: $bgfile used instead of $objfile in ICON writability check in weathermap_repair_maps()
* issue#211: Warn Count is being reset too early
* issue#209: $name clobbered immediately after fetch in weathermap_map_settings_form()
* issue#208: cron field order wrong in weathermap_check_cron() — DOM/month/DOW swapped
* issue#207: liveview uses $map[0]['configfile'] on flat row from db_fetch_row_prepared()
* issue#206: dir() used instead of chdir() in viewimage/viewthumb — working directory never restored
* issue#204: weathermap_footer_links() duplicated across two files
* issue#202: Graph-Preview not working on Release 1.5 after Upgrade
* issue: Attempt to keep the plugin basepath the weathermap directory
* issue: Miscellaneous security hardening and preparation for Cacti 1.3
* feature#219: Add Via Style as a Link form Option
Expand Down
36 changes: 31 additions & 5 deletions lib/WeatherMap.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -688,12 +688,38 @@ function ProcessString($input, &$context, $include_notes = true, $multiline = fa
}

if (strpos($input, 'graph_image.php') !== false) {
if (strpos($input, 'graph_height') === false) {
$input .= '&graph_height=' . read_config_option('weathermap_height');
}
if ($context->my_type() == 'LINK') {
if (strpos($input, 'graph_height') === false) {
if (isset($this->links['DEFAULT']->overlibheight)) {
$input .= '&graph_height=' . $this->links['DEFAULT']->overlibheight;
} else {
$input .= '&graph_height=' . read_config_option('weathermap_height');
Comment thread
TheWitness marked this conversation as resolved.
}
}

if (strpos($input, 'graph_width') === false) {
if (isset($this->links['DEFAULT']->overlibwidth)) {
$input .= '&graph_width=' . $this->links['DEFAULT']->overlibwidth;
} else {
$input .= '&graph_width=' . read_config_option('weathermap_width');
}
Comment on lines +691 to +705
}
Comment thread
TheWitness marked this conversation as resolved.
} elseif ($context->my_type() == 'NODE') {
if (strpos($input, 'graph_height') === false) {
if (isset($this->nodes['DEFAULT']->overlibheight)) {
$input .= '&graph_height=' . $this->nodes['DEFAULT']->overlibheight;
} else {
$input .= '&graph_height=' . read_config_option('weathermap_height');
Comment thread
TheWitness marked this conversation as resolved.
}
}

if (strpos($input, 'graph_width') === false) {
$input .= '&graph_width=' . read_config_option('weathermap_width');
if (strpos($input, 'graph_width') === false) {
if (isset($this->nodes['DEFAULT']->overlibwidth)) {
$input .= '&graph_width=' . $this->nodes['DEFAULT']->overlibwidth;
} else {
$input .= '&graph_width=' . read_config_option('weathermap_width');
}
}
Comment thread
TheWitness marked this conversation as resolved.
}

if (strpos($input, 'graph_nolegend') === false) {
Expand Down
10 changes: 10 additions & 0 deletions setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -1242,3 +1242,13 @@ function weathermap_poller_bottom() {
db_execute('DELETE FROM weathermap_auth WHERE userid > 0 AND userid NOT IN (SELECT id FROM user_auth)');
}
}

function weathermap_footer_links() {
$weathermap_version = plugin_weathermap_numeric_version();

print '<br />';

html_start_box('<a target="_blank" class="linkOverDark" href="docs/">' . __('Local Documentation', 'weathermap') . '</a> -- <a target="_blank" class="linkOverDark" href="http://www.network-weathermap.com/">' . __('Weathermap Website', 'weathermap') . '</a> -- <a target="_target" class="linkOverDark" href="weathermap-cacti-plugin-editor.php">' . __('Weathermap Editor', 'weathermap') . '</a> -- ' . __('This is version %s', $weathermap_version), '100%', false, 3, 'center', '');
Comment thread
TheWitness marked this conversation as resolved.
Outdated

html_end_box();
}
Comment thread
TheWitness marked this conversation as resolved.
10 changes: 0 additions & 10 deletions weathermap-cacti-plugin-mgmt.php
Original file line number Diff line number Diff line change
Expand Up @@ -560,16 +560,6 @@ function weathermap_form_actions() {
bottom_footer();
}

function weathermap_footer_links() {
$weathermap_version = plugin_weathermap_numeric_version();

print '<br />';

html_start_box('<a target="_blank" class="linkOverDark" href="docs/">' . __('Local Documentation', 'weathermap') . '</a> -- <a target="_blank" class="linkOverDark" href="http://www.network-weathermap.com/">' . __('Weathermap Website', 'weathermap') . '</a> -- <a target="_target" class="linkOverDark" href="weathermap-cacti-plugin-editor.php">' . __('Weathermap Editor', 'weathermap') . '</a> -- ' . __('This is version %s', $weathermap_version), '100%', false, 3, 'center', '');

html_end_box();
}

/**
* Repair the sort order column (for when something is deleted or inserted,
* or moved between groups) our primary concern is to make the sort order
Expand Down
58 changes: 24 additions & 34 deletions weathermap-cacti-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -762,15 +762,6 @@ function readfile_chunked($filename) {
return $status;
}

function weathermap_footer_links() {
$weathermap_version = plugin_weathermap_numeric_version();

print '<br />';

html_start_box("<center><a target=\"_blank\" class=\"linkOverDark\" href=\"docs/\">Local Documentation</a> -- <a target=\"_blank\" class=\"linkOverDark\" href=\"http://www.network-weathermap.com/\">Weathermap Website</a> -- <a target=\"_target\" class=\"linkOverDark\" href=\"weathermap-cacti-plugin-editor.php?plug=1\">Weathermap Editor</a> -- This is version $weathermap_version</center>", '100%', false, 3, 'center', '');
html_end_box();
}

function weathermap_mapselector($current_id = 0) {
$show_selector = intval(read_config_option('weathermap_map_selector'));

Expand Down Expand Up @@ -810,39 +801,38 @@ function weathermap_mapselector($current_id = 0) {
<?php

$ngroups = 0;
$lastgroup = '------lasdjflkjsdlfkjlksdjflksjdflkjsldjlkjsd';
$nullhash = '';
$lastgroup = '------lasdjflkjsdlfkjlksdjflksjdflkjsldjlkjsd';

foreach ($maps as $map) {
if ($current_id == $map['id']) {
$nullhash = $map['filehash'];
}
foreach ($maps as $map) {
if ($current_id == $map['id']) {
$nullhash = $map['filehash'];
}

if ($map['name'] != $lastgroup) {
$ngroups++;
if ($map['name'] != $lastgroup) {
$ngroups++;

$lastgroup = $map['name'];
}
}

$lastgroup = '------lasdjflkjsdlfkjlksdjflksjdflkjsldjlkjsd';
$lastgroup = $map['name'];
}
}

foreach ($maps as $map) {
if ($ngroups > 1 && $map['name'] != $lastgroup) {
print "<option disabled style='font-weight: bold; font-style: italic' value='$nullhash'>" . html_escape($map['name']) . '</option>';
$lastgroup = $map['name'];
}
foreach ($maps as $map) {
if ($ngroups > 1 && $map['name'] != $lastgroup) {
print "<option disabled style='font-weight: bold; font-style: italic' value='$nullhash'>" . html_escape($map['name']) . '</option>';
$lastgroup = $map['name'];
}
Comment thread
TheWitness marked this conversation as resolved.

print '<option ';
print '<option ';

if ($current_id == $map['id']) {
print 'selected ';
}
if ($current_id == $map['id']) {
print 'selected ';
}

print 'value="' . $map['filehash'] . '">';
print 'value="' . $map['filehash'] . '">';

print html_escape($map['titlecache']) . '</option>';
}
?>
print html_escape($map['titlecache']) . '</option>';
}
?>
</select>
</td>
</tr>
Expand Down