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

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

Recommended Posts

Posted

Does anyone have an example of how to build a session table that "locks" the current user to a specific session record?

I currently have a users table related to a sessions table that is home to external id fields used to relate a sessions record to all of my other tables. My "Main Menu" sits on the sessions table and it is where I have built all of my navigational controls.

My problem is that no matter who logs in, the insert current user step will only insert the same user. So instead of having three separte records for three different users, I have three records for the same single user.

I'm not sure but the user that it keeps creating a session record for is the user who is logged into the host. I have not tried a different user on the host to test that theory yet.

Can anyone assist me?

Posted

What function are you using to get the current user? get(currentaccount) should work, if each user has their own account name.

  • 2 weeks later...
Posted

I used a few globals that set it to the accountname that is logged in... then during that session, anything that is done, is set using the global that is storing it. I don't know if it is an effective way but it worked. Then I created a table of employees that have an actual field for logged in status. So it would current situation custom for that employee since different employees log into the same machine. I have one script that controls the functions and displays of that employee. Then, on I only have to plug in one script to the the different scripts I run in the system... say the Open script or Log in/log out script ect...

Using a global is nice because you won't have to worry about the relationship of the records when you tell a script to set a field. Since it is global, it will only contain the one set of information you placed in it last.

From what I can see that you need, is a setfield step in the script that will pull the account name from a set field(global) that is set when you log in. Instead of using the built in log in feature, create a script that will pull up a dialog box for the account name and password, then the next step is to set the accountGlobal field in the script, then exit to the layer you want. Now when you go to creat that record, just make a step in the script that will setfield to the contents of that account global that the login script set.

Posted

What happens if the startup script is bypassed and no value is set in the global?

May I please ask what it is you are actually trying to accomplish with this system?

Steven

Posted

sorry, I hadn't subscribed to this... so I didn'T get any updates.

what I did is allow a guest account that couldn't go to any layouts other than the login page. If, for some reason, someone got in on a guest account with no password, it sent them into a loop in the script. I have abort off and status area hide locked. Then I have an if statement saying that if the global isEmpty, a pop message that lets them log in again and set the global. A little complex but my company has computers that everyone uses, no specific computer for one employee. It might not be the best way to do it, but over the year, I have worked out all the bugs. And since it is only a log in script, all I did was plug it into the open script or run it seperate when someone hits a button to log out, sends them to a log in layout and logs in as a guest, looping on pause in that layout.

Posted

Without actually seeing this, I can't say for sure. But I strongly suspect based on having seen many scores of these systems, that your approach is fairly easily defeated. What happens to it if the opening script does not run or is bypassed?

Steven

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