Oyseka Posted October 25, 2013 Posted October 25, 2013 Hi all, I have a simple script to produce escalation notices based on the user and a time since last run but the blasted thing won't execute. What am I doing wrong ? With debugger the script exits at the first If statement when I am logged on as Sid. Â Screenshot of the script is attached Â
Mr. Scott Posted October 25, 2013 Posted October 25, 2013 Perhaps "Sid" is your account name used to login, which matches the account setup in FileMaker security (or LDAP/AD)? If so, change the function to Get ( AccountName) instead. - - Scott
Oyseka Posted October 25, 2013 Author Posted October 25, 2013 Perhaps "Sid" is your account name used to login, which matches the account setup in FileMaker security (or LDAP/AD)? If so, change the function to Get ( AccountName) instead. - - Scott I knew I would be doing something stupid, thank you that was indeed the error
doughemi Posted October 25, 2013 Posted October 25, 2013 Your first step's syntax is incorrect. The expression ("Sid" or "Claire") will always resolve to 0, and so you will always exit the script regardless of what Get(Username) resolves to (unless you have a user named "0"). Make your script If[Get(Username) = "Sid" or Get(Username) = "Claire"] //Then insert the rest of your script. //Then add Else Exit Script End If EDIT: or Get(AccountName), as the case may be
Oyseka Posted October 25, 2013 Author Posted October 25, 2013 Thank you doughemi, Get(Accountname) resolved the issue. As a matter of interest what is the functional difference between Username and AccountName
Mr. Scott Posted October 25, 2013 Posted October 25, 2013 Per the FM functions reference: Get(UserName): The name of the FileMaker Pro user, as specified in the General tab of the Preferences dialog box. Get(AccountName): The authenticated account name being used for the active database file. I recommend to my users that they choose "Other:" in the General tab and input their login name to make logging in to the database easier. Otherwise, the default User Name is usually the System Name - the user name setup on your computer (Users & Groups Preference Panel on Mac OS X). - - Scott
comment Posted October 25, 2013 Posted October 25, 2013 what is the functional difference between Username and AccountName See: http://www.filemaker.com/11help/html/func_ref2.32.83.html#1041385 http://www.filemaker.com/11help/html/func_ref2.32.3.html#1052203 IMHO, you shouldn't be using either. Instead, assign Sid and Claire to a higher privilege set and deny other users access to the script in their privilege set.
Oyseka Posted October 25, 2013 Author Posted October 25, 2013 See: http://www.filemaker.com/11help/html/func_ref2.32.83.html#1041385 http://www.filemaker.com/11help/html/func_ref2.32.3.html#1052203 IMHO, you shouldn't be using either. Instead, assign Sid and Claire to a higher privilege set and deny other users access to the script in their privilege set. Why is that preferable to just using the account log in credentials to run the script ?
comment Posted October 25, 2013 Posted October 25, 2013 Because some day Sid will be replaced by Nancy and then you will have to modify this script - and all other scripts and calculations that mention "Sid" by name. Instead of just promoting Nancy to the higher privilege set and let her inherit all the associated privileges automatically. 1
Oyseka Posted October 25, 2013 Author Posted October 25, 2013 That makes perfect sense, thank you. So I just change the user privileges for anybody else to not be able to run that particular script.
Mr. Scott Posted October 25, 2013 Posted October 25, 2013 FYI: Comment's recommendation is right on. With respect to [FULL ACCESS] privileges, I don't allow a directory group (external authentication) to have such a high level of privileges (per Mr. Blackwell's security recommendations). I have FileMaker-only accounts for FULL ACCESS, but don't have an external "Admin" group. I also use Matt Petrowsky's "developer" custom function to enable developer-only (FULL ACCESS) functionality. This can be obtained from the Starter example file at filemakerstandards.org, or their GitHub repository. - - Scott
Oyseka Posted October 25, 2013 Author Posted October 25, 2013 I don't allow any user full access privileges full stop. I don't want them accessing layout or definitions under any circumstances. I will look at the Matt Petrowsky file you recommend, what is it's function ? Back to the script it is now not working correctly. If I use the original step; Get ( AccountName ) ≠ "Sid" or "Claire" and I log in as Sid the script executes but not if I log in as Clair. If I change the script to: Get ( AccountName ) ≠ "Sid" or Get ( AccountName ) ≠ "Claire" it doesn't execute and exits at the first If step.
comment Posted October 25, 2013 Posted October 25, 2013 Get ( AccountName ) ≠ "Sid" or Get ( AccountName ) ≠ "Claire" is always true. You want to use either: Get ( AccountName ) ≠ "Sid" and Get ( AccountName ) ≠ "Claire" or the opposite: Get ( AccountName ) = "Sid" or Get ( AccountName ) = "Claire" as your test.
Oyseka Posted October 26, 2013 Author Posted October 26, 2013 Thank you comment, now I have found out why it didn't work I can throw it away and move to your excellent suggestion of attaching the script to a privilege set.
Recommended Posts
This topic is 4046 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now