The preferred method is to use separate user Accounts and different Privilege Sets (File>Manage>Security…).
See chapter 6, page 128 of the User's Guide (Help>Product Documentation>User's Guide) for complete details.
Thanks Jade, I have already had a look through the User Guide. I don't want to completely prevent a certain User from accessing the layout, I want them to still access it, just they need to enter a password before getting access to it.
Granted, you can do this using a custom dialog box (or modal window) and compare the user input with a global field or calculated variable.
Then you must manage the password, password changes, and security using a standard FMP table and layout tools.
IMO, it's easier, more secure, and achieves the same purpose using the Re-login scripstep and a different Privilege set. This way, FMP handles the password management for you.
Thanks for the headsup. For the moment I would just like to use a password as it's a basic database. Do you know how I can set it up with the custom dialogue box?
You will need several things:
• a table where you can define two global fields—one for the correct password (calculated) and one for the user's input (text)
• uncheck the box called 'Include in layout menus' found in the Layout Setup in layout mode for your protected layout.
• a button or layout/event trigger that the user must use to go to the protected layout
• a script associated with the button or trigger to: display the custom dialog and acquire the user's input; compare the input with the password field; go to the layout if they match. It would be something like this:
Show Custom DIalog[ "Password Required"; "Enter your Password"; your_table::users_input] // check the box 'Use password character (•)'
If[ your_table::users_input = your_table::password|
Go to Layout[your_protected_layout]
You can set up Security... for all normal users as Guests and use Re-login function for that Layout which would require a differenct USER and Password. I admit the User Guide it so "complete" it can cause confussion.
But Security is so well done and thourough, I feel very confident on Hacker proofing your databases. Good Luck.
PS: FMP User and Passwords are NOT retrievable and I have had to "intercept" them and scramble them to assist in local users when they say "I lost my password".
I guess that you didn't read the whole thread.
But... and now more clearly aimed a Point to Hill, even YOUR brilliant work has no true prevention because your OUTSTANDING thought is done at the FMP "interpreter" level , where as FMP Securitty... was done at the "machine language" coding level, and therefore can't be intercepted at the USER level. I hope more Clear now for you.
@ Hill Try the Security part of FMP because....
1) Documentation of what you trying is needed for future work on you database
2) FMP is a reliable company and will make sure future upgrades will be compatible, will yours?
3) You will be amazed at the power and ease of use of FMP Security...
4) Try it! You will love it.
Ok thanks for the input from both of you. I have set it up as Jade has described and works fine (re the custom dialogue box). I am also looking at the Re-Login scriptstep. I have one question with this, once the "re-login" has been done, how do I go to the layout I want to password protect? Because at the moment, all the re-login is doing is logging in as a different user. Do I need to use the Get (LastMessageChoice) function?
Use Get (accountPrivilegesetname ) in an if step to check and see if the system is now logged in with a privilege set that permits access to the layout. If it is, then your next step is go to layout.
Jade and I both recommended use FMP Security. You didn't want to do that. Jade gave you a well thought out way to work around FMP security and still provide you a way to limit a Layout use by.... Your own table of passwords and user names.
Phil's response is assuming you are using FMP Security.
So... if you are doing Jade's work around, Jade's last post dated 4/21/2013. You will need Jade's help again.
Jim, as you said, try it and you'll love it so this is what I am doing. Like I said, Jade's workaround worked great and I am now trying the Re-Login scriptstep. I'm learning FM so it's all new to me so I like to enquire about more than one solution.
I have got the FMP Security working from Phil's description. Thanks. However, when the script is run, the window appears to enter the Account Name and Password. If at this point you click 'cancel', another Filemaker window appears saying "Re-Login has been canceled. Do you wish to continue with this script?" When you click "continue" here, it will take me to the layout without requiring the Account Name and Password, which defeats the purpose of the Re-Login. How do I stop this happening? I'm just trying to eliminate all ways the user could accidentaly find themselves on this layout.
My script is attached for your information.
Look at this link for a forum discussion on the Cancel problem using Re-Login. You can use Get( LastError) to guide your logic immediatley after Re_login.
Phil added to the discussion at end to complete the options.
If after reading that link you still need some help. Chime back in.
Set error capture can supress this dialog just like you can use it with a scripted find to supress the "records not found" dialog.