ElkArte Community

Elk Development => Bug Reports => Topic started by: edweiss on May 11, 2018, 12:00:32 am

Title: Can't use cron to check IMAP if "Allow guests to browse the forum" disabled
Post by: edweiss on May 11, 2018, 12:00:32 am
Hi,

I'm trying to use cron to check IMAP for topic replies (through email_imap_cron.php). It works fine if "Allow guests to browse the forum" is enabled, but if I uncheck this box, the script diverts to the login page without checking the IMAP box.

Bug or am I doing something wrong?
Title: Re: Can't use cron to check IMAP if "Allow guests to browse the forum" disabled
Post by: tino on May 11, 2018, 04:12:51 am
I just checked this on my local install, it still runs when guest browsing is disabled just less frequently due to the amount of times I can access it.

The cron task is run by people accessing the forum as a scheduled task.

You can set up a manual cron to run it every x mins rather than having to rely on people accessing the forum.
Title: Re: Can't use cron to check IMAP if "Allow guests to browse the forum" disabled
Post by: emanuele on May 11, 2018, 06:01:34 am
I'd vote for the bug dammit.
Try changing in email_imap_cron.php, the line:
Code: [Select]
new Bootstrap();
to:
Code: [Select]
global $ssi_guest_access;
$ssi_guest_access = true;
new Bootstrap(true);
Title: Re: Can't use cron to check IMAP if "Allow guests to browse the forum" disabled
Post by: edweiss on May 17, 2018, 10:06:43 pm
Thanks, that seems to work.
Title: Re: Can't use cron to check IMAP if "Allow guests to browse the forum" disabled
Post by: emanuele on May 29, 2018, 04:58:32 pm
Tracked: https://github.com/elkarte/Elkarte/issues/3195