Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7786611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:26:41+00:00 2026-06-01T20:26:41+00:00

In one of my projects users are allowed to edit the same file. It

  • 0

In one of my projects users are allowed to edit the same file. It is group work and max number of users in group is 4. It is rare that they will be editing at the same time but there is possibility of it. I am using ckeditor which displays the content. how I can lock the content while it is being edited?
For the above case what will happen if one users open the content for editing and then never saves and leave window open. Is it possible to save the content, release the lock for editing by another users? If first user comes back to desk they should see the message that “content has been changed, please refresh”.

I am using php, mysql.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T20:26:42+00:00Added an answer on June 1, 2026 at 8:26 pm

    You sort of need three parts to make this work.

    1. You need to add a field to your database to indicate when the file is being edited. Create a field called something like “LastUsed” and record a timestamp for when the file was opened for editing. When someone tries to open the file, check the timestamp, if the timestamp is recent (say last 5 minutes) don’t allow it to be opened by a second user.

    2. On the page that allows the file to be edited have an ajax request run every few minutes. All it needs to do is update the timestamp for the file being edited to the current date and time.

    3. You could then have a timer running that once it reaches a certain point the ajax requests are stopped so the timestamp in the database can expire. However have that timer reset every time the user takes an action. That way as long as the user is doing something, the timer is reset, and the ajax request is allowed to continue updating the timestamp in the database. If the user doesn’t do something for a given time, the timer runs up, the ajax request is stopped, the timestamp expires, and someone else can open it for editing. You could also use that same timer to show your message that the editing session has expired or whatever.

    It basically works like this:

    • When users is editing a file an ajax request is continually updating the “LastUsed” timestamp.

    • As long as that page is open to edit the file the ajax request will keep the timestamp in the database up to date.

    • If the person leaves the page open but is not doing anything the timer will run up and stop the ajax requests, which will allow someone else to edit the file.

    • Once the person leaves the page the ajax request will not be able to update the timestamp any longer. That way if a person just leaves the page others will be able to edit the file.

    • So when the second user tries to edit the file if the “LastUsed” timestamp is within the last 5 minutes you know someone else is editing the file. if the timestamp is greater than 5 minutes you know that nobody currently has the file open for editing, so the second user can edit it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In one of my projects, I have an application that manages several clients (or
In one of my projects, I have some classes that represent entities that cannot
I have an application that requires: user owns many projects. project has one owner.
We have a project that uses HP Quality Center and one of the regular
After numerous projects one-way asynchronous message passing looks like the only way to write
I have a solution with 3 projects.One of UI (contains web pages) and one
I have the digdog MapKitDragAndDrop in one my projects to achieve drag and drop
I've got a solution with many projects One of these proejcts is a MyProject.Web
I have a Visual Studio C++ solution with 3 projects: one contains all classes
For one of my projects, I'm using the DOMDocument class to load and manipulate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.