Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

Session Mgmt and global variables

Post Reply
mkingston
Posts: 23
Joined: Mon Jul 27, 2009 5:54 pm

Session Mgmt and global variables

Unread post by mkingston »

I have made some assumptions, which I should make sure are true. The application I'm converting includes unique session management for each user. That is, the application insures that the user signed in has only one session running. There are 2 reasons for the session mgmt requirement. The first is the obvious one of security, which I can see that nuBuilder includes. However, the second is that the application keeps track of and logs certain actions taken by the user.

Secondly, when a user signs in, a number of global variables are initialized and some may be modified throughout the session. The variables are global in the sense that, when the user navigates from program to program, every program has access to the value housed in that variable. I need to be sure nuBuilder can support this concept.

I am also concerned about another rather complicated type of function undertaken by the existing application. One example is in our order entry program. The program is designed to support a specific type of industrial service industry. When an order is entered, the user selects the name of a process to be applied. When that process is selected, the screen is updated with a list of operations associated with the process. That part may not be so complicated. However, not all fields associated with each operation in the list can be displayed, because they are so numerous. The user may wish to select one of the operations, which is then displayed in another form for alteration. When all data has been entered/altered on the form, it will be saved as a part of that order. When the new order is saved, two tables are updated. One for the order "header" information and the other with the list of operations, that apply to that order. The original "master table", from which the operations were "extracted" is never changed in the order entry process. I know this is complicated, so if you wish, I can send you some screen shots of that application if you wish. Basically, I have not seen, in the tutorials, how to do this sort of thing. I just need to know that it's possible at this time. It will be at least a month, before I'm ready to make this program in nuBuilder.

Thanks,

Merrill
Example.zip
Example and explanation of the problem.
(227.08 KiB) Downloaded 372 times
shane
Posts: 100
Joined: Mon Jun 15, 2009 10:04 am

Re: Session Mgmt and global variables

Unread post by shane »

Hi mkingston,

Thank you for your post I hope the following will answer your questions.

The nuBuilder platform will allow a user to be logged in from more than one location. I.e. you may have someone called sales1 logged in at several computers.
However nuBuilder will not allow more than one user logged in at one time from the same browser on the same PC. For example you cannot log in as globeadmin and another end user on the same computer using the same web browser.

Regarding setting global variables at login: you can set and get cookies and do anything you would normally do when programming in PHP and JavaScript. If you need to set a cookie when the index page is loaded you will need to put that custom code on the custom-code section of the index Form. Please refer to the following wiki article regarding gaining access to system Forms and Objects http://wiki.nubuilder.com/tiki-index.ph ... uilderDocs

Please note that when you are switching from developing a desktop application to a web-based application, that you are moving to a stateless environment which may mean that your application will need to behave differently.
I am also concerned about another rather complicated type of function undertaken by the existing application. One example is in our order entry program. The program is designed to support a specific type of industrial service industry. When an order is entered, the user selects the name of a process to be applied. When that process is selected, the screen is updated with a list of operations associated with the process.
-We have created solutions like that for our customers also. What we would do is create a drop down on a Form which the user would select the 'process', after this is selected we would use JavaScript to modify the content of another Drop down on the same Form so that the user could then select the 'operation' need. If this is what you need we could arrange for an example to show you.

As far as saving information from a Form to saved to more than one table: this is something that we also do quite a lot using the custom-code section on a Form. For a larger working example you could have a look at the 'Payment' screen code the nuAccounting live demo at http://demo.nubuilder.com/db/nuaccounting/
This accounting system can also be downloaded from our website if you need a local copy.

Feel free to ask any more questions if this does not help.
mkingston
Posts: 23
Joined: Mon Jul 27, 2009 5:54 pm

Re: Session Mgmt and global variables

Unread post by mkingston »

Shane:

I understand how the cookies and the PHP sessions work. When the time comes, we can discuss further any modifications I may need to make to the INDEX page. I wouldn't want to make any changes to it, without some detailed discussion.

Also, I attempted to use the Payment option from your demo, but couldn't get the unpaid invoices to come up in the list. After entering the pertinent information, including the payment amount, nothing happens and there are no buttons to press. I must be missing something.

Thanks,

Merrill
Post Reply