8 Replies Latest reply: Dec 29, 2012 2:37 AM by Manu. RSS

    custom logon form

    Munish
      Hi,

      We are using oracle forms 6i as well as 11g.
      Our clients dont want to enter the database (connect), all they want to do is enter username and password.
      So, I decided to create a custom logon form in which there are just two fields (username, password) and a button

      So on logon trigger I put the code NULL
      Then on the button on the custom form I added the following code
      logon (un,pw||'@'||cn).
      if form_success 
      then
         call_form('xxx')
      else
      null;
      end if; 
      The issue is even if the password is wrong it still does the call_form.
      How can this be corrected? any ideas?

      Thanks
      Munish
        • 1. Re: custom logon form
          Srikkanth.M
          Hi,

          Just writer a small validation that the user name and password is correct. I think you might store the user name and password in the database, just get the value and check in the validation if correct call_form else display a message.

          That what we did in our custom form using program unit.

          Regards
          Srikkanth.M
          • 2. Re: custom logon form
            yoonas
            Hi,

            you can try using log_on_screen_error parameter withou logon builtin, if you set this to false and the logon fails forms will set form_failure to true and log on screen will not display. see forms online help

            Instead of using form_success you can use form_failure.
            logon (un,pw||'@'||cn,false);
            IF FORM_FAILURE THEN
            
              message( 'LOG IN FAILED' ) ;
              message( 'LOG IN FAILED' ) ;
            
            ELSE
            
              call_form('xxx')
            
              message( 'LOG IN SUCCESS' ) ;
              message( 'LOG IN SUCCESS' ) ;
            END IF;
            Regards
            Yoonas

            Edited by: yoonus on Dec 24, 2012 11:15 AM
            • 3. Re: custom logon form
              Manu.
              Munish,

              In The ON-LOGON Trigger, Check The FORM_SUCCESS Status. Then You Will Get Correct Value.


              Regards,

              Manu.
              • 4. Re: custom logon form
                Munish
                Hi,

                Write a small validation.... can you give me an idea how I can check if username/password entered is correct ?

                Thanks
                Munish
                • 5. Re: custom logon form
                  yoonas
                  Hi,

                  Did you try logon built in with false option ( logon (un,pw||'@'||cn,false)) this will actually set the form_failure to true if login is not successful.

                  You can just run a sql and see whats happening, if it returns desired result log in is successful else it should return log in related error.

                  If you are storing the username and password in your own table you can just check running a query against the table with the user name and password user has entered.

                  Select 1 from user_table where username=:usr_name and password=:pswd, This should return 1 if the entered username and password is correct.




                  Regards
                  Yoonas
                  • 6. Re: custom logon form
                    Munish
                    Yes I did.
                    This is what I did in WHEN BUTTON PRESSED TRIGGER
                     declare
                         un varchar2(30) := 'munish';
                         pw varchar2(30) := 'edumet';
                         cn varchar2(10) := 'nt8i';
                    begin     
                         logon(un,pw||'@'||cn,false);
                    IF FORM_FAILURE THEN
                     
                      message( 'LOG IN FAILED' ) ;
                      message( 'LOG IN FAILED' ) ;
                     
                    else 
                           message( 'success ' ) ;
                      message( 'success' ) ;
                         END IF;
                         
                         end; 
                    It returns message('success');

                    Secondly, no I do not have a table where the password is stored.
                    Maybe that is what is needed, we might have to create a table to store the password info.

                    Thanks
                    Munish
                    • 7. Re: custom logon form
                      Manu.
                      Dear Munish,

                      No Need To Save The Password In A Table.

                      You Need To Check The FORM_SUCCESS status in the ON-LOGON Trigger, And Save Its Value To A Form Level Variable / Item. Then Check That Value In The WHEN-BUTTON-PRESSED Trigger, And Do Accordingly.


                      Regards,

                      Manu.
                      • 8. Re: custom logon form
                        Manu.
                        Dear Munish,

                        Your Issue Is Resolved? If Yes, Then Mark This As Answered, Else Post The Issues.


                        Regards,


                        Manu.