session variables?

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?

fire:
*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

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!

fire:
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