Multy User CMS Problem !!! Any Ideas ?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hello, I am developing a CMS and I would like add the following  
- 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 ?

Thanks Angelos.

Re: Multy User CMS Problem !!! Any Ideas ?

Quoted text here. Click to load it

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.


Re: Multy User CMS Problem !!! Any Ideas ?

Quoted text here. Click to load it

Oh thanks for that, Simple and effective sollution ;-)

Site Timeline