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
https://forums.phpfreaks.com/topic/189072-anti-collaboration-with-php/
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.

 

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.