, , , ,

Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

Change OI User (OpenInsight 32-Bit)

At 06 JUN 2009 01:55:59PM dsig@sigafoos.org wrote:

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


At 07 JUN 2009 05:01PM Richard Bright wrote:

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


At 09 JUN 2009 10:58AM dsig@sigafoos.org wrote:

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


At 09 JUN 2009 01:14PM dbakke@srpcs.com's Don Bakke wrote:

DSig,

Unfortunately this isn't implemented in OI as cleanly as we would like. Here are a couple of posts that discuss this:

http://www.revelation.com/o4wtrs/oecgi3.exe/O4W_DOMINO_HANDOFF?DESTN=O4W_RUN_FORM&INQID=WORKS_READ&KEY=EDF19DB61FE4BBC1852572D0004B2504&KEY1=EDF19DB61FE4BBC1852572D0004B2504

http://www.revelation.com/o4wtrs/oecgi3.exe/O4W_DOMINO_HANDOFF?DESTN=O4W_RUN_FORM&INQID=WORKS_READ&KEY=BD3A5AF7E30B21E38525731A003F0E63&KEY1=BD3A5AF7E30B21E38525731A003F0E63

dbakke@srpcs.com

SRP Computer Solutions, Inc.


At 09 JUN 2009 04:36PM cpates@sprezzatura.com wrote:

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

Captain's Blog

View this thread on the Works forum...