Jump to content

anti-collaboration with php


cindreta

Recommended Posts

so  i have a cms and i would like to disable all other users to be able to edit a file that is currently being edited by some other user. i couldn't even get the idea how to start making this? do i use some kind of "temp" files or something. All the data comes from the database so entries hav an id?

 

any ideas?

thanks

Link to comment
Share on other sites

If I understand your question you don't want two people to be editing at the same time.

The best solution that I know is to have some kind of version control on the file.

So whenever the file is saved to the database a new unique version token is generated.

Then if two people open the file to edit at the same time you give them the version token in a session.

When they hit save you make sure the token is the same as the one on the server. If not you send a message saying someone saved a version of this file while you were editing it and don't save what they did. They then have to start with the latest file.

 

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.