Cronjob for Global Check-in?

Need help with the Administration of your Joomla! 3.x site? This is the spot for you.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
linuxpc4me
Joomla! Intern
Joomla! Intern
Posts: 72
Joined: Thu Nov 10, 2011 12:54 pm

Cronjob for Global Check-in?

Post by linuxpc4me » Thu Sep 23, 2021 1:31 pm

I am experiencing a form being locked repeatedly and need to clear on the Site -> Maint -> Global Check-in page.

Is there a way I can use a cronjob to accomplish this at night?

I realize the issue is caused by folks not closing the page. I'm a bit weary of manually clearing it daily.

Thanks for any suggestions

User avatar
pe7er
Joomla! Master
Joomla! Master
Posts: 24977
Joined: Thu Aug 18, 2005 8:55 pm
Location: Nijmegen, Netherlands
Contact:

Re: Cronjob for Global Check-in?

Post by pe7er » Thu Sep 23, 2021 6:09 pm

You could write a PHP CLI script that you add in Joomla's /cli/ folder and trigger it with a cron job.

I wrote a simple PHP CLI script to automatically remove old RSForm Pro entries (which is now a feature in that software).
You could reuse this script as model for your purpose but you've to rewrite the SQL queries:
https://gist.github.com/pe7er/47bf1020b ... a80d1fdccd
Kind Regards,
Peter Martin, Global Moderator
Company website: https://db8.nl/en/ - Joomla specialist, Nijmegen, Netherlands
The best website: https://the-best-website.com

sozzled
I've been banned!
Posts: 13639
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Cronjob for Global Check-in?

Post by sozzled » Thu Sep 23, 2021 7:34 pm

linuxpc4me wrote:
Thu Sep 23, 2021 1:31 pm
I realize the issue is caused by folks not closing the page. I'm a bit weary of manually clearing it daily
Yes, it can be a nuisance for the site administrator to regularly check-in items that were checked-out because people did not close open "items" when they viewed them. This issue should only occur in the backend, that is, if other people can login to the backend and check items out.

Perhaps one way to address the matter (instead of relying on a cron job which may check things in that should not be checked-in because those things need to be checked-out to prevent other people from changing things while they're being worked on) is to educate the people who have backend access: explain to the other backend users of your website the importance of properly closing items (and then you may not have as much need to perform daily house-keeping). ;)

On the other hand, if it's a busy website—other people are often logging into the site's backend—then it's just part of having to regularly visit the backend of the site (say, once a day or a few times a week) to tidy things up. If the other administrators of your website don't do things right (even after you've explained what they should do) then, perhaps it's time to deny some people access to the backend?

I don't like the idea of running a cron job to perform a global check-in because it may check-in items that should remain checked-out. 8)

linuxpc4me
Joomla! Intern
Joomla! Intern
Posts: 72
Joined: Thu Nov 10, 2011 12:54 pm

Re: Cronjob for Global Check-in?

Post by linuxpc4me » Thu Oct 21, 2021 3:55 pm

thank you for assisting! Sorry for the incredible late response


Locked

Return to “Administration Joomla! 3.x”