FoxInCloud
Re: wcPropSave in custom classes
From: | Michele |
To: | FoxInCloud support |
As saving/restoring PUBLIC variables and _Screen.properties will be soon implemented,
I would recommend that you implement this in xxxProcess.wUserSet():
* ------------------------------------------------------------PROTECTEDPROCEDURE wUserSet && {en} Sets current user {fr} Règle l'utilisateur courant && {en} executed before each request against the application&& {fr} exécuté avant chaque requête sur l'applicationLPARAMETERS ; twUser,; && {en} User ID for application (=this.wUserAnonymous if anonymous) {fr} Identifiant utilisateur pour l'application (=this.wUserAnonymous si anonyme) tlTemp && [.F.] {en} This user ID is impersonated (see awServer.wlUserTemp) {fr} Cet identifiant est emprunté (voir awServer.wlUserTemp) oApplication.property1 = someFunction1(m.twUser) oApplication.property2 = someFunction2(m.twUser)RETURNDoDefault(m.twUser, m.tlTemp) && {en} Always keep this instruction! {fr} Toujours conserver cette instruction !
Instead of using 'someFunctionx()', you can save user's pathes in user's session:
&& When user identifies:IF wlSession() llResult = .T.; AND m.Session.setSessionVar('oApplication_property1', oApplication.property1); AND m.Session.setSessionVar('oApplication_property2', oApplication.property2); AND m.Session.setSessionVar(...)ENDIF* ------------------------------------------------------------PROTECTEDPROCEDURE wUserSet && {en} Sets current user {fr} Règle l'utilisateur courant ... oApplication.property1 = m.Session.getSessionVar('oApplication_property1',, oApplication.property1) oApplication.property2 = m.Session.getSessionVar('oApplication_property2',, oApplication.property2) ...
In my app i need to let access to different users and every user can access data in different path. So i need to set the path where to "use" my tables every time the user has enetered its credentials.....Normally i have a custom object, called oApplication where i store these info; in it i have a property called wdfPath where i set the path and every time i open a table a use this path...With Foxincloud i can't do that...because my oApplication is common to every user and the last set the path for all the users are already entered.....I have tried to set wcPropSave of my oApplication object to "wdfPath", but this has always the last value not one for each user....like when i work in forms.....
What i need is possible or not ? Which is the solution to a situation like mine ?
Thanks
The code where i instantiated my object is:
Public oApplication oApplication = CreateObject("erp_application") Local wdfPath*!* Here are operations to get the user's path *!* and i set it into local wdfPath oApplication.wcPropSave = "customerId,userId,wdfPath" oApplication.wdfPath = wdfPath