@@ -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