Forum Moderators: coopster
It's a not very pretty, but would work.
Mack.
You say have an open/closed value in a database - assuming the user is a good user who always logs out properly I can see how to do it.
But, if the user is like me and is in the habit of just hitting hibernate and disappearing for 5 hours, how would you go about making sure that the database value returns to "open" after an appropriate length of time?
P.S. Sorry for hijacking your thread merijnvw :)
But, say the user does hibernate on the edit image screen, what if the timestamp has expired when he returns, there needs to be something to prevent the user from continuing work on the image while the database value is "open"...
I suppose you could just do an if statement: if timestamp + xx is true, session_destroy();?
On some shared/mirrored systems, this mechanism is not reliable so you have to replicate the function manually. This is often done by having your software create a specially-named file when the target data file to be modified is in use. When the task is completed, the special file is deleted. You just check file_exists() on the special file before trying to manipulate the target data file. If it's in use, you idle for a bit and check again - usually with a timeout.