View Full Version : User autentification system
malotor
7 Jul 2007, 3:38 AM
Here is my user authentification system. Enjoy it!!!
[HTML]<html>
<head>
<title>LimeStudio - Servicios de imagen,comunicaci
DigitalSkyline
7 Jul 2007, 10:34 AM
A good start, thanks for sharing.
pshft
11 Jul 2007, 8:53 AM
Agreed! This is a great start. Is there a way to show the login window automatically if a user clicks on a secure link?
malotor
12 Jul 2007, 11:54 PM
Agreed! This is a great start. Is there a way to show the login window automatically if a user clicks on a secure link?
mmm maybe you can do something like this
<a href="..." onclick="return openLogin();"></a>
function openLogin()
{
//Generate a Ext pop up with de login form
...
if (user_validated) return true;
else return false;
}
elrems
7 Nov 2007, 7:43 AM
I make the adaptation for my authentification system with extjs2.0
My login2.php page
<html>
<head>
<title>Login page</title>
<link rel="stylesheet" type="text/css" href="../resources/css/ext-all.css">
<link rel="stylesheet" type="text/css" href="../resources/css/xtheme-gray.css">
<script type="text/javascript" src="../adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../ext-all.js"></script> <!-- core of Ext -->
<script type="text/javascript" src="../build/locale/ext-lang-fr.js"></script>
<script type="text/javascript" src="login2.js"></script>
<link rel="stylesheet" type="text/css" href="./extjs/examples/form/forms.css" />
<script type="text/javascript" src="./extjs/examples/examples.js"></script>
</head>
<body>
<form id="form1" class="x-form">
<input name="hidden" type="hidden" value="" />
<div id="formPanel" style="width:300px;">
<div class="x-box-tl"><div class="x-box-tr"><div class="x-box-tc"></div></div></div>
<div class="x-box-ml"><div class="x-box-mr"><div class="x-box-mc">
<h3 style="margin-bottom:5px;">Login</h3>
<!-- begin form layout -->
<div class="x-form-bd" id="container">
<div class="x-form-item">
<label for="required">User:</label>
<div class="x-form-element">
<input type="text" size="24" name="user" id="user" />
</div>
</div>
<div class="x-form-item">
<label for="alpha">Password:</label>
<div class="x-form-element">
<input type="password" size="24" name="password" id="password" />
</div>
</div>
<div id="button_login"></div>
</div>
<!-- end form layout -->
</div></div></div>
<div class="x-box-bl"><div class="x-box-br"><div class="x-box-bc"></div></div></div>
<div id="systemMsg"></div>
</div>
</form>
</body>
</html>
My login2.js page
[CODE]
loginForm = function() {
return {
init : function(){
Ext.form.Field.prototype.msgTarget = 'under'
var required = new Ext.form.TextField({
allowBlank:false
,applyTo:'user'
});
var alpha = new Ext.form.TextField({
allowBlank:false
,inputType: 'password'
,applyTo: 'password'
});
var login = new Ext.Action({
text: 'Valider'
,applyTo: 'button_login'
,handler: function(){ send(); }
//,iconCls: 'blist'
});
// var loginbutton= new Ext.Button('button_login', {text:'login', handler: this.send});
var loginbutton = new Ext.Button(login);
var formPanel = Ext.get("formPanel");
formPanel.center();
}
};
}();
function success(response) {
var result = Ext.decode(response.responseText);
switch(result.status){
case 'true': window.location="./index.php?id="+result.value; break;
case 'false': Ext.getDom('systemMsg').innerHTML=result.value;
}
};
function failure() {
Ext.MessageBox.alert('Message', 'Probl
tavox
11 Nov 2007, 6:05 PM
thanks for sharing, great work, i just test it and works fine.
Pytte
13 Nov 2007, 11:59 AM
umm .. how can u rely on text coming back to javascript for security? This can be altered?
I cant see how this is secure..
DigitalSkyline
13 Nov 2007, 1:15 PM
I guess it depends how you use it... it can be secure (just as secure as any web form) as long as access to the privileged content is controlled by the server (as usual).
JeffHowden
14 Nov 2007, 1:50 AM
It's really no more or less secure than a standard HTTP request. What matters is what you put in place on the server to ensure access is granted/information is given only as appropriate.
softm
19 Jan 2011, 1:17 PM
Where is all other code ... it was lost, or it does not exist :) ?
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.