Jump to content

Safe javascript login?


lifeseries

Recommended Posts

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head> <title>Untitled Page</title> <script LANGUAGE="JavaScript">// ** Functions() (NON-EDITABLE)function LogIn(){loggedin=false;// ** Login by text boxpassword = document.getElementById('pass').value;password = password.toLowerCase();username = document.getElementById('user').value;username = username.toLowerCase();// ** Login Names and P-words (EDITABLE)if (username == "user1" && password == "pass1") { loggedin=true;window.location="a.html";}if (username == "user2" && password == "pass2") {loggedin=true;window.location="b.html";}// ** Alert for incorrect (EDITABLE BUT NOT RECOMENDED)if (loggedin==false) {alert("Login failed!\n\nPlease supply new credentials.");}}</SCRIPT><csactions> <csaction name="C053018F0" class="Password Plus" type="onevent" val0="188560" val1=""></csaction> <csaction name="C05301A71" class="Password Plus" type="onevent" val0="3164528" val1=""></csaction></csactions><csscriptdict import> <script type="text/javascript" src="file:///Users/g4/Library/Preferences/Adobe/GoLive/Settings7/JScripts/GlobalScripts/CSScriptLib.js"></script></csscriptdict> <csactiondict> <script type="text/javascript"><!--CSAct[/*CMP*/ 'C053018F0'] = new Array(PVpassword,'188560','');CSAct[/*CMP*/ 'C05301A71'] = new Array(PVpassword,'3164528','');// --></script></csactiondict> </head> <body> <font color="#432aff">Username: </font><font size="+3"><input type="text" id="user" /></font> <p><font color="#3300ff">Password:</font> <font size="+3"><input onclick="CSAction(new Array(/*CMP*/'C053018F0',/*CMP*/'C05301A71'));return CSClickReturn()" type="password" id="pass" csclick="C053018F0,C05301A71" /></font></p> <p> <input type="button" value="Go" onclick="LogIn();" /></p> </body></html>Hi , can anyone help me on this?In the function login(), can i pass in the encryted password to validate the user? Because in the method above, when anybody click view source, they are able to see the user name and password, can anybody tell me what is the command to call the encryted password?Thanks :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...