From 3c47e985c1d86730de08ada85ea6642bc0d8faef Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Mon, 11 May 2009 00:16:35 +0200 Subject: [PATCH] Adds email_backup reminder. --- include/reminder/email_backup.inc.php | 60 +++++++++++++++++++++++++++++++++++ upgrade/0.10.1/00_inscription.sql | 1 + 2 files changed, 61 insertions(+) create mode 100644 include/reminder/email_backup.inc.php diff --git a/include/reminder/email_backup.inc.php b/include/reminder/email_backup.inc.php new file mode 100644 index 0000000..53eb021 --- /dev/null +++ b/include/reminder/email_backup.inc.php @@ -0,0 +1,60 @@ +activate(); + + $this->UpdateOnYes(); + } + + if ($action == 'dismiss') { + $this->UpdateOnDismiss(); + } + + if ($action == 'no') { + $this->UpdateOnNo(); + } + } + + protected function GetDisplayText() + { + return "Tu peux bénéficier d'une sauvegarde des emails. Cela permet + d'avoir un accès de secours aux 30 derniers jours d'emails reçus + sur ton adresse Polytechnique.org."; + } + + public static function IsCandidate(User &$user) + { + require_once 'emails.inc.php'; + $storage = new EmailStorage($user, 'imap'); + return $storage->active; + } +} + +// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: +?> diff --git a/upgrade/0.10.1/00_inscription.sql b/upgrade/0.10.1/00_inscription.sql index 4534770..4eed42d 100644 --- a/upgrade/0.10.1/00_inscription.sql +++ b/upgrade/0.10.1/00_inscription.sql @@ -17,6 +17,7 @@ INSERT INTO reminder_type (name, weight, remind_delay_yes, remind_delay_no, rem ('profile_update', 90, 0, 0, 2), ('nl', 80, 0, 365, 7), ('promotion_ml', 70, 0, 365, 7), + ('email_backup', 60, 0, 365, 7), ('ax_letter', 50, 0, 365, 14); DROP TABLE IF EXISTS reminder; -- 2.1.4