From 7acd3c79d290bfcbe93471b952d0009411277490 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Wed, 29 Jul 2009 12:59:10 -0600 Subject: [PATCH] Add upgrade system task --- imp/lib/IMP.php | 6 ----- imp/lib/LoginTasks/SystemTask/Upgrade.php | 37 +++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 imp/lib/LoginTasks/SystemTask/Upgrade.php diff --git a/imp/lib/IMP.php b/imp/lib/IMP.php index 7bd73b84e..674cfe983 100644 --- a/imp/lib/IMP.php +++ b/imp/lib/IMP.php @@ -1044,12 +1044,6 @@ class IMP if (!isset($entry['b'])) { $sortby = $GLOBALS['prefs']->getValue('sortby'); - /* IMP 4 upgrade: check for old, non-existent sort values. - * See Bug #7296. */ - if ($sortby > 10) { - $sortby = Horde_Imap_Client::SORT_ARRIVAL; - $GLOBALS['prefs']->setValue('sortby', $sortby); - } } $ob = array( diff --git a/imp/lib/LoginTasks/SystemTask/Upgrade.php b/imp/lib/LoginTasks/SystemTask/Upgrade.php new file mode 100644 index 000000000..fc745214f --- /dev/null +++ b/imp/lib/LoginTasks/SystemTask/Upgrade.php @@ -0,0 +1,37 @@ + + * @package Horde_LoginTasks + */ +class IMP_LoginTasks_SystemTask_Upgrade extends Horde_LoginTasks_SystemTask +{ + /** + * The interval at which to run the task. + * + * @var integer + */ + public $interval = Horde_LoginTasks::ONCE; + + /** + * Perform all functions for this task. + */ + public function execute() + { + IMP::initialize(); + + /* IMP 4 upgrade: check for old, non-existent sort values. + * See Bug #7296. */ + $sortby = $GLOBALS['prefs']->getValue('sortby'); + if ($sortby > 10) { + $GLOBALS['prefs']->setValue('sortby', Horde_Imap_Client::SORT_ARRIVAL); + } + } + +} -- 2.11.0