session variables?

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

session variables?

Postby fire » Wed Mar 24, 2004 3:01 am

Hi friends!

I am designing a scheduling system with 3 types of users:


-an administrator (who can view all fields)
-teachers (who sees all his/her subordinates)
-students
- administrators assign students to teachers
- teachers use database to create their schedule

****Databases****
-------------
users: userid,fname,lname,usertype
schedule: date,block,classid,userid
classes: classid,description

****Objective:*****
I want to set a variable to the teacher who is currently logged in, so that when a teacher creates a new class,his/her userid is automatically entered into the userid field of the schedule

****Question:*****
If I set a global variable to the current userid, an another user logs in via a second Servoy Client and enters his/her id, 1) will the first userid in the global variable change? or is a different instance of the global variable used and the first userid data retained?

2)How can I keep the userid from changing?

3)Does servoy have session variables?
User avatar
fire
 
Posts: 16
Joined: Wed Mar 17, 2004 3:09 am

Re: session variables?

Postby bcusick » Wed Mar 24, 2004 3:30 am

fire wrote:****Question:*****
If I set a global variable to the current userid, an another user logs in via a second Servoy Client and enters his/her id, 1) will the first userid in the global variable change? or is a different instance of the global variable used and the first userid data retained?

2)How can I keep the userid from changing?

3)Does servoy have session variables?


Hi Fire,


****Answers:*****
1) Globals are in-memory variables - and they are UNIQUE to each user. So you will NOT have any "collisions" with the data.

2) The "userId" can be the security ID of the user (if you use a Servoy Security Login) or the person's ID (if you use your own security method)

3) Dunno what you're looking for here - in terms of session variables..

BTW - if you use the Servoy Security login - you can have the "userId" column of auto-enter the ID of the currently logged in user (NO coding on your part). Just go into "Dataproviders..." and click on the column - and click the "properties" button. You can specify that the userID be auto-entered.

Hope this helps,

Bob Cusick
bcusick
 
Posts: 1255
Joined: Wed Apr 23, 2003 11:27 pm
Location: Thousand Oaks, CA USA

Thanks!

Postby fire » Wed Mar 24, 2004 4:43 am

thanks alot bob! you are good at answering questions!

That solves my dilehma!

you should get yourself an avatar since ya post so often!

cheers!
User avatar
fire
 
Posts: 16
Joined: Wed Mar 17, 2004 3:09 am

Re: Thanks!

Postby bcusick » Wed Mar 24, 2004 10:02 am

fire wrote:thanks alot bob! you are good at answering questions!

That solves my dilehma!

you should get yourself an avatar since ya post so often!

cheers!


Thanks! If you want to make me an avatar - I'll use it! :D

You post great questions as well! Keep up the good work!

Cheers,

Bob Cusick
bcusick
 
Posts: 1255
Joined: Wed Apr 23, 2003 11:27 pm
Location: Thousand Oaks, CA USA


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 13 guests