[dev] Patch for IMP - Add a preference to choose if you want to do maintenance operations

Julian Jares julian@jares.com.ar
Thu, 14 Mar 2002 23:08:29 -0300


Ouch, wrong prefs... Sorry :-(
Here is the good one
for prefs.php.dist:
61c61
<     'members' => array('rename_sentmail_monthly',
'delete_sentmail_monthly',
---
>     'members' => array('do_maintenance','rename_sentmail_monthly',
'delete_sentmail_monthly',
311a312,320
> 
> // actually do maintenance operations $_prefs['do_maintenance'] = 
> array(
>     'value' => 1,
>     'locked' => false,
>     'shared' => false,
>     'type' => 'checkbox',
>     'desc' => _("Do maintenance operations on logon") );


-----Original Message-----
From: Julian Jares [mailto:julian@jares.com.ar] 
Sent: Thursday, March 14, 2002 11:06 PM
To: dev@lists.horde.org
Subject: [dev] Patch for IMP - Add a preference to choose if you want to
do maintenance operations


Hi:
 
Since I see people asking for it, and I actually use it, here is an user
option that allows users to skip maintenance every time... short
patch...
 
for prefs.php.dist:
61c61
<     'members' => array('rename_sentmail_monthly',
'delete_sentmail_monthly',
---
>     'members' => array('do_maintenance','rename_sentmail_monthly',
'delete_sentmail_monthly',
311a312,320
> 
> // actually do maintenance operations $_prefs['do_maintenance'] = 
> array(
>     'value' => 1,
>     'locked' => false,
>     'shared' => false,
>     'type' => 'checkbox',
>     'desc' => _("Rename sent-mail folder at beginning of month") );
 
for lib/IMP.php
262,264c262,266
<             include_once IMP_BASE . '/lib/Maintenance/imp.php';
<             $maint = new Maintenance_IMP();
<             $maint->runMaintenance();
---
>           if ($prefs->getValue('do_maintenance')) {
>                 include_once IMP_BASE . '/lib/Maintenance/imp.php';
>                 $maint = new Maintenance_IMP();
>                 $maint->runMaintenance();
>           }
 
Hope this helps