Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Strategy for accessing usernames in a multi-user applica
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00024252
Message ID:
00024505
Vues:
33
>I have an application which is going to be used by a number of users. Their "ACCESS LEVEL" determines which screens they will have access to once they have logged in successfully. The "MANAGER" is the only user who can change the values in the USERLIST table.
>
>Here is my problem, I would like to have the individual usernames (from a field in the USERLIST table) available for certain functions on a few of the screens. Creating a public memory variable obviously doesn't work because when one user exits the sytem, that variable "Pusername" also vanishes.
>
>Does anyone have any strategies they have used in dealing with an issue such as this?

Hi,

I'd go with the creation of a User class which contains the user's name
and access levels. I've done that with several apps that I've written and it works quite well. In the user class you can include as many properties as you need and then methods that will act on this user. I instantiate the class in the "main" of my app and is defined as PRIVATE so it is
available throught the app.

PROCEDURE MAIN
PRIVATE goUser

goUser = CREATEOBJECT("UserClass")

You could also make the user an object of an app class and have a .Login method within it. Several ways to go, but I'd stick with a class.

Steve Despres
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform