Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Custom login screen? 1

Status
Not open for further replies.

RubenVanDenOord

Programmer
May 26, 2003
11
NL
Hi Filemakerians,

I want to create a login screen that checks usernames and passwords in a user database before the script redirects to the main database.

I'm a newbie, and not ashamed to tell.

Anyone outhere who can help me out? Please? Anyone? Hello????? Heeeeeeeeeeelp!

Ruben
 
A password page can be as simple a new layout in your main database.

Create a new page with a user login entry field. Then write a startup script. The startup script needs to be setup to run automatically when the database is open.

To do this go to Edit, Preferences, Document, and select When Opening run at startup, "Startup script".

You need a user input user name field and pass word field. We will compare their input with the authorized user database.

The startup script needs a few key components in it.

USER ABORT OFF
TOGGLE STATUS AREA(off,locked)

//(turn this on while writing and designing the script. We don't want to allow the user the ability to by pass our startup script.)//

Go to Layout( login)
pause script

//(the script pauses to allow the user to input their user name and password. The user then would click a Continue button, which directs the script to resume.)//

Loop
exit loop if(user login = user login verify

//(setup a relationship to verify the user input password with the database password content. The user name is this side of the relationship and the password is the item being verified through the relationship. If the user name is input incorrectly, the password will not be valid so the login will fail if the password or user name is incorrect.)//

else
Setfield(user name, "")
Setfield(user password, "")
Show Message(exit, continue, "The user name and password cannot be found. You may select continue to try again or Exit to end this session".
if(Status(currentmessagechoice)= 2
exit application
end if


//(The show message dialog allows you to give them another chance to reenter the user name and password. if the user selects button 1, there is no action defined to the script will resume. Selection of the second button will exit the application.)//

This is is the basics. We want the user to be caught in an endless loop unless they choose exit or have the right password.

I'm using FM 6.0 developer. They added a Show Dialog feature to it. (I didn't have the previous version so I don't know when it came to the program) This Show Dialog has a password feature built in that changes the password entry to *****. It would basically work the same as above where the database opens to a harmless screen with no navigation buttons on it.

Other things to consider are any other files in your solution. What if the user opens the user password file and not your primary file?

To prevent this, every file in your solution should have a startup script. This startup script will simply tell the the primary file to: Open(Primary file Name) This will force the login script to run. This script should also have USER ABOUT OFF and TOGGLE STATUS AREA(off,locked)

I'm likely forgetting something here, but this gives you a start.

I hope this help you.

Marty
 
..this is instant web publishing?
IF NOT it is as easy as creating a page with a 2 text form-fields on it...no scripts needed.
BTW: running sripts on the web = drinking olive oil to see what happens......"it" will hit the fan :D
 
ooops just saw this.....nm if you are not talkin about the web go with the script..just saty close to the bathroom :)
good luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top