5 Replies Latest reply: Aug 23, 2013 10:00 AM by InoL RSS

    Trigger Question?

    Kızıldağ

      Hi,

       

      I am new to Oracle forms. I have a forms application which was developed by someone else years ago. There is a problem when a specific user tries to login. When this specific user tries to login, an error pops up saying "You are not allowed to login because you entered your username/password 2 times". I installed oracle forms developer and managed to open login fmb. How can I fix this user so that he can enter the application again?

       

      Best Regards.

       

      Here is the trigger ;

       

      DECLARE

        connected BOOLEAN := FALSE;

        tries     NUMBER  := 3;

        un        VARCHAR2(30);

        pw        VARCHAR2(30);

        cs        VARCHAR2(30);

        SAYI       NUMBER(2);

        d number;

      BEGIN

        SET_APPLICATION_PROPERTY(CURSOR_STYLE, 'DEFAULT');

        WHILE connected = FALSE and tries > 0 LOOP

          LOGON_SCREEN;

          un := GET_APPLICATION_PROPERTY( USERNAME );

          pw := GET_APPLICATION_PROPERTY( PASSWORD );

          cs := GET_APPLICATION_PROPERTY( CONNECT_STRING );

         logout;

         logon ('a','a');

         select count(*) INTO SAYI from KULLANICI

         WHERE AD=UN AND SIFRE=pw;

       

                 IF FORM_SUCCESS AND sayi=1 THEN

             connected := TRUE ;

             select gon_daire_kod into :global.gon_daire_kod from kullanici

        where ad=un;

               ELSE  d:=show_alert( 'alert4');

            END IF;

             tries := tries - 1;

            END LOOP;

              

        IF NOT CONNECTED THEN

          MESSAGE('Too many tries!');

          RAISE FORM_TRIGGER_FAILURE ;

        END IF;

      END;  

        • 1. Re: Trigger Question?
          CraigB

          Since other users are able to log in, it sound like the problem is with the specific user's account.  Does this user have an active account?  Have you tried changing the user's password?

           

          Craig...

          • 2. Re: Trigger Question?
            Kızıldağ

            Hi Craig,

             

            Thanks for your reply. Actually I created a brand new username and password into the table. Does the code below gets it from the table?

             

            un := GET_APPLICATION_PROPERTY( USERNAME );

                pw := GET_APPLICATION_PROPERTY( PASSWORD );

                cs := GET_APPLICATION_PROPERTY( CONNECT_STRING );

             

            I am afraid the FMB file is out dated!

             

            Best Regards.

            • 3. Re: Trigger Question?
              InoL

              This

              "You are not allowed to login because you entered your username/password 2 times"

              is not a standard Forms message. You are using some custom login code. Nowhere in the code you posted here shows where this error message is raised. So, it is not possible to say why you are getting this message.

               

              You first need to identify the code where this message is raised, then you can look for a solution.

              • 4. Re: Trigger Question?
                Kızıldağ

                Hi InoL,

                 

                Thanks for your reply. But unfortunately, I realized that I do NOT have the updated FMB file, that's why I have such an error message. I think I am in a bad situation. I have a FMX file which I don't have it's FMB.

                • 5. Re: Trigger Question?
                  InoL

                  >I think I am in a bad situation.

                  Well, yes. There is no way to reverse engineer an fmx into an fmb file.