Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Using pauls lock all script with nials password protect button script

Avatar

Level 3

I am trying to incorporate Pauls lock all script and Nials password protected access when a button is clicked.

Is there a way to have that lock all button/script only work when the password entered is correct? Also a way to unlock it by someone who has a password?

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

Have a look here at a version of Paul's solution: http://assure.ly/yDtfsM.

Hope that helps,

Niall

View solution in original post

4 Replies

Avatar

Level 10

Yes, you would just add the code for the lock script to the script that checks if the password is correct.

And the same for unlocking, you would have to modify the lock script changing everywhere that it says "readOnly" to "open".

If you want this to happen all on the same button you would need a check to see if the form had been locked. So you could check a field on the form to see if it has been set to readOnly or not.

In pseudo-code:

if (password == true && fieldName.access == "open") {

     put lock script here

}

else if (password == true && fieldName.access == "readOnly") {

     put unlock script here

}

Avatar

Correct answer by
Level 10

Hi,

Have a look here at a version of Paul's solution: http://assure.ly/yDtfsM.

Hope that helps,

Niall

Avatar

Level 3

Wow thank you so much, thats exactly what I was looking for!