From a560a2544a5de8fd976f4b987c867a1b515775a7 Mon Sep 17 00:00:00 2001
From: "maieul@maieul.net" <>
Date: Sun, 1 Jan 2017 16:00:53 +0000
Subject: [PATCH] =?UTF-8?q?mettre=20dans=20un=20g=C3=A9nie=20=C3=A0=20part?=
 =?UTF-8?q?=20l'effacement=20des=20fichiers=20de=20r=C3=A9ponse=20stock?=
 =?UTF-8?q?=C3=A9s=20sous=20forme=20de=20timestamp,=20d=C3=A8s=20fois=20qu?=
 =?UTF-8?q?e=20corbeille=20sera=20l=C3=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .gitattributes                              |  1 +
 formidable_pipelines.php                    |  3 +--
 genie/formidable_effacer_fichiers_email.php | 13 +++++++++++++
 3 files changed, 15 insertions(+), 2 deletions(-)
 create mode 100644 genie/formidable_effacer_fichiers_email.php

diff --git a/.gitattributes b/.gitattributes
index fc83dfe9..2d1d59e8 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -35,6 +35,7 @@ formulaires/importer_formulaire.html -text
 formulaires/importer_formulaire.php -text
 formulaires/inc-formidable-boutons.html -text
 formulaires/inc-formidable-unicite.html -text
+genie/formidable_effacer_fichiers_email.php -text
 genie/formidable_hasher_ip.php -text
 http/collectionjson/formulaires-ressource.html -text
 http/collectionjson/formulaires.html -text
diff --git a/formidable_pipelines.php b/formidable_pipelines.php
index b743d384..bc84f9c5 100644
--- a/formidable_pipelines.php
+++ b/formidable_pipelines.php
@@ -214,8 +214,6 @@ function formidable_optimiser_base_disparus($flux) {
 
 	$flux['data'] += optimiser_sansref('spip_formulaires_reponses_champs', 'id_formulaires_reponse', $res);
 
-	// Les fichiers des réponses enregistrées par email
-	$flux['data'] += formidable_effacer_fichiers_email();
 	return $flux;
 }
 
@@ -256,5 +254,6 @@ function formidable_formidable_traitements($flux) {
 **/ 
 function formidable_taches_generales_cron($flux){
 	$flux['formidable_hasher_ip'] = 24*3600;
+	$flux['formidable_effacer_fichiers_email'] = 24*3600;
 	return $flux;
 }
diff --git a/genie/formidable_effacer_fichiers_email.php b/genie/formidable_effacer_fichiers_email.php
new file mode 100644
index 00000000..fb7f5237
--- /dev/null
+++ b/genie/formidable_effacer_fichiers_email.php
@@ -0,0 +1,13 @@
+<?php
+
+
+if (!defined('_ECRIRE_INC_VERSION')) {
+	return;
+}
+include_spip('inc/formidable_fichiers');
+/**
+ * Effacer régulièrement les fichiers des réponses envoyées par email
+**/
+function genie_formidable_effacer_fichiers_email($t){
+	return formidable_effacer_fichiers_email();
+}
-- 
GitLab