Logon_Screen and Main Screen restrict access problem [message #261345] |
Wed, 22 August 2007 06:26 |
bbaz
Messages: 138 Registered: April 2007
|
Senior Member |
|
|
HI,
I am trying to restrict Access to my Main Screen Form with a simple USER validation. I want to limit access to my application for ONLY one user (ex: MYNAME). I have the following code that seems to be failing, I tried it on both WHEN-NEW-FORM-INSTANCE and PRE-FORM trigger on the Main Screen:
uname := USER;
IF UPPER(uname) != 'MYNAME' THEN
RAISE LOGON_FAIL;
END IF;
EXCEPTION
WHEN LOGON_FAIL THEN MESSAGE('CANNOT LOGIN INTO APPLICATION WITH THIS USER. PLEASE TRY AGAIN');
LOGOUT;
LOGON_SCREEN;
--RAISE FORM_TRIGGER_FAILURE;
Before I give Access to my MAIN SCREEN form, I have the above code where I am trying to check the USER logged in, if the user is not logged in with MYNAME then I want to stop him, log out the other user logged in (ex: Scott), and reload the LOGON_SCREEN again.
What is wrong with my Logic or code? Do I have to validate at the PRE-FORM trigger or the WHEN-NEW-FORM-INSTANCE?
Help is appreciated.
Regards,
Baz
|
|
|
|
|
Re: Logon_Screen and Main Screen restrict access problem [message #262216 is a reply to message #261888] |
Sat, 25 August 2007 03:51 |
bbaz
Messages: 138 Registered: April 2007
|
Senior Member |
|
|
Thanks Krishna for your response.
The LOGON_SCREEN that I am associating with my Main Screen is the default Oracle DB connection screen (attached). It is not an Oracle Form that I have developed.
In your code below, you advise to RAISE FORM_TRIGGER_FAILURE when the user does not have the right access to the Application, but this will cause the FORM to stop and not continue any further, while for me as mentioned before, I want to STOP, LOGOUT USER (since at this stage a user has already been logged in), and CALL the default LOGON_SCREEN again to have the user LOGIN with the RIGHT PERSON (MYNAME).
(check at this Level)
pass
SEQUENCE: LOGON_SCREEN --> MAIN SCREEN --> Continue loading
| |
<--- <--- <--- ------ login failed
Regards,
Baz
|
|
|
|
Re: Logon_Screen and Main Screen restrict access problem [message #262504 is a reply to message #262431] |
Mon, 27 August 2007 05:37 |
bbaz
Messages: 138 Registered: April 2007
|
Senior Member |
|
|
Krishna, I emphasize again that I am using the Default "LOGON_SCREEN" and that is called by simply:
So what you are saying, I have already tried that before Creating this Post but it didn't work.
My whole point is to associate my own developed Main Screen of my application with the DEFAULT Oracle Logon Screen.
I hope that I made myself clear.
Thanks to whoever can assist.
Baz
|
|
|
Re: Logon_Screen and Main Screen restrict access problem [message #262904 is a reply to message #262504] |
Tue, 28 August 2007 08:26 |
bbaz
Messages: 138 Registered: April 2007
|
Senior Member |
|
|
Hi All,
In the End, I decided to Create my OWN Login Screen and not to use the Default Oracle one.
So now I have control over this Login Form before giving accessing to the Main Form of my developed application.
It would be good and benefitial if anyone found a solution for Associating the DEFAULT Oracle Logon_Screen with other developed forms (as I was trying to do from the beginning)
Anyhow, the solution I have now serves the Purpose and it is working perfectly well.
A good old article that I found helpful and would like to share:
http://www.fors.com/orasupp/d2k/forms/30860_1.HTM
Regards,
Baz
|
|
|