• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How control multiple users to access same page?

Guest
Aug 03, 2007 Aug 03, 2007

Copy link to clipboard

Copied

Hi,
I am working on a public page where the data pull from database base on different UUID. Where this page doesn't required login account. It differential by UUID where it send via email.

What I affaird in the email that contain UUID that might forward to multiple users for filling in a long forms with same UUID.
(This form it could be share same department but different sections).

How can I lock this page or only allow accessing by a user until been submitted?





TOPICS
Advanced techniques

Views

1.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 04, 2007 Aug 04, 2007

Copy link to clipboard

Copied

please clarify your problem - your description is not very clear....

---
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 07, 2007 Aug 07, 2007

Copy link to clipboard

Copied

Basically this page is link via url UUID which send by email- which is unique base on Dept ID and it is sending to all dept head's to fill in.

What I affaird the he/she might forwards this to couple staffs with same Dept ID to fill in - which might be error if someone saved it last will be over write the early saved.

So i would like to control this page that it only allow 1 user to view the page at a time sometime like lock but i cannot implement with login account as I would like it to be simple and easy.

Please advise.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 07, 2007 Aug 07, 2007

Copy link to clipboard

Copied

Locks check concurrent actions, two users acting at the same time. What you want is to make it impossible for one user to overwrite the previous efforts of a colleague. So a lock would solve only part of the problem.

I would record every form submission by ID in the database. When a user opens the form page I would run an initial check to see if a form corresponding to his or her UUID had previously been submitted. I am assuming that you already have a way to validate the UUID beforehand.

Now, consider the case where two users having the same UUID are concurrently filling the form. It suggests that you should also include code that does a check when the user presses the submit button. It should verify from the database whether a form corresponding to that UUID had already been submitted.

What about the time wasted by the later user? You will have to ignore such matters, as you want things "to be simple and easy".

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 08, 2007 Aug 08, 2007

Copy link to clipboard

Copied

Thank BKBK.

Yes, I hv a code that verify if submitted if will lock n show a message.

The prob i hv is concurrent filling the form. How can I able to lock this that only allow 1 visitor at a time?
Any syntax that can do this? CFLOCK able to do the trick?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 08, 2007 Aug 08, 2007

Copy link to clipboard

Copied

you could do something like this to prevent concurrent access



Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 09, 2007 Aug 09, 2007

Copy link to clipboard

Copied

do you have a last modified date on the table being updated?
if so, when you pull up the record store the date in a field and check to make sure it's the same when the user runs the update.

you can keep track of the first person who enters the site, create a session for that person, and set a timeout so that if they haven't submitted the changes within an hour or so, that it unlocks.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 09, 2007 Aug 09, 2007

Copy link to clipboard

Copied

Hi BKBK.
I tested but it cannot be lock - i open the dept_id:HR in my pc and I open same dept_id:HR in other pc which able to view same page.

ps: dept_id = base on URL.UUID.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 09, 2007 Aug 09, 2007

Copy link to clipboard

Copied

Qoop wrote:
I tested but it cannot be lock - i open the dept_id:HR in my pc and I open same dept_id:HR in other pc which able to view same page.
ps: dept_id = base on URL.UUID.


That is a paradox. If entry to the page cannot be locked then the form should not appear on at least one of the PCs. Could we see your code.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 09, 2007 Aug 09, 2007

Copy link to clipboard

Copied

Hi Nytyme,
I also thought same as u but i would like to try on BKBK's method if doesnt work.. i will using database to control.

eg:
when user view the page > it write into database with timespan
if user refresh/click it update wth new timespan.

If current time > timespan with diff IP address then unlock else lock

something like this

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 15, 2007 Aug 15, 2007

Copy link to clipboard

Copied

sorry for late reply.

anyway, here is the code (simplify version), so how do i able to lock base on my code? thanks again.


<cfquery of DEPT info base on the #URL.UUID#>


<cfif DEPT recordcount EQ 0>
Missing dept info <cflocation to xxx.cfm>
<cfelse>
<cfif SUBMIT EQ 1>
TQ for submitting...
<cfelse>
code start here...
<form action= next_page_action.cfm>
</cfif>
</cfif>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 16, 2007 Aug 16, 2007

Copy link to clipboard

Copied

Try the above options with your "USE J2EE session varaibles" enabled in the Memory variables of CFMX administrator. It would solve the concurrent issues in terms of sharing the session variables. Try & reply me back.

Could u please share the version of your CFMX server ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 16, 2007 Aug 16, 2007

Copy link to clipboard

Copied

Hi Prabhu,
I am using CFMX 6 but the server is sharing with other applications.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 16, 2007 Aug 16, 2007

Copy link to clipboard

Copied

Is there any progress in using the "Use J2EE session variables" ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 19, 2007 Aug 19, 2007

Copy link to clipboard

Copied

Qoop wrote:
I tested but it cannot be lock - i open the dept_id:HR in my pc and I open same dept_id:HR in other pc which able to view same page.

BKBK wrote:
That is a paradox. If entry to the page cannot be locked then the form should not appear on at least one of the PCs. Could we see your code.

Qoop later wrote:
anyway, here is the code (simplify version)...:
<cfquery of DEPT info base on the #URL.UUID#>

<cfif DEPT recordcount EQ 0>
Missing dept info <cflocation to xxx.cfm>
<cfelse>
<cfif SUBMIT EQ 1>
TQ for submitting...
<cfelse>
code start here...
<form action= next_page_action.cfm>
</cfif>
</cfif>


I have tested my suggestion. It works.

I can see where your code is leading to. However, it does not follow the line I suggested on 08/08/2007. Its logic is essentially different from mine. In my code, the condition for displaying the form is in a lock. In your code, the form is displayed unconditionally.



Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 20, 2007 Aug 20, 2007

Copy link to clipboard

Copied

Hi BKBK,
I understand ur code, which u lock when database recordcount found.

But I need it to be lock not even yet submit to database.. I would like it lock it when someone is viewing the page(dept A form) and no other person able to view dept A form until the person submit and close the page.

Hope this is clear.

ps:
<cflock name="#variables.dept_id#" throwontimeout="Yes" type="readonly" timeout="3">
option 1) I tried to write the dept A in temp database in here if someone is retrieve dept A but then if the person close the browser before submit which the temp database unable to release then it will always lock. Unless i hv to write another code to check every 30 mins to clear the temp database, this help able to release it.

option 2) need to do something here to lock... (still thinking some way)

</cflock>

thanks BKBK.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 20, 2007 Aug 20, 2007

Copy link to clipboard

Copied

Qoop wrote:
But I need it to be lock not even yet submit to database.. I would like it lock it when someone is viewing the page(dept A form) and no other person able to view dept A form until the person submit and close the page.

You may leave out the database code if you want. Try something like:

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 29, 2007 Aug 29, 2007

Copy link to clipboard

Copied

LATEST
Hi all,
Sorry for such late reply.

I hv solved the prob.. by combine BKBK and Nytyme methods.
So far, its work prefectly :)

Thanks again guys for all ur great help and advised.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation