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 Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.