cindreta Posted January 19, 2010 Share Posted January 19, 2010 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 More sharing options...
mapleleaf Posted January 19, 2010 Share Posted January 19, 2010 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 https://forums.phpfreaks.com/topic/189072-anti-collaboration-with-php/#findComment-998287 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.