CMS Version Controlling
Posted: Tue Jul 28, 2009 8:16 am
Hi everyone,
I've recently been building a CMS to make developing life a bit easier, but I've come across a problem I can't seem to figure out.
The system caters for multiple users and user groups, so it's fair to assume that eventually two or more people will try to edit the same (for example) article or page. At the moment, I've tried using a checkout-checkin method using two fields in the database (`date_checked_out` and `checked_out_by`) and three PHP functions (checkin, checkout, check_edit_status).
It was going well until I realized if I refreshed the page that was checked out (by me) I got kicked out with an error saying "You are currently working on this file elsewhere...". So I started to play with $_SESSION vars to allow refreshing the page - then I realized it allowed me to edit the page from a different window even when it was checked out! I also came across a few other problems such as, if a user left the page using the back button, the page stayed checked-out.
Does anyone know a better way to checking-in/out or know of a guide which might help?
Thanks in advance,
Ben
I've recently been building a CMS to make developing life a bit easier, but I've come across a problem I can't seem to figure out.
The system caters for multiple users and user groups, so it's fair to assume that eventually two or more people will try to edit the same (for example) article or page. At the moment, I've tried using a checkout-checkin method using two fields in the database (`date_checked_out` and `checked_out_by`) and three PHP functions (checkin, checkout, check_edit_status).
It was going well until I realized if I refreshed the page that was checked out (by me) I got kicked out with an error saying "You are currently working on this file elsewhere...". So I started to play with $_SESSION vars to allow refreshing the page - then I realized it allowed me to edit the page from a different window even when it was checked out! I also came across a few other problems such as, if a user left the page using the back button, the page stayed checked-out.
Does anyone know a better way to checking-in/out or know of a guide which might help?
Thanks in advance,
Ben