Re: FORMS 4.5 - ON-LOGON trigger

From: Joe Brown <joe_at_hopi.dtcc.edu>
Date: 16 Oct 1998 02:29:13 GMT
Message-ID: <706b1p$64c$1_at_apache.dtcc.edu>


HTH What I did:

Created a form specifically for logging on.

I did this for a couple of reasons.
1. On windows if mutiple users need to logon, its faster to logout/in via a form than exit forms altogehter.
2. Set default database/instance at program level.

How:
Wrote an on logon much like yours, but created a block/form etc for handeling the logon.

on-logon
declare
  password_connect Varchar2(80);
begin
 if :logon.username is null then --block logon item username.    return;
 end if;
 if :logon.database is not null then
   password_connect := :logon.password ||'_at_'|| :logon.database;  else
   password_connect := :logon.password;
 end if;
 logon( :logon.username, password_connect, FALSE);  if Form_failure then
   Raise Form_trigger_failure;
 end if;
end;

when-form-new-instance
checks the application for username/passsword parameters, if they're there, it populates :logon.username, :logon.password & :logon.database with the values then calls my Do_Logon procedure.

The part that confounded me for a while... Calling logon( :logon.username, password_connect, FALSE) outside of On-Logon calls On-Logon's & the Logon there.

I created a Program unit: Do_Logon which actually calls Logon, checks for failure, keeps track of failures and exists the form if failures > 3, etc..

Oh, one other thing... I used Forms 5. I expect this will work the same in version 4.5 though.

The default/logon now fails, because :logon.username is null. That's okay

In article <70018f$172$1_at_nntp.ucs.ubc.ca>, George Dimopoulos <george_at_hivnet.ubc.ca> wrote:
>I am attempting to add pre-fixes to username and password
>before logon to Oracle Instance.
>
>This will work fine if on the first attempt user enters correct
>username/password
>as they know it.
>
>It fails to work, if user enters incorrect username or/and password
>since LOGON built-in does not fire ON-LOGON trigger again.
>
>Any ideas on how to make ON-LOGON fire again?
>
>
>DECLARE
> un VARCHAR2(80);
> pw VARCHAR2(80);
> cn VARCHAR2(80);
>
>BEGIN
>
> logout;
>
> Logon_Screen;
>
> un := Get_application_Property(USERNAME);
> pw := Get_application_Property(PASSWORD);
> cn := Get_application_Property(CONNECT_STRING);
>
> un := 'pra_'||un; -- gd
> pw := 'x'||pw||'x'; -- gd
>
> IF cn IS NOT NULL THEN
> LOGON(un,pw||'_at_'||cn);
> ELSE
> LOGON(un,pw||'_at_promis'); -- gd
> END IF;
>
>END;
>
>

--
(: Joe Brown :)				      joe_at_apache.dtcc.edu
I believe Wine is going to be great if it ever gets finished. . .
I believe Linux _is_ great even though it's not finished! ! !
I believe you have my address.  :-)
Received on Fri Oct 16 1998 - 04:29:13 CEST

Original text of this message