Stack Tracing

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
SirWobbyTheFirst
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 246
Joined: Tue Jun 30, 2009 11:15 pm

Stack Tracing

Post by SirWobbyTheFirst » Tue Jun 15, 2010 11:08 pm

Hello everyone.

I'm looking for a way to manage a list of stacks and would like to know how I could trace a stack back to the stack which originally opened because I want to create a system which implements a security system. For example say I have a stack called Primary Stack which has been opened under the username Administrator and then the user types his or her username and password in and the Primary Stack then opens a new stack called Secondary Stack. The system has then recorded details of the stacks username and password for security purposes, so the tree looks a little bit like this.

Primary Stack - Administrator
|__ Secondary Stack - Guest

Then say for example a new user types his or her username and password in and the Primary Stack then opens a third new stack called Tertiary Stack. As again the system has recorded details of the stacks username and password for security purposes and so looks like this.

Primary Stack - Administrator
|__ Secondary Stack - Guest
|__ Tertiary Stack - TinyUser

Now say that the first user who logged on - Guest - opens a new stack which is a control panel for changing the settings. How would I trace back the Secondary Stack so that the new control panel stack inherits its parents username and password. I also want this to create a plugin for Revolution which shows each stack listed in a tree order of who opened. (Like how Process Explorer shows the process tree, something like that). E,g,

Primary Stack - Administrator
|__ Secondary Stack - Guest
|____ Control Panel - Guest
|__ Tertiary Stack - TinyUser

I know its quite :oops: a lot to read but bear with me. My mind churns out some rather strange ideas like mentioned above and as normal, all help is really appreciated. Thank you.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10354
Joined: Wed May 06, 2009 2:28 pm

Re: Stack Tracing

Post by dunbarx » Wed Jun 16, 2010 5:56 pm

The "mainstacks" function lists all open stacks in the order they are loaded. You would have to strip out the many IDE stacks, but they are manageable, in that they either start with "rev" or are "home" or "message box" or whatever. You might map the logIn process with that information.

But cannot your login process on its own map the user to the stack they are opening? This info can be stored somewhere in your mainStack. Whenever that user does something, you can update as needed

SirWobbyTheFirst
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 246
Joined: Tue Jun 30, 2009 11:15 pm

Re: Stack Tracing

Post by SirWobbyTheFirst » Wed Jun 16, 2010 6:04 pm

That wouldnt work bunbarx because in the examples I provided the two users who are logged in may open the new stacks at different times so one could've logged on at 9 and then the other could've logged on at half 9 at which the first user could open a stack and automatically inherit the username and password.

If I used you're method it would lead to the stack which user 1 opened inheriting the second users security details. :)

Post Reply