Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

So, I've got a fairly large, complex database. There are 10 users. I have 2 front end layouts, one for Administrators, and one for end clients. What I would like to happen is that when the DB opens, it runs a script that will take the username and determine WHICH layout to drop them into.

Any takers?

Posted

Don't go by username. Users will change.

Instead, go by their privilege set. Use the Get( PrivilegeSetName ) function in a IF statement.

Posted

"actually, the user names won't change..."

Famous last words, them is...

Do you want to do it right? Use the privilege set. That way when you realise that generic usernames based on computers (or tasks or whatever) is a dumb idea you won't have to change all of these hard-coded values out of scripts.

And when you realise that giving every person a real username and password is a good idea (and the only real way to ensure security) you only have to assign them to the privilege sets and everthing will just work.

Posted

Why base a script on something outside of Filemaker when you can do it within Filemaker? I never use Get(Username). Ever.

Regardless, let's call Get(UserName) or Get(AccountName) or Get(PrivilegeSetName) all Get(Name) and you decide.

Create a script that includes:

If[0]

Else If[Get(Name)] = "Admin"

Go To Layout "Admin"

Else If[Get(Name)] = "Client"

Go To Layout "Client"

Else If[1]

Go To Layout "Default Layout"

End If

Under File Options, choose that script to run on Open.

Posted

you can call it dumb all you want, but these machines haven't changed names (or users) in almost a decade. It's simple to admin and train people on (hell the secretary could train somebody how to use the system).

The machines have changed, but the logins have not, and will likely not. Are you so lazy as to not have the time or effort to go in and change a single little script if a user name DOES CHANGE?

Posted (edited)

Sorry to see the temperature rising on this thread.

Kptchris - you have to understand this forum includes many types of FMP developers. Some are used to small solutions for smaller clients (as I am) and some are used to large solutions for larger clients. Vaughan's opinions, though strong, are very valid concerns for larger solutions.

Vaughan - when the thread starts out with David saying he has 10 users it should be obvious that Username changes may not be a very big deal for him.

Kptchris - he's not lazy, he's insane if he uses UserName scripting for large solutions.

Let's all just get along ;)

Edited by Guest
Posted

Seen all the heat is on I would like to jump in as well. I would have to agree with Vaughn because all you have to do to change what your username is in FileMaker is to go to preference and select other and type in whatever name you want.

This is probably a security issue if you are trying to differentiate between admin and regular users. If it's not then go ahead and use get( username ).

I've personally administered systems with 50+ users and the old developers had used get user name so it was a little annoying tracking down which users had to do what. Especially when someone new arrives and they say... hey can you give Johnny the same permissions as Sue?

Trust me it's definitely a little easier to base it on privleges set because you never know if your system will grow. If you do you will be happier in the long run for sure. Weather it's stupid or not is a different story. Both ways will definitely work, but I would strongly suggest using privilege sets.

Posted (edited)

Well, just my two cents:

Are you so lazy as to not have the time or effort to go in and change a single little script if a user name DOES CHANGE?

Well, you could say: "are you so lazy to use a computer when you could just use a type writer" ... but you don't do you? I just put the question to you are you to lazy to do it right the first time?

The thing is, most of us here are developers of solutions that we frankly don't have the time to maintain.. I mean sure, if we wanted to scam 100 bucks of our clients each time they needed to add a user we could just write the script in a dodgy fashion and always have to be on call should the situation ever arise.

Frankly i prefer to charge an extra couple of hundred straight off, and spend a little more time not being lazy and doing it right the first time.

In a lot of solutions where i've gone in to fix this sort of stuff, you will often find hundred's of these little scripts floating around, and god help that solution if the on site FileMaker guy forgets to change one of those scripts.

Anyway, like i said, just my two cents.

PS, you're likely to get criticized for some of your methods, we all do, but if everyone here is telling you it's bad practice to do what you're doing, you should eventually just listen to them - trust me i know lol.

Edited by Guest

This topic is 6347 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.