3 Replies Latest reply on Jan 18, 2012 10:42 AM by philmodjunk

    Please help for my button script problem!

    xtremu

      Title

      Please help for my button script problem!

      Post

       Hi guys,

      Let's say I have 3 tables and every tables has thier own layout and log-in using the username and password option.

      Now, I created the main window having 3 buttons. Let's say Button1 is for Layout1, Button2 is for Layout2 and Button3 is for Layout3.

      Now my problem is how to secure each layout, If I open the file and log-in on thier respective username and password, then go to main window having 3 buttons. If I click each button I want to have a script on that button to have another window for another username and password before going to the respective layout. So that if other will try to click that button they need to supply the correct username and password before they open that particular layout. Is this possible in filemaker pro 11 advanced? or any script for this?

      any help please..thaks

       

        • 1. Re: Please help for my button script problem!
          philmodjunk

          I'd experiment with two different scripted methods to see which works best for your system design:

          Add a relogin script step to the script performed by the button so that uses have to log back in with filemaker supplied user name and password each time they click one of these buttons.

          Use Show Custom Dialog with an Input field configured with the bullets option so the user can enter a password (or username and password) into a global field or fields(s), then use a script to verify the password entered.

          • 2. Re: Please help for my button script problem!
            xtremu

             Phil I used already the relogin method but not good for the system because your last username and password is still in the field and other user will able to click it and enter on that layout. However, if you click the cancel button it will continue the script and go to the last layout too.

            Let's say I have have 3 Accounts with their Username and password: (Accounting, Cashier and Registrar Account.)

            It has their own button on the main window and has their own layout. If I want to open those layout, I need to click their button and supply their username and password before going to their layout. This is what im trying to figure out, please help.

            Using relogin my script look like this:

            Re-Login [Account Name: "accounting"; Password:"accounting"]

            Go to Layout["Accounting Layout" (Student Information)]

            ___________________________________________________

            Use Show Custom Dialog with an Input field configured with the bullets option so the user can enter a password (or username and password) into a global field or fields(s), then use a script to verify the password entered.

            What does it mean Phil? I only created 2 additional global fields USERNAME and PASSWORD and thats it, try to used script but doesnt work, try to use relogin here and the same problem came out. What is the script for this Phil that will verify the Username and Password based on the Account Name and Password given during opening of the filemaker file.

            For now here's my script for this Show Custom Dialog method:

            Show Custom Dialog [Student Information::USER; Student Information::PASS]

            -------next script please

            ------next script please

            thanks Phil

             

            • 3. Re: Please help for my button script problem!
              philmodjunk

              This script worked for me in my tests. The account name and password fields appear empty when the log in dialog pops up:

              Set Error Capture [on]
              Re-login [] //note that no account name or password is specified and perform without dialog is NOT selected.
              If [ get ( lasterror ) = 0 // correct password entered and cancel was not clicked ]
                 Go To Layout [//specify layout you want here]
              End If

              To use show custom dialog, you have to also have a table of user names and passwords. Your follow on scripts check the value of your two fields where this data was entered against your table and only allows layout change if a record in the table with the specified name and password is found.