8 Replies Latest reply on Jan 21, 2017 11:54 AM by landphil11

    Open WebDirect Database with no login


      Is there was way to open a WebDirect database without prompting the user to enter an userID? I know you can skip the need for a password. I am hoping to skip that barrier all together and just present the data right away without any further hurdles.


      I also do not want them to have to create a guest account or anything like that.



        • 1. Re: Open WebDirect Database with no login

          In File Options, set the Login option to use a given username and password. Be aware that that user should have a privilege set that very carefully controls access to layouts, scripts, and so on. Hide the menubars and toolbars. Remember...any user you allow in this way is already "inside the barn".

          1 of 1 people found this helpful
          • 2. Re: Open WebDirect Database with no login

            In addition to this, you can also specify that the auto-login user has a privilege set that only allows login from webdirect.


            Even better, write your own auto-login script and set it as the OnFirstWindowOpen Trigger Script:


            If [ get(systemplatform) = 4 ]

              Re-Login [ webdirectuser ; webdirectpassword ]

              Go To Layout [ webdirecthomepage ]


              Other actions for non-webdirect users

            End If

            1 of 1 people found this helpful
            • 3. Re: Open WebDirect Database with no login
              Johan Hedman

              Consider that there is Security to think about if you let your users into your system without Username and Password

              • 4. Re: Open WebDirect Database with no login

                Thanks Mike and DT, this sounds promising. I tried Mike's script method but could not get it to work, I must be doing something wrong? It still demands an user and password.


                I think DT's method could work because I could just train our staff to hold down the shift key when opening the file so they enter their own user IDs. In fact this method does work, but a new problem arose. Since the layout I want to show has a calculation field that borrows from a related file, it also wants an user ID and pw for that file, so I'd want to also skip that log window, or find another way to set up that field that would not trigger the need for that extra window. Actually, if you hit cancel on the prompt for user/pw for the related file, the main file and layout show up just fine without any issue, but I do not want folks to have to make that extra click. Too many people will not try that and will abort.


                Thoughts? I really appreciate your help!


                PS, I did indeed set up the security to limit what the general user can do when they get in. They can only see one layout and only have read-only access.

                • 5. Re: Open WebDirect Database with no login

                  What's your overall goal and situation? You have some users who will access the solution via WebDirect, and some office users who will access it via FMP? With regard to the related file, does it need to be open for any reason other than to display the result of a calculation? Also, which version of FMP are you using? Which version of FileMaker Server?

                  • 6. Re: Open WebDirect Database with no login

                    @dtcgnet , thanks for responding. You are right, I have some staff who use the fully capable database in the office, and then I have the public who I only want to see a subset of the data on WebDirect.


                    For the related file, it does need to be accessed to display some key data, but it does not need to be opened itself, nor displayed itself (in fact, that would be bad, lot's of personal info contained therein). Specifically, the data I am showing the public is a catalog of roses in a rose garden. Some of the roses are "adopted" (customers make an annual charitable donation to support the garden) and the information about whether or not a rose is adopted is on the other file. The distinction of adopted vs. not adopted is crucial since one of the main reasons for perusing the catalog is to look for a rose that is available for adoption.


                    This is version 14, and the server is in the cloud, hosted by triple 8, and is also 14. Thanks for your help!

                    • 7. Re: Open WebDirect Database with no login

                      I'd create a privilege set specifically for the WebDirect users, and one for generic users. Lock them down tight with regard to access to data, layouts, and scripts. Make sure that security for the users of those privilege sets can't do things you don't want them to do. Generic users get to run the Startup script, see one layout, and not be allowed to see or access any data tables other than the generic table you create with no records and no fields. The WebDirect privilege set is whatever you need it to be.


                      In File Options, check the option for Switch to Layout, and land all users on a layout which uses the generic table as the basis for the layout. In order to allow the web users to enter the database without requiring them to login, use the File Options method and login every user with credentials set to something for generic users. Then your startup script takes over. Have it detect if the user is using a browser, and if so, use a re-login step to log them in with your WebDirect account and password. If the user is using FileMaker Pro, issue a re-login step but provide no credentials so they have to enter their own.


                      Something like:


                      allow user abort [off]

                      set error capture [ on ]

                      If [ get(systemplatform) = 4 ]

                        Re-Login [ Account Name: "webdirectuser" ; Password: •••••• ; With dialog: Off ]

                        Go To Layout [ webdirecthomepage ]

                        Exit Script

                      Else If [ Get ( AccountPrivilegeSetName ) = "The Generic Privilege Set" ]

                        Re-Login [ With dialog: On ]

                      End If

                      If [ Get ( LastError ) ]

                      Show Custom Dialog to alert the user their credentials weren't valid

                      Close File

                      End If

                      # Comment: At this point, the user has been identified as a non WebDirect user and has been authenticated.

                      Go to Layout, do all your things, and so on.


                      If a user logs in via WebDirect, the default username, password, and privilege set will be changed to your WebDirect username, password, and privilege set automatically.


                      If a user is not using WebDirect, but IS still assigned the generic privilege set that is the default login, then the user will be forced to login with valid credentials. They will have one opportunity to login (because Error Capture is on). If they enter invalid credentials, the file will be closed. Otherwise, the startup script will continue, and the user will have entered the valid credentials they typically do.


                      I'd add a table occurrence from the external file using Manage External Data Sources. No need to explicitly open the file then, but you could access the data that you need to access.


                      Set things up in a COPY of your file, and TEST, TEST, TEST.


                      1 of 1 people found this helpful
                      • 8. Re: Open WebDirect Database with no login

                        Thanks everyone, with all of your help, I think I got this to work!