Is there an approved (or not so approved) method of changing an OI user for an application. User logs into ap=mfg un=pete pw=pass
Then for specific purpose the user want to be known by the system as 'admin'. They could log out and back in as ap=mfg un=admin pw=pass
Instead of logging out and back in is there a routine which can do this? A "LOGTO" if you will
Thanks
Dave,
One upon a time, one of my applications needed a User_ID / profile which provided for some five privilege levels - so I developed my own User_ID / Logon system. This system allows for a user to LogTo another User_ID / Privilege level. Thereafter I have used this approach in all of my applications.
Richard Bright
Thanks richard. I just didn't want to go to all that fuss. Hoping there was an internal routine that would allow this to happen
DSig,
Unfortunately this isn't implemented in OI as cleanly as we would like. Here are a couple of posts that discuss this:
dbakke@srpcs.com
Dave,
As of OI 9.0.0 there *is* an internal function to allow you to change the user or application. This is what the new IDE uses so it has to be available to Basic+. Here's some preliminary documentation:
The Utility function contains a new method called "OPENAPP". This is used to open a new OI application from within a Basic+ procedure. It takes a single argument which is a dynamic array of new application information:
<1> App ID <2> User ID <3> Password <4> Entry Window ID <5> DB ID
e.g.
0001 appInfo = "" 0002 appInfo<1> = "EXAMPLES" 0003 appInfo<2> = "EXAMPLES" 0004 appInfo<4> = "RTI_IDE" 0005 0006 call utility( "OPENAPP", appInfo )
Points to note:
1) The procedure is executed in asynchronous fashion - because it has to release the Queue at the RevCAPI level to swap the application it can only be done AFTER all basic+ code has finished executing. So don't execute it from within a dialog box for example - in fact you'd be best to ensure that your app is pretty much cleaned up and closed before calling this function to maintain maximum control over the process.
2) It does no checking on the validity of the arguments. It's YOUR responsibility to ensure that arguments passed are valid.
3) The OI app is actually closed and reopened - the Entry Window ID contains the name of a window to execute when the new app is opened - so something like RTI_IDE could go in here when opening an app from the new IDE.
4) DB ID - This is the name of the DB to load - it defaults to the same as App ID if left blank
Anyway, it's there if you want to use it. I'd be interested in any feedback as to how well it works in your application.
cpates@sprezzatura.com