faaslave Posted October 20, 2006 Posted October 20, 2006 O.K. all, Users log into the database using their ID and password. Once the user logs in I want to run a script. The script is designed to take certain users to certain places, when they log in. Can the login ID be retrieved and set into a global variable so I may direct different users to different places. Thanks Dave
Ender Posted October 21, 2006 Posted October 21, 2006 Sure, use get(accountname). Also, if your privilege sets are defined by something like job positions, you might find get(privilegesetname) to be useful.
faaslave Posted October 21, 2006 Author Posted October 21, 2006 As a matter of fact they are. Thanks Dave
faaslave Posted October 21, 2006 Author Posted October 21, 2006 Alright, I think I still need some help. I have priviledge sets assigned now. They look like this: AOM BOM COM DOM EOM FOM AFLM BFLM CFLM DFLM EFLM FFLM When an Operational manager logs in that belongs to Area B, their priviledge set is BOM When a Front Line Manager logs in that belongs to Area C, their priviledge set is CFLM So the purpose of the login script is to take the user to the OM layout or FLM layout when they log in, and set the pk_area_id to the correct letter, then find only records for their area. An FLM from Area F, logs in with priviledge set FFLM, then is taken to the FLM layout, sets the area id to F, performs a find and shows all of the area F FLM records. As far as I can figure out, the priviledge set returns something like this [FFLM] So I set the global variable $$master to get (priviledgesetname) So to tell FM which layout to go to I need to do something like, use the left function to grab the 3rd character from the left, "F" and take me to the FLM layout. Then use the left function again to grab the second character "F", set the pk_area_id to "F" and perform a find to show all of F's records. I just can't figure out how to write the script correctly. Any help would be appreciated. Thanks Dave
Ender Posted October 21, 2006 Posted October 21, 2006 Sorry, I can't think in terms of acronyms. Anyway, I only see two different user classes in there: Front-Line Managers and Operational Managers. Within those classes, the privileges would probably be the same. If you are interested in this type of very specific privilege sets, it can be done more easily by using Extended Privileges (you can look up Steven Blackwell's white papers on this for more details). I think a better way to handle your situation is to use just the two privilege sets (Operational Managers and Front Line Managers) and a User table that has a field for their Area, and reference that information from a relationship between an unstored calc= get(AccountName) and the User::AccountName field. This allows for greater flexibility in the details that might be needed about the current user, including their Name, Position, Phone Number, Email Address, etc., etc. For isolating the records for their Area, you can use a Go to Related Records [ Show ] step, like this: If [ not isempty(Invoice by Area::Invoice#) ] Go to Related Records [ Show only related records; Invoice by Area ] If [ get(privilegesetname) = "Operational Managers" ] Go to Layout [ OM Entry (Invoice) ] Else If [ get(privilegesetname) = "Front Line Managers" ] Go to Layout [ FLM Entry (Invoice) ] Else #Anybody else Go to Layout [ Default Layout (Invoice) ] End If Else #No records for this Area Go to Layout [ Default Layout (Invoice) ] End If where 'Invoice by Area' is a relationship between User and Invoice (or whatever table) by the AreaID.
faaslave Posted October 21, 2006 Author Posted October 21, 2006 I guess it would make more sense to attach a file. When the user logs in, their user name does not match any record. So I figured the only way was to set some globals. If they logged in, using the priviledge set AOM. wouldn't something like Middle (Get (PriviledgeSetName) ;2;1) work to grab A. Then I could use the A to sort for all of A's records. Likewise Middle (Get (PriviledgeSetName) ;3;1) would grab the O, and I could use this to take me to the OM layout? by the way, the middle function as stated above didn't work, I think I am using it wrong Here is the file, maybe it will make more sense Thanks Dave SupTracking54.fp7.zip
faaslave Posted October 21, 2006 Author Posted October 21, 2006 I think I ended up doing something similar to what you are saying. Well it works anyway. Thanks for your help, Dave login.pdf
Recommended Posts
This topic is 6607 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