User Name and Password - Step Four: Option: Setting Multiple User Names and Passwords
Posted by : PhilS on Aug 22, 2008
Most people will want to have more than one user! The above ActionScript is only good for a single user. If you have a small number of users you can add the ActionScript below. It is easy to add the script but there is one snag. The User Name is not linked to any particular Password. In other words I could use my User Name and any of the listed passwords not just my own. But both the User Name and the Password have to be typed exactly as listed in the ActionScript. Now if you only have a few users that is probably not a problem and there is no way that the Users would ever know that there is a security vulnerability. In the next tutorial (User Name and Password - Advanced Features) I will show you how to match individual User Names with their own unique Password. I have not done so here because it is complicated and for many people the solution below is secure enough.
To add more possible passwords:
Look for the this line of ActionScript (as detailed in Step three, point 2 ) where it says:
} else if (_root.Password == "wasp") {
Edit the above line to look like this:
} else if (_root.Password == "wasp" | _root.Password == "MyOtherPassword" | _root.Password == "MyFinalPassword" ) {
You can change the word between the "quotes" as required and to add more possible passwords just keep adding a, line between the open and close brackets like this:
| _root.Password == "WhatEver"
[quote]Note: The vertical line: | used in script above stands for or. Knowing this makes it easier to read: This password *or *this password *or *this password etc.[/quote]
To add more User Names:
Look for the this line of ActionScript (as detailed in Step three, point 5 ) where t says:
} else if (_root.UserName == "web") {Edit the above line to look like this:
} else if (_root.UserName == "web" | _root.UserName == "bob" | _root.UserName == "cat") {As before, change the word in the "quotes" and add as many User Names as you need.
Important Warning!
It is possible for people to hack Flash files and get access to the passwords and usernames. Never rely on a Flash Movie to protect really important or valuable information, as its not secure enough. The best protection against hacking is in the Publish Settings. To make your Movie much more secure, go to the Publish Settings and select:
- Protect from Import
- Compress Movie
- Set a password
To access the Publish setting open your Flash file and go to: File - Publish Settings - Select Flash - Flash Tab
[quote]**Cross Ref:** If you would like to add some additional features to your User Name/Password controls see the next Tutorial: [**User Name and Password - Advanced**][2][/quote]
Source: http://www.webwasp.co.uk/tutorials/b25-username-pw/index.php

no comment
Add comment