From afd8011d02a3a3034e68c6ea43afe6a5ce53f21c Mon Sep 17 00:00:00 2001 From: Charlene Auger Date: Tue, 11 Dec 2018 11:04:27 +0100 Subject: [PATCH 1/4] Update plugin for extension engine --- hook.xml | 13 +++++++++ infos.json | 2 ++ install.php | 57 ++++++++++++++++++++-------------------- language/en_GB/en_GB.txt | 1 + language/fr_FR/fr_FR.txt | 1 + 5 files changed, 46 insertions(+), 28 deletions(-) create mode 100644 hook.xml create mode 100644 language/en_GB/en_GB.txt create mode 100644 language/fr_FR/fr_FR.txt diff --git a/hook.xml b/hook.xml new file mode 100644 index 0000000..1e30720 --- /dev/null +++ b/hook.xml @@ -0,0 +1,13 @@ + + + + en_GB + fr_FR + + + cd_crontabtasks + 24000 + config + crontabtasks + + diff --git a/infos.json b/infos.json index 8fef059..36671a8 100644 --- a/infos.json +++ b/infos.json @@ -3,6 +3,8 @@ "author" : ["Guillaume PROTET", "Valentin DEVILLE"], "contributor" : ["Frank BOURDEAU"], "supportedAgent" : ["Unix"], + "version" : "1.1", + "licence" : "GPLv2", "description" : { "fr" : "Remonte les crontab", "en" : "Retrieve crontab tasks" diff --git a/install.php b/install.php index ab948c3..9c24580 100644 --- a/install.php +++ b/install.php @@ -1,38 +1,39 @@ 'crontabTasks', -'version' => '1.1', -'author'=> 'Guillaume PROTET, Valentin DEVILLE', -'license' => 'GPLv2', -'verMinOcs' => '2.2'); -} -function plugin_init_crontabTasks() +/** + * This function is called on installation and is used to create database schema for the plugin + */ +function extension_install_crontabTasks() { -$object = new plugins; -$object -> add_cd_entry("crontabtasks","config"); + $commonObject = new ExtensionCommon; -$object -> sql_query("CREATE TABLE IF NOT EXISTS `crontabtasks` ( - `ID` INT(11) NOT NULL AUTO_INCREMENT, - `HARDWARE_ID` INT(11) NOT NULL, - `USER` varchar(255) DEFAULT NULL, - `CRON` varchar(255) DEFAULT NULL, - `MINUTE` varchar(3) DEFAULT NULL, - `HOUR` varchar(2) DEFAULT NULL, - `DOM` varchar(1) DEFAULT NULL, - `MONTH` varchar(1) DEFAULT NULL, - `DOW` varchar(1) DEFAULT NULL, - PRIMARY KEY (`ID`,`HARDWARE_ID`) - ) ENGINE=INNODB;" -); + $commonObject -> sqlQuery("CREATE TABLE IF NOT EXISTS `crontabtasks` ( + `ID` INT(11) NOT NULL AUTO_INCREMENT, + `HARDWARE_ID` INT(11) NOT NULL, + `USER` varchar(255) DEFAULT NULL, + `CRON` varchar(255) DEFAULT NULL, + `MINUTE` varchar(3) DEFAULT NULL, + `HOUR` varchar(2) DEFAULT NULL, + `DOM` varchar(1) DEFAULT NULL, + `MONTH` varchar(1) DEFAULT NULL, + `DOW` varchar(1) DEFAULT NULL, + PRIMARY KEY (`ID`,`HARDWARE_ID`) + ) ENGINE=INNODB;"); +} +/** + * This function is called on removal and is used to destroy database schema for the plugin + */ +function extension_delete_crontabTasks() +{ + $commonObject = new ExtensionCommon; + $commonObject -> sqlQuery("DROP TABLE `crontabtasks`"); } -function plugin_delete_crontabTasks() +/** + * This function is called on plugin upgrade + */ +function extension_upgrade_crontabTasks() { -$object = new plugins; -$object -> del_cd_entry("crontabtasks"); -$object -> sql_query("DROP TABLE `crontabtasks`"); } diff --git a/language/en_GB/en_GB.txt b/language/en_GB/en_GB.txt new file mode 100644 index 0000000..0d83fa6 --- /dev/null +++ b/language/en_GB/en_GB.txt @@ -0,0 +1 @@ +24000 Crontab Tasks diff --git a/language/fr_FR/fr_FR.txt b/language/fr_FR/fr_FR.txt new file mode 100644 index 0000000..0d83fa6 --- /dev/null +++ b/language/fr_FR/fr_FR.txt @@ -0,0 +1 @@ +24000 Crontab Tasks From 87ab0b74a8d1da8931e2910f1968b6a829bd4ad7 Mon Sep 17 00:00:00 2001 From: Charlene Auger Date: Fri, 14 Dec 2018 10:43:29 +0100 Subject: [PATCH 2/4] Remove upcase --- APACHE/{CrontabTaks.conf => crontabtaks.conf} | 0 APACHE/{Map.pm => map.pm} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename APACHE/{CrontabTaks.conf => crontabtaks.conf} (100%) rename APACHE/{Map.pm => map.pm} (100%) diff --git a/APACHE/CrontabTaks.conf b/APACHE/crontabtaks.conf similarity index 100% rename from APACHE/CrontabTaks.conf rename to APACHE/crontabtaks.conf diff --git a/APACHE/Map.pm b/APACHE/map.pm similarity index 100% rename from APACHE/Map.pm rename to APACHE/map.pm From 3e7a0eef597db33bf41f32e10fc0a199c1374a52 Mon Sep 17 00:00:00 2001 From: Charlene Auger Date: Wed, 9 Jan 2019 09:31:01 +0100 Subject: [PATCH 3/4] Rename map.pm to Map.pm --- APACHE/{map.pm => Map.pm} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename APACHE/{map.pm => Map.pm} (100%) diff --git a/APACHE/map.pm b/APACHE/Map.pm similarity index 100% rename from APACHE/map.pm rename to APACHE/Map.pm From d639f3035999871707d74aa20e07998635a175df Mon Sep 17 00:00:00 2001 From: Charlene Auger Date: Wed, 9 Jan 2019 11:21:18 +0100 Subject: [PATCH 4/4] fix bug installation --- APACHE/Map.pm | 9 ++++----- APACHE/crontabtaks.conf | 1 - APACHE/crontabtasks.conf | 1 + infos.json | 2 +- install.php | 6 +++--- 5 files changed, 9 insertions(+), 10 deletions(-) delete mode 100644 APACHE/crontabtaks.conf create mode 100644 APACHE/crontabtasks.conf diff --git a/APACHE/Map.pm b/APACHE/Map.pm index 20ff452..ccacbfa 100644 --- a/APACHE/Map.pm +++ b/APACHE/Map.pm @@ -1,9 +1,9 @@ - -package Apache::Ocsinventory::Plugins::CrontabTasks::Map; - + +package Apache::Ocsinventory::Plugins::Crontabtasks::Map; + use strict; - + use Apache::Ocsinventory::Map; $DATA_MAP{crontabtasks} = { @@ -25,4 +25,3 @@ $DATA_MAP{crontabtasks} = { } }; 1; - diff --git a/APACHE/crontabtaks.conf b/APACHE/crontabtaks.conf deleted file mode 100644 index eef542e..0000000 --- a/APACHE/crontabtaks.conf +++ /dev/null @@ -1 +0,0 @@ -PerlModule Apache::Ocsinventory::Plugins::CrontabTasks::Map diff --git a/APACHE/crontabtasks.conf b/APACHE/crontabtasks.conf new file mode 100644 index 0000000..90dd939 --- /dev/null +++ b/APACHE/crontabtasks.conf @@ -0,0 +1 @@ +PerlModule Apache::Ocsinventory::Plugins::Crontabtasks::Map diff --git a/infos.json b/infos.json index 36671a8..ba43e49 100644 --- a/infos.json +++ b/infos.json @@ -3,7 +3,7 @@ "author" : ["Guillaume PROTET", "Valentin DEVILLE"], "contributor" : ["Frank BOURDEAU"], "supportedAgent" : ["Unix"], - "version" : "1.1", + "version" : "2.0", "licence" : "GPLv2", "description" : { "fr" : "Remonte les crontab", diff --git a/install.php b/install.php index 9c24580..7592a94 100644 --- a/install.php +++ b/install.php @@ -3,7 +3,7 @@ /** * This function is called on installation and is used to create database schema for the plugin */ -function extension_install_crontabTasks() +function extension_install_crontabtasks() { $commonObject = new ExtensionCommon; @@ -24,7 +24,7 @@ function extension_install_crontabTasks() /** * This function is called on removal and is used to destroy database schema for the plugin */ -function extension_delete_crontabTasks() +function extension_delete_crontabtasks() { $commonObject = new ExtensionCommon; $commonObject -> sqlQuery("DROP TABLE `crontabtasks`"); @@ -33,7 +33,7 @@ function extension_delete_crontabTasks() /** * This function is called on plugin upgrade */ -function extension_upgrade_crontabTasks() +function extension_upgrade_crontabtasks() { }