Skip to content

Commit 59bb14e

Browse files
authored
Merge pull request #25 from netniV/develop
Fix column name for private_key_path
2 parents 33ad5e2 + 279eefd commit 59bb14e

File tree

3 files changed

+25
-14
lines changed

3 files changed

+25
-14
lines changed

INFO

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[info]
2-
name = export
3-
version = 1.4
2+
name = gexport
3+
version = 1.4.1
44
longname = Graph Export Package for Cacti
55
author = The Cacti Group
66
email =

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ If you figure out this problem, see the Cacti forums!
2727
Got any ideas or complaints, please create an issue in GitHub.
2828

2929
## Changelog
30+
31+
--- 1.4.1 --
32+
* issue: Corrects column naming issue introduced in 1.4
33+
3034
--- 1.4 ---
3135
* feature: Added option to clear final directory
3236
* feature: Added option to disable thumbnail creation

setup.php

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,22 +80,18 @@ function gexport_check_upgrade() {
8080
$current = $info['version'];
8181
$old = db_fetch_cell("SELECT version FROM plugin_config WHERE directory='gexport'");
8282

83-
if ($current != $old) {
83+
if (cacti_version_compare($old,$current,'<')) {
8484
if (api_plugin_is_enabled('gexport')) {
8585
# may sound ridiculous, but enables new hooks
8686
api_plugin_enable_hooks('gexport');
8787
}
8888

89-
db_execute("UPDATE plugin_config
90-
SET version='$current'
91-
WHERE directory='gexport'");
92-
93-
db_execute("UPDATE plugin_config SET
94-
version='" . $info['version'] . "',
95-
name='" . $info['longname'] . "',
96-
author='" . $info['author'] . "',
97-
webpage='" . $info['homepage'] . "'
98-
WHERE directory='" . $info['name'] . "' ");
89+
if (cacti_version_compare($old,'1.4.1', '<')) {
90+
if (db_column_exists('graph_exports','export_index_key_path')) {
91+
db_execute('ALTER TABLE graph_exports
92+
CHANGE COLUMN `export_index_key_path` `export_private_key_path` varchar(255)');
93+
}
94+
}
9995

10096
if (cacti_version_compare($old,'1.4','<')) {
10197
gexport_create_table_tasks();
@@ -140,6 +136,17 @@ function gexport_check_upgrade() {
140136
db_execute('ALTER TABLE graph_exports
141137
MODIFY column export_user VARCHAR(40) DEFAULT \'\'');
142138
}
139+
140+
db_execute("UPDATE plugin_config
141+
SET version='$current'
142+
WHERE directory='gexport'");
143+
144+
db_execute("UPDATE plugin_config SET
145+
version='" . $info['version'] . "',
146+
name='" . $info['longname'] . "',
147+
author='" . $info['author'] . "',
148+
webpage='" . $info['homepage'] . "'
149+
WHERE directory='" . $info['name'] . "' ");
143150
}
144151
}
145152

@@ -192,7 +199,7 @@ function gexport_create_table() {
192199
`export_passive` char(3) DEFAULT '',
193200
`export_user` varchar(40) DEFAULT '',
194201
`export_password` varchar(64) DEFAULT '',
195-
`export_private_index_path` varchar(255) DEFAULT '',
202+
`export_private_key_path` varchar(255) DEFAULT '',
196203
`status` int(10) unsigned DEFAULT '0',
197204
`export_pid` int(10) unsigned DEFAULT NULL,
198205
`next_start` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',

0 commit comments

Comments
 (0)