Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Multy User CMS Problem !!! Any Ideas ?
November 15, 2005, 9:10 am
rate this thread
- User A logs in.
- User B logs in.
- User A Edits page X
- User B Is informed that User A is loged in and edits page X so user B is
not able to edit page X until user A saves the page.
Ofcourse that's not so difficult if you set a flag in the database
for example that the current document is being edited, and remove the flag
when the user saves the document and exits.
BUT what happens if user exit the editing page without folowing any link or
submit button that I can control. What happens if his computer
restarts/crashes or he kills the browser or if his internet connection fail.
Database will have the document flaged as being edited by User A.
Do you know any good way of avoiding that problem or if you don't already
know, can you think of something similar ?
Re: Multy User CMS Problem !!! Any Ideas ?
Instead of setting a flag, set a timestamp. When user A opens the document for
editing, set the "editing" field to "2005-11-15 10:31:23". Then you decide for
a editing timeout. Say 30 minutes. If Usser A saves the document, the field is
cleared and the document is open for editing again. If user A doesn't close it,
it will return to being editable again if the timestamp is older than 30
Or have a master switch - "reset all edit flags" on all locked documents.