|
From: Jon A. <jo...@sq...> - 2007-11-16 15:52:18
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Michael
> On 11/15/07, Jon Angliss <jo...@sq...> wrote:
>> Doing some research on this, it might not be too difficult, you
>> *should* be able to catch this in the logout_error hook. It's a bit of
>> a "cheap shot" so to speak, but you can probably do something like
>> this:
>> function login_auto_logout_err() {
>> if (defined('PAGE_NAME') && (PAGE_NAME =3D=3D 'webmail')) {
>> if (!empty($_COOKIE['user'])) {
>> header('Location: ' . SM_PATH . 'src/login.php');
>> }
>> }
>> }
>> This forces a redirect to the login page, only if the page is webmail,
>> and the login_auto cookie 'user' is set. This will allow the normal
>> login_auto code to kick in. You'll also need to update the
>> squirrelmail_plugin_hooks, which is in the _init function in
>> login_auto/setup.php.
>>
>> $squirrelmail_plugin_hooks['logout_error']['login_auto'] =3D 'login_auto=
_logout_err';
> Thanks.
> O.K. in login_auto/setup.php, I have (showing relevant parts only):
[..]
> login_auto_logout_err_do() never seems to be called and no redirection ha=
ppens.
> login_auto_logout_err never seems to be called either.
> Do I have something incorrect?
What SM version are you using? The 1.5.2-svn builds a static PHP array
from the plugins, so you'd need to rerun the configuration util. I
just applied it to my login_auto 1.1, and SM 1.4.12-svn setup, and got
it working fine. I've included a patch.
- --
Jon Angliss
<jo...@sq...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
iD8DBQFHPbykK4PoFPj9H3MRAjTPAJsEqQJnHzv0t0wPofbLN9ceoW2faACgnXmF
eEQFlhqn3jxuJ+mj2+EkS/o=3D
=3Df9ZZ
-----END PGP SIGNATURE----- |