Concurent access

A

Anonymous

Guest
Hi,

I am implementing a multi-user Content Management System in PHP MySQL. After logging in, users will be presented with the structure of a site and they will be able to edit the content using a rich text editor.

The problem is that more than one user can request a page to edit in the same time so modifications might be lost - last update will be valid. I need a way to lock pages and not allow concurent requests to edit the page while locked.

Do you know how can I do this? Any ideeas?

Thanks
 
Try making a default (unique) template and/with users' settings. Like a cache template system.
 
lacroix13 said:
Hi,

I am implementing a multi-user Content Management System in PHP MySQL. After logging in, users will be presented with the structure of a site and they will be able to edit the content using a rich text editor.

The problem is that more than one user can request a page to edit in the same time so modifications might be lost - last update will be valid. I need a way to lock pages and not allow concurent requests to edit the page while locked.

Do you know how can I do this? Any ideeas?

Thanks
Try to create file filename.lc while edit and put check inside. if file exists File is locked.
 
Yes, thanks for the sugestions.

Actually, locking the file is quite easy and that was not the exact problem. In a perfect world where after editing, each user submits the modifications or unlocks the page, this would be great.

The real problem - the one that this topic implied - is what about users that try to edit a page, lock it and then just close the browser window or disconnects from the internet and leave the page locked? How shoud I check to see if someone work with the page or just left it locked.
 
lacroix13 said:
Yes, thanks for the sugestions.

Actually, locking the file is quite easy and that was not the exact problem. In a perfect world where after editing, each user submits the modifications or unlocks the page, this would be great.

The real problem - the one that this topic implied - is what about users that try to edit a page, lock it and then just close the browser window or disconnects from the internet and leave the page locked? How shoud I check to see if someone work with the page or just left it locked.
your welcome!
 
You could get take a "snapshot" of the page the user is editting, and when he submits it, compare it to the current one, and if there are any differences, that means that it has been editted. You could inform the user to edit the page again, or just create a code to add the changes that the user made and leave the part that was added by a different user unchanged.
 
lacroix13 said:
Yes, thanks for the sugestions.

Actually, locking the file is quite easy and that was not the exact problem. In a perfect world where after editing, each user submits the modifications or unlocks the page, this would be great.

The real problem - the one that this topic implied - is what about users that try to edit a page, lock it and then just close the browser window or disconnects from the internet and leave the page locked? How shoud I check to see if someone work with the page or just left it locked.
use session. if session destroyed,-delete lock file.
 
How could I check if the session is destroyed to unseal the lock if the user just closes the browser window or shuts down the computer?

Shouldn't this be implemented in some script that runs on the server - like a cron?
 
Example:
Code:
<?php

if(!isset($_SESSION['whatever'])) {
     // Do whatever you want here
     // There's no active session
}

?>
 
lacroix13 the best way to understan how to work session download some big project like phpBB and see inside the code.
phpBB I't very big application what created by more then one persone
 
Back
Top