Home » Developer & Programmer » Forms » Logon_Screen and Main Screen restrict access problem
Logon_Screen and Main Screen restrict access problem [message #261345] Wed, 22 August 2007 06:26 Go to next message
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 #261698 is a reply to message #261345] Thu, 23 August 2007 06:39 Go to previous messageGo to next message
krishna_jvs
Messages: 9
Registered: August 2007
Location: hyderabd
Junior Member
Hi,

in your main Screen write a form level trigger


BEFORE THAT
TAKE ONE GLOBAL VARIABLE TO STORE YOUR USER NAME IN LOGIN FORM

-PRE FORM trigger
in that one do u r verification like


uname := :GLOBAL.USER;

IF UPPER(uname) != 'MYNAME' THEN

RAISE FORM_TRIGGER_FAILURE

END IF;
Re: Logon_Screen and Main Screen restrict access problem [message #261888 is a reply to message #261698] Thu, 23 August 2007 23:32 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
@bbaz

Is this working for you?

David
Re: Logon_Screen and Main Screen restrict access problem [message #262216 is a reply to message #261888] Sat, 25 August 2007 03:51 Go to previous messageGo to next message
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 #262431 is a reply to message #262216] Mon, 27 August 2007 00:49 Go to previous messageGo to next message
krishna_jvs
Messages: 9
Registered: August 2007
Location: hyderabd
Junior Member
insted of using raise form trigger failure.try out with call new-form triggerinplace of raise form trigger failure
Re: Logon_Screen and Main Screen restrict access problem [message #262504 is a reply to message #262431] Mon, 27 August 2007 05:37 Go to previous messageGo to next message
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:

LOGON_SCREEN;

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 Go to previous message
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
Previous Topic: Display HTML
Next Topic: Search form
Goto Forum:
  


Current Time: Fri Dec 02 12:40:17 CST 2016

Total time taken to generate the page: 0.07492 seconds