Miko Posted June 30, 2004 Posted June 30, 2004 i am interested in locking users out of a filemaker database located on a filemaker 5.5 server while the database administrator runs maintenance. i would like to keep the file up on the server but prevent all users except for the administrator from accessing it. in addition, i would like to script this capability into my database so that the database administrator can perform the maintenance without having to do anything too complicated (like, go to the server, close the folder of files, open them locally, turn on single user on the main file, do the maintenance, switch the file back to multi user and open the folder of files back through the server admin window)
Reed Posted June 30, 2004 Posted June 30, 2004 You could create a modified startup script that boots users if a flag is set and they are not in the admin group. Just set the flag when you want to do maintenance.
Miko Posted June 30, 2004 Author Posted June 30, 2004 what kind of a flag would you set and what script steps would prevent users from logging in? i guess i need a bit more information. right now there is already a startup script in place for the database.
Reed Posted July 1, 2004 Posted July 1, 2004 The flag could just be a field in a utility file. Say you create a maintenance field where the value is set to 1 or 0 depending on whether you're doing maintenance. Then the startup script will have an If() statement that will disconnect any users (with the close() or exit applicaiton() steps) if the flag is 1, and the status(currentgroups) function will determine whether the users have connected with an admin password or not. Dana
Miko Posted July 1, 2004 Author Posted July 1, 2004 this sounds very nice. i can see it working. i am going to test it today and see if i can get it working with my existing startup script. thanks Reed, great idea!
Miko Posted July 1, 2004 Author Posted July 1, 2004 ok. Dana. i tried what you said and the results i got were often bizarre. i set an if statement to run at start up and check a global field for the word "yes" and to check the status of the current group "timekeeper" and if those were both true, to close the file. unfortunately it seems to work when i put the (global field=yes) in parens and then add the current groups after an &. the unfortunate thing is that clearing the globabl field does not disable this script from closing the file. i have managed to lock myself out too.......as an admin........oops. have you actually tried this? and got it to work? if so, could you be specific on the exact phrasing of your script? thanks in advance.
Reed Posted July 1, 2004 Posted July 1, 2004 I haven't specifically used a flag like this, but I would not use a global field since each user gets their own copy, and the initial value is determined by what it was the last time the file was closed in single user mode. I would create a separate utility file that holds preferences like this in regular fields and only has one record. Create a constant relationship from your file to the utility file to refer to the values in the utility fields. You can get back into your file (if you didn't back up before you changed it) by creating a new file (with the same password as your old file) and defining a relationship to your old file. This will open your file without triggering the startup script.
Miko Posted July 2, 2004 Author Posted July 2, 2004 well what i was thinking was to have the admin push a button that executes a script to set the global field to "yes" when she wants to perfom maintenance on the file. then anyone who tries to log in should run into an if global field is "yes" and pattern count of the status of the current group is "timekeeper", show message and close file. what is happening is that it closes the file no matter whether the global says yes or is cleared once that if statement runs at startup. your last posting isn't very clear to me. i don't understand how the separate file with the plain text field and a relationship to the main file would allow it to work. when i tried it, it produced the same results as i had above. it's as if the script ignores the part of the if statement that is the flag field and only bases it's login on the status of the group. i guess what i wonder is one, am i missing something in what you are recommending and two: by separate file for preferences, and create a constant relationship what do you mean? can you explain these? i feel like i am half way to home and have no idea why the script seems to want to ignore a field that i am specifically asking it to reference.
Reed Posted July 2, 2004 Posted July 2, 2004 Here is an example file that utilizes a constant calc field that would be set to 1 or 0 by changing its field def. Of course users must be kicked before you can change the definition, but you would have to kick them to start doing maintenance anyway. My example doesn't kick users now if the flag is set to 1, it just displays a dialog....but you could change that to close file[] or whatever. You don't need to use a separate file like I was suggesting before, it's just nice to have a utility file where you can store settings like that separate from your data. I just wouldn't use global fields, because you can't change the initial value clients will see w/o closing the file. The admin password is super and the non-admin is users. Does this accomplish what you want? out.fp5.zip
Reed Posted July 2, 2004 Posted July 2, 2004 Also, I think I figured out why your script didn't work... if you used & that will concatenate text. What you want is the word "and" to test for both conditions. Dana
Miko Posted July 20, 2004 Author Posted July 20, 2004 my cleint doesn't know how to define a calculation, nor do i want her to learn how. i actually would like to keep her out of the workings as much as possible. anyway to use a feld and insert from calculation and have the script set the field? or would that also not stick?
Recommended Posts
This topic is 7431 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