[imp] Re: Using hook to copy Squirrelmail to Turba on first login?
Michael M Slusarz
slusarz at mail.curecanti.org
Tue Apr 19 14:30:09 PDT 2005
Quoting Josh Trutwin <josh at trutwins.homeip.net>:
> On Tue, 19 Apr 2005 14:46:33 +0200
> Jan Schneider <jan at horde.org> wrote:
>
>> Zitat von Josh Trutwin <josh at trutwins.homeip.net>:
>>
>> > I have some MySQL code that copies a user's SquirrelMail
>> > addressbook into the Turba tables (both are using a MySQL
>> > backend). I'm working on a migration plan from SquirrelMail to
>> > Horde3/Imp4 and what I'd like to do is use the
>> > _horde_hook_postauthenticate hook to run this code on the user's
>> > first login to Imp. The only thing I'm not sure of is how to tell
>> > whether or not it's the user's first login. It must be possible
>> > since it shows the Last Login each time anyone logs in. Any
>> > thoughts? Here's what I'm attempting to do with the hook:
>>
>> Use a custom TOS maintenance task instead, these are automatically
>> run on first login only.
>
> Having a little trouble getting started here, I followed the
> directions in horde/lib/Horde/Maintenance.php but my task is never
> showing up after wiping out the last_login preference.
>
> Here's what I did:
>
> Added prefs in Imp:
>
> $conf['sm_import']['import_addressbook'] = true;
> $conf['sm_import']['import_prefs'] = true;
> $conf['sm_import']['sm_host'] = 'localhost';
> $conf['sm_import']['sm_username'] = 'squirreluser';
> $conf['sm_import']['sm_password'] = 's2q0u0i3rrel';
> $conf['sm_import']['sm_database'] = 'squirrelmail';
> $conf['sm_import']['sm_address_table'] = 'address';
> $conf['sm_import']['sm_prefs_table'] = 'userpref';
> $conf['sm_import'] = true;
>
> That last one should be the trigger to call the Maintenance task
> right?
No. That last call is nuking your variable, at the end of this code,
$conf['sm_import'] = true.
Anyway, you need a preference variable (not configuration variables) to
activate a maintenance task - see config/prefs.php.
michael
_______________________________________
Michael Slusarz [slusarz at curecanti.org]
More information about the imp
mailing list