Jump to content

Data Separation Model - Using Script to Add Accounts to both Files


This topic is 3734 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I am building a solution using The Separation Model. What I am trying to do is allow a User to add an Account via Scripting. I want to be able to use this same solution for multiple businesses and thus I plan on making it available to them only by WebDirect and FMGo, so it is a necessity to do this via scripting (so I don't have to manually add Accounts anytime the business wants to add a new user).

 

I am able to add the Account via script to my UI, but I can't figure out how to add it to the Data File. I may not have tried everything I can think of yet, but I have attempted to the point of frustration. 

 

Any ideas?

Link to comment
Share on other sites

Figured it out (primitively). Here is what I ended up doing. 

 

UI Script:

Add Account [Account Name: Users::AccountName; Password: ********; Privilege Set: "Manager"; Expire Password]

Set Field [users::gSearch_User; Users::User_ID]

Open File [Open Hidden; "DataFile"]

Perform Script ["AddAccount" from file: "DataFile"]

 

DataFile Script:

Go to Layout ["Users" (Users)]

Enter Find Mode [ ]

Set Field [users::User_ID; Users::gSearch_User]

Perform Find [ ]

Add Account [Account Name: Users::AccountName; Password: ********; Privilege Set: "Manager"; Expire Password]

Close Window [Current Window]

 

I will add more to my scripts/buttons to ensure the only Users able to run this script are managers and also to select the appropriate Privilege Set.

 

One thing I didn't like is that upon login with FMGo, using the new Account Name and Password it requires you to change the password for both the UI and Data File (so it pops up to change the UI password, then immediately pops up to change the Data password... I could see that leading to confusion). Perhaps I can have the new user type the password in a global field, set that in the specify box, in the Add Account script step, then clear the global field in the script. Then turn of Expire Password. Also, I suppose that if the script was interrupted, there may be trouble. I am still tinkering with it...

Link to comment
Share on other sites

If using FileMaker Server, and you should be in almost every instance, get out of the Account Management business by using External Server Authentication.  That way, the organization manages its own Accounts.

 

http://fmforums.com/forum/blog/13/entry-83-the-power-and-advantages-of-external-server-authentication-with-filemaker-server/

 

is a link to a BLOG post here on FM Forums about External Server Authentication.  There is also a Tech brief from FMI about this subject.

 

Steven

  • Like 1
Link to comment
Share on other sites

This topic is 3734 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.