PDA

View Full Version : [3.0] New Ext.ux.LoginWindow 1.0



wemerson.januario
12 May 2009, 8:28 AM
Hi people!
This is my first extension. Thanks for all. I have been studing Extjs since 08/2008 and now I release my first one mini project. I hope it can useful for someone. I based this ux in Ext.ux.form.LoginDiaog, I just added some more configs and function. Now the Language function is done!

Usage:
Just paste the unziped folder to extjs' 3.0 examples folder.
Create a database (loginwindow) on mysql and execute que sql file.
Finish, just test and smile!

Some useful config


modal: true, = Set model true or false
//formBgcolor:'#f0edce', = Set the form background color
defaultLanguage: 'pt_BR', set the default dialog language default
the avaible values are: pt_BR, es, and en
basePath: 'img', = set the image directory
winBanner: 'logo.png', set your logo banner 415 x 110
url: 'php/login.php', set the login request file
emailUrl: 'php/login.php', set the email recover request file
locationUrl: 'main.php'= set the location file.
encryptType: 'md5', //possible values 'md5' or'sha1' password crypt
enableVirtualKeyboard : true, habilita o teclado virtual
Name: Ext.ux.LoginWindow
Version: 1.0
Last update: 09/05/2009

Name: Ext.ux.LoginWindow
Version: 1.6
last changes : 06/16/2010
Change log: virtual keypad, md5 ou sha1 for password crypt, password recover, limpeza no código fonte retirando repetições desnecessárias, gravação de nome de usuário no cookie entre outros

Please test and send bug. it is free and open for modification.

Thanks
Download or Attachement
http://wjweb.com.br/projetos/Ext.ux.LoginWindow-1.6.zip
Google code
http://code.google.com/p/login-window/



Hello Brazil!!!!!
Olá galera!
Esta é minha primeira extensão. Janela de login com suporte a três idiomas, teclado virtual, recuperação de senha, encripitação de dados em md5 e sha1 entre outros.

Uso:
Apenas cole a pasta apos descompacta las a pasta de exemplos do extjs 3.2.1 .
Crie um banco de dados (loginwindow) no mysql e executa arquivo de sql
Pronto só teste e saia para o abraço! !

Algumas configurações úteis



/ /formBgcolor: ' #f0edce ', = seta a cor de fundo do formulario
defaultLanguage: ' pt_BR', seta o idioma padrão os valores disponiveis são: pt_BR, es e en
basePath: ' img', seta o diretório de imagem
winBanner: ' logo.png', seta o logotipo 415 x 110
url: ' php/login.php ', seta o arquivo de requisição de login
emailUrl: ' php/login.php ', seta o arquivo de requisição de recuperação de senha
locationUrl: ' main.php' = seta o arquivo de redirecionamento
encryptType: 'md5', //valores possiveis 'md5' ou 'sha1' criptografia da senha
//usernameVtype: 'cpf', Se quiser altenticar por cpf descomentar isso
enableVirtualKeyboard : true, habilita o teclado virtual

Nome: Ext.ux.LoginWindow
Versão: 1.0
ultima atualização: 09/05/2009


Nome: Ext.ux.LoginWindow
Versão: 1.6
ultima atualização: 16/06/2010
Alterações: teclado virtual, criptogravia de senha em md5 ou sha1, validação de cpf, recuperação de senhas, limpeza no código fonte retirando repetições desnecessárias, gravação de nome de usuário no cookie entre outros


Por favor envie feedback. A UX está aberta para modificações.

Obrigado

Download
http://wjweb.com.br/projetos/Ext.ux.LoginWindow-1.6.zip
Google code
http://code.google.com/p/login-window/

Obrigado
See ScrenShot in the attachment

Scorpie
12 May 2009, 11:38 PM
Looks good!

Fabyo
20 May 2009, 4:24 AM
O idioma só funciona para as labels, mas as mensagens de erro só em inglês
voce poderia setar para ele pegar o js do idioma e mostrar a mensagem de erro no idioma correto.

t+

wemerson.januario
20 May 2009, 11:39 AM
Ok, coloquei ja na lista para inclusão para a proxima versão.
I have just added to next version

gend
29 May 2009, 5:25 AM
Hola Wemerson, espero entiendas un poco español, soy principiante en EXTJS y para iniciar una aplicación de cero lo primero que siempre se busca es el login, y este ejemplo es perfecto, pero no lo puedo hacer funcionar, cuando intento loguear queda el mensaje "Envío de Datos..".
Te comentó que le agregué la librería "Ext.Util.Md5.js" en la carpeta /js, siendo que no la tenía y en el archivo index.php hace la referencia.

Te agradecería mucho puedas ayudarme.

Un abrazo.

peacock
1 Jun 2009, 6:40 AM
Very good!

gend
2 Jun 2009, 6:42 AM
Wemerson, encontré los problemas, son los espacios en blanco al final de los PHP los que me generaban los problemas. Ahora funciona a la perfección.

Stripeman
16 Jun 2009, 3:48 AM
Btw.. sweet looking mod and seems simple enough to mod for my use... thanks so much!!!

i keep getting an syntax error once i hit login...even with unmodded files .

no matter what lang is selected btw..

even tried with latest version of ext (ext-3.0-rc2) and with ext-2.2.1 same error...

Gareth Bult
19 Jun 2009, 7:38 AM
For some reason (?) the download link above seems broken ??

Anywhere else I can download from?

Stripeman
19 Jun 2009, 9:43 AM
use firefox NOT IE

Gareth Bult
19 Jun 2009, 9:56 AM
Like I would allow a copy of IE in the building ... :))

So .. where can I download it from ... ? :D

Stripeman
19 Jun 2009, 10:32 AM
Like I would allow a copy of IE in the building ... :))

So .. where can I download it from ... ? :D

I know the feeling... here (ill keep it up for a few days)

http://www.revictionguild.org/extTest/Ext.ux.LoginWindow.zip

But. i have made some changes to it because of a couple of errors. (some better error control) and explanations in english.. I will try to upload soon. The link provided above is UNmoddified

Stripeman
19 Jun 2009, 10:49 AM
btw... did a mssql version as well

wemerson.januario
19 Jun 2009, 11:12 AM
The download link is OK. try again. People, sorry for not reply the thread before. I working hard this month, but as soon as possible I will upload it in google code and for the the best I am working in the 1.5 version. just wait.

1 - I am fixing the locate messeges bug.
2 - I am translating the php class to english nomenclature to make easy for everybody understand, because now is in portugues.
3- fixing the disable buttons when submit.

if anyone want to help or want to give sugestion just post.
Thanks!!!!

Stripeman
19 Jun 2009, 12:22 PM
btw... did a mssql version as well

wemerson.januario
19 Jun 2009, 1:10 PM
good idea!
I will implementes a function tha select the database and add 2 more classes. postgres and mssql. Thanks

Stripeman
19 Jun 2009, 1:28 PM
ill make note here some changes that i made - maybe you can add them

also...

if you put this in your scripts (top)


error_reporting(0);

you dont have to worry about php errors that cause the response to come back mixed in with php error codes/messages. Just be sure to error check and use "die()" vs response

Stripeman
19 Jun 2009, 1:38 PM
Change in the connect function for (mssql) - notice more messages



protected function connect() {

if (function_exists('mssql_connect')){

$this->link = mssql_connect($this->host, $this->user, $this->password);

if ($this->link) {
$db_selected = $this->select_db();
if (!$db_selected) {
die("{errors:[{id:'username', msg:'Unable to select the Database.'}]}");
}
}else{
die("{errors:[{id:'username', msg:'Unable to connect to the database.'}]}");
}

}else{
die("{errors:[{id:'username', msg:'function mssql_connect not found.'}]}");
}
}

supercharge2
24 Jun 2009, 6:21 AM
On IE8 & FF3 there is a slight visual problem. The backround shadow doesn't extend all the way to the bottom of the window, and if you adjust the browser size at all the login window shrinks up 5px or so. You can see what I am talking about looking at Stripeman previous post with screen shot. Look at the window shadow border, you can see it doesn't extend all the way to the bottom. If you move the window, the shadow extends, but then if you adjust the browser window at all it shrinks up and leaves the shadow background visable at the bottom. This doesn't occur in IE7 or IE8 compatability mode.

Stripeman
24 Jun 2009, 6:49 AM
I also added more checks in the session class:


public function login($login, $userPassword, $disclaimerId) {
$response = "{success: false}";

if (!$disclaimerId) {
die("{errors:[{id:'disclaimerId', msg:'You must agree to the disclaimer.'}]}");
}

if (!$this->exists($login)) {
die("{errors:[{id:'username', msg:'User Does not exist.'}]}");
//$response = "{success: false}";
}else if(!$this->active($login)) {
die("{errors:[{id:'username', msg:'User is not active.'}]}");
//$response = "{success: false}";
}else {
// check password
$sql = "
SELECT
tp_ID,
username,
userPassword,
FirstName AS ShowName
FROM
Members
WHERE
username = '".$login."'
AND
userPassword = '".strtoupper(md5($userPassword))."'";

if ($this->num_rows($query = $this->sqlQuery($sql)) < 1) {
die("{errors:[{id:'password', msg:'Password Incorrect: ". strtoupper(bin2hex($userPassword))."'}]}");
//$response = "{success: false}";
} else {
//$obj = null;

$obj = $this->fetch_object($query);

$_SESSION['tp_ID'] = $obj->tp_ID;
$_SESSION['username'] = $obj->username;
$_SESSION['password'] = $obj->password;
$_SESSION['eMail'] = $obj->eMail;
$_SESSION['ShowName'] = $obj->ShowName;

$sql = " UPDATE Members SET userLoggedOn=1 WHERE tp_ID = '". $_SESSION['tp_ID'] ."'";
$query = $this->sqlQuery($sql);

if($query) {
$response = "{success: true}";

}else{
die("Error setting Logged IN stauts.");
}

}
}
return $response;
}

Stripeman
24 Jun 2009, 6:52 AM
I have learned a neat trick from these forums for building dynamic options for the Ext code. Many may know this already but.. id figured id post it anyway. The reason why i did this is so that i could have log in and out buttons reflect the correct state.
I put this in the index.php page before the page that bulids my viewport.



<script type="text/javascript" language="javascript">

<?php if (!$_SESSION['username'] && !$_SESSION['password']) { ?>
var showLogOnButton = true;
var showLogOffButton = false;
<?php } else { ?>
var showLogOffButton = true;
var showLogOnButton = false;

<?php } ?>

var userShowName = "Not logged in";
var userShowNameTP = "You are not logged in. Please clikc the Login button to the left to proceed!"

<?php if($_SESSION['ShowName']) { ?>

userShowName = "Hello <?php echo $_SESSION['ShowName'];?>";
var userShowNameTP = "You are logged in as <?php echo $_SESSION['ShowName'];?>";
var userID = <?php echo $_SESSION['tp_ID'];?>

<?php }?>
</script>


Then you this when building your viewport!




if (showLogOnButton) { // SEE above for value (fetched from the database while logging in)

var addbuttons = Ext.getCmp('westToolBar');

addbuttons.add({
xtype: 'button',
text: 'Login',
tooltip:{title:'Login me In!', text:'Login for accesss!'},
iconCls:'login',
listeners:{
click: {
fn: function(node, e){
href = 'index.php?action=login';
Ext.msg.msg('Navigation Tree Click', 'You clicked: "' + href + '"');
window.location.href=href;
},
stopEvent: true
}
}
});
}else if (showLogOffButton){ // SEE above for value (fetched from the database while logging in)
var addbuttons = Ext.getCmp('westToolBar');

addbuttons.add({
xtype:'button',
text: 'Logout',
tooltip:{title:'Log me Out', text:'This will log you out and destroy your session!'},
iconCls:'logout',
listeners:{
click: {
fn: function(node, e){
href = 'index.php?action=logout';
Ext.msg.msg('Navigation Tree Click', 'You clicked: "' + href + '"');
window.location.href=href;
},
stopEvent: true
}
}
});
}
var addbuttons = Ext.getCmp('westToolBar');
if (userShowName){ // SEE above for value (fetched from the database while logging in)
addbuttons.add('-',{
xtype:'button',
id : 'userName',
tooltip:{ title:'Who am I', text: userShowNameTP },
text: userShowName, // SEE above for value (fetched from the database while logging in)
pressed: true,
listeners:{
click: {
fn: function(node, e){

var isName = Ext.getCmp('userName').text;
Ext.msg.msg('Navigation Tree Click', 'You clicked: Your Name! Your User ID is: ' + userID); // SEE above for value (fetched from the database while logging in)
}
}
}
});
}

Stripeman
24 Jun 2009, 7:03 AM
updated...added images and more ext code

Stripeman
24 Jun 2009, 7:09 AM
I also expanded the login dialog so that its maditory to check that check box.. but for now i only have an alert dialog.. YUCK.. i want validation on it just like the text fields.. but seems that checkboxes are limited for some reason. Not sure if its a Ext or html limitation.

Ext.ux.LoginWindow.js begin at line 121 insert:



,
{
xtype: 'checkbox',
id: 'disclaimerId',
name: 'disclaimerId',
validateOnBlur: true,
allowBlank: false,
fieldLabel: "Disclaimer",
boxLabel: "Agree?&nbsp;(Read&nbsp;below)",
//anchor: "0%",
//handler: function() {Ext.get(this._loginButtonId).setVisible(false)},
validateValue: function(){
var checkVal = this.getValue();
if (!checkVal){
Ext.MessageBox.alert('Manditory Field', 'You must first agree to the Disclaimer');
}else{
return true;
}
}
},
{
//xtype: 'fieldset',
html: "By using this you understand that Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla. ",
width: 404,
padding: '4px'
}

tomim
29 Jun 2009, 9:52 AM
Hello all,

This is modified version of Ext.ux.LoginWindow where I have added
support for captcha and dynamic translation of UI with Google Translation API.

In the attatchement one will find ziped Eclipse project that can be rebuilt and deployed on the Tomcat or any other java web server.

When you start the Tomcat and install the war file go to

for PHP version
http://localhost:8080/captcha

or

for java version
http://localhost:8080/captcha/index_java.html

and try to change the language or click on the captcha image to reload with the new code.

Server side is written in Java but also the PHP version is available.
NOTE: Server side login is not implemented, only front end for automatic Google translation and captcha image generation.

If you would like to write your own login on the server side, to check for captcha validity
get Http context session then get session parameter "captcha" to retrieve text version of captcha image.


For PHP version I'm using Resin Quercus java library (PHP engine 100% written in Java).
There is no need for PHP instalation :).
For more info go to http://www.caucho.com/ and http://quercus.caucho.com/

Requirements : java jdk 1.5 ; Tomcat 5/6 ; Eclipse ; ExtJs 3.0

Install :
1. Unzip project in Eclipse workspace folder and import it.
2. Download resinn from http://www.caucho.com/download/resin-4.0.0.zip and copy all jar files from lib folder to project subfolder WebContent\WEB-INF\lib
3. Fix paths to libraries. (included in project subfolder WebContent\WEB-INF\lib).
4. Create new Server project; create server instance in Eclipse; add captcha project to Server instance and start it up from Eclipse.
5. Create new empty Dynamic Web Project and copy EXTJS3 library inside. Deploy it to server instance also.
6. Start Tomcat in Eclipse and right click to index.html -> Run As -> Run on Server. File is in WebContent of Captcha project.

IMPORTANT NOTE : Resin class com.caucho.vfs.HttpStream has a bug so you need to remove it from resin.jar (open with winzip or winrar). When project is rebuilt , new replacement class will be used. Source is included inside project. For more details see header in included HttpStream.java file.

06/30/09
I have added file addon.zip. Overwrite javascripts with this ones to get improved :) version with automatic translation. Components will be detected and default fields will be automatically translated. This is not finnished yet , I need to add more functions to support all components of ExtJs. For more info see strings.js.

Thanks to authors of original Ext.ux.LoginWindow for idea :) !!!!

07/02/09
Project for Google Translation is opened on this thread. Any new updates will be there.
http://extjs.com/forum/showthread.php?t=72978

shc814
29 Jun 2009, 6:52 PM
[Mon Jun 29 22:36:22 2009] [error] [client 24.102.255.107] File does not exist: /home/user/public_html/system/404.shtml, referer: http://domain.com/login/index.php
[Mon Jun 29 22:36:22 2009] [error] [client 24.102.255.107] File does not exist: /home/user/public_html/system/login/js/Ext.Util.Md5.js, referer: http://domain.com/login/index.php
[Mon Jun 29 22:36:18 2009] [error] [client 24.102.255.107] PHP Warning: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /home/user/public_html/system/login/php/main.class.php:45) in /home/user/public_html/system/login/php/main.class.php on line 16, referer: http://domain.com/login/index.php
[Mon Jun 29 22:36:18 2009] [error] [client 24.102.255.107] PHP Warning: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cookie - headers already sent by (output started at /home/user/public_html/system/login/php/main.class.php:45) in /home/user/public_html/system/login/php/main.class.php on line 16, referer: http://domain.com/login/index.php
[Mon Jun 29 22:36:18 2009] [error] [client 24.102.255.107] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/user/public_html/system/login/php/main.class.php:45) in /home/user/public_html/system/login/php/main.class.php on line 14, referer: http://domain.com/login/index.php


Can't get past the "Sending data..." loading phase.

mystix
29 Jun 2009, 7:32 PM
For PHP version I'm using Resin Quercus java library (PHP engine 100% written in Java).
There is no need for PHP instalation :).
For more info go to http://www.caucho.com/ and http://quercus.caucho.com/


woah neat! thanks for the link :)

shc814
30 Jun 2009, 3:58 PM
Wemerson, encontré los problemas, son los espacios en blanco al final de los PHP los que me generaban los problemas. Ahora funciona a la perfección.

Thanks - easy fix for my above problem.

higorvaz
13 Jul 2009, 9:14 AM
Hi people!
This is my first extension. Thanks for all. I have been studing Extjs since 08/2008 and now I release my first one mini project. I hope it can useful for someone. I based this ux in Ext.ux.form.LoginDiaog, I just added some more configs and function. Now the Language function is done!

Usage:
Just paste the unziped folder to extjs' 3.0 examples folder.
Create a database (loginwindow) on mysql and execute que sql file.
Finish, just test and smile!

Some useful config


modal: true, = Set model true or false
//formBgcolor:'#f0edce', = Set the form background color
defaultLanguage: 'enus', set the default dialog language default is ptbr
the avaible values are: ptbr , eses , frfr , itit , enus
basePath: 'img', = set the image directory
winBanner: 'logo.png', set your logo banner 415 x 110
url: 'php/login.php', set the login request file
emailUrl: 'php/login.php', set the email recover request file
locationUrl: 'main.php'= set the location file.

Name: Ext.ux.LoginWindow
Version: 1.0
Last update: 09/05/2009

Please test and send bug. it is free and open for modification.

For more. see readme file.
Thanks
Hello Brasil!!!!!


Ola galera do Brasil!
Esta é minha primeira extensão. Obrigado por tudo. Eu estou estudando Extjs desde 08/2008 e agora eu liberto meu primeiro mini projeto. Eu espero que possa ser útil para alguém. Eu basiei este ux em Ext.ux.form.LoginDiaog, eu adicionei um pouco mais de propiedades e função. Agora a função de Idioma esta funcionando e envia via post o idioma selecionado!

Uso:
Apenas cole a pasta apos descompacta las a pasta de exemplos do extjs 3.0 .
Crie um banco de dados (loginwindow) no mysql e executa arquivo de sql
Pronto só teste e saia para o abraço!

Algumas configurações úteis


modal: true= modelo de Jogo verdadeiro ou falso
/ /formBgcolor: ' #f0edce ', = seta a cor de fundo do formulario
defaultLanguage: ' enus', setao idioma padrao é ptbr
os valores disponiveis são: ptbr, eses, frfr, itit, enus,
basePath: ' img', = seta o diretório de imagem
winBanner: ' logo.png', seta o logotipo 415 x 110
url: ' php/login.php ', seta o arquivo de requisição de login
emailUrl: ' php/login.php ', seta o arquivo de requisição de recuperação de senha
locationUrl: ' main.php' = seta o arquivo de redirecionamento

Nome: Ext.ux.LoginWindow
Versão: 1.0
ultima atualização: 09/05/2009

Por favor teste e envie bugs. é grátis e aberto para modificação.

Para mais. veja arquivo de readme.
Obrigado
See ScrenShot in the attachment
Cade o arquivo Ext.Util.Md5.js???
Achei o arquivo nos forums, mas ao clicar em login fica parado com o loading e nao vai para a main.php???
Any help please?
Higor

Fabyo
13 Jul 2009, 10:59 AM
É inutil um sistema de captcha no login, porque o que esta tentando evitar?
acha que um script nao consegue logar em um sistema com captcha?

pois digo que sim, simplesmente porque qualquer sistema de login vai verificar se o usuario esta logado, mas nao importa qual seja o sistema de login que o cara use, é muito facil entrar nele via script php e com isso nao passaria mais pela tela de login.

só lembrando que nao estou insinuando nenhum metodo hacker de invasão, e sim explicando meios legais de entrar em um sistema simulando quem esta logado, basta usar o curl() do php e pronto, como falei só estou comentando que da para entrar no sistema usando um usuario e senha valido, sem passar pela tela de login, com isso fica totalmente inutil o sistema de captcha, e nao vejo aumento de segurança nenhuma incluindo o captcha no login, só da uma cara de mais seguro e só isso.

o sistema de captcha é util?, claro que sim, mas existe outras aplicações para ele do que no login.

t+ galera

OBS: sorry community, only speak Portuguese.

higorvaz
13 Jul 2009, 12:46 PM
Does anybody know what can cause not page redirect, cause after login it hangs on the modal loading, the session is true cause if I type main.php on the address bar it loads the page and the Username is printing on well.

Tested on FF3.5, Google Chrome 2.0 and IE7 the same error.

The Firebug answer tells me:

<b>Notice</b>: Undefined property: stdClass::$usu_nome in <b>C:\wamp\www\atlante\outro2\Ext.ux.LoginWindow

\php\sessao.class.php</b> on line <b>79</b><br />

<b>Notice</b>: Undefined property: stdClass::$niv_id in <b>C:\wamp\www\atlante\outro2\Ext.ux.LoginWindow

\php\sessao.class.php</b> on line <b>80</b><br />

{success: true}

Found the problem: On windows (WampServer) it don't redirect.
On my web server runs well...
http://www.plusti.net/ext/outro2/Ext.ux.LoginWindow
admin
admin

Help!!!:((

lucandmendes
20 Sep 2009, 9:39 PM
Olá,

acredito que você esqueceu de pegar mais 2 campos em uma query da sessao.class.php que são : usu_nome e niv_id nas linhas 64 segue como funcionou para mim:

// check password
$sql = "SELECT
usu_id,
usu_login,
usu_nome,
niv_id
FROM
usuarios
WHERE
usu_login = '".$login."'
AND
usu_senha = '".$senha."'";
if ($this->num_rows($query = $this->sqlQuery($sql)) < 1) {
$response = "{errors:[{id:'password', msg:'Senha incorreta'}]}";
} else {
$obj = $this->fetch_object($query);

$_SESSION['usu_id'] = $obj->usu_id;
$_SESSION['usu_nome'] = $obj->usu_nome;
$_SESSION['niv_id'] = $obj->niv_id;
$response = "{success: true}";

}
}




Abraços!



Sorry i don't translate to english.


I think that have a error that you don't select the fields "usu_nome" and "niv_id" from sessao.class.php


// check password
$sql = "SELECT
usu_id,
usu_login,
usu_nome,
niv_id
FROM
usuarios
WHERE
usu_login = '".$login."'
AND
usu_senha = '".$senha."'";
if ($this->num_rows($query = $this->sqlQuery($sql)) < 1) {
$response = "{errors:[{id:'password', msg:'Senha incorreta'}]}";
} else {
$obj = $this->fetch_object($query);

$_SESSION['usu_id'] = $obj->usu_id;
$_SESSION['usu_nome'] = $obj->usu_nome;
$_SESSION['niv_id'] = $obj->niv_id;
$response = "{success: true}";

}
}

Thomas Triplet
25 Sep 2009, 10:00 AM
I think t here's a security issue here because the password is transmitted in plain text.

You probably want to add the following to the submit function:


submit : function () {
var form = this._formPanel.getForm();

if (form.isValid())
{
Ext.getCmp(this._loginButtonId).disable();
if(Ext.getCmp(this._cancelButtonId)) {
Ext.getCmp(this._cancelButtonId).disable();
}
var tmp_values = form.getValues();
tmp_values['password'] = hex_md5(tmp_values['password']);
form.setValues(tmp_values);
if (this.fireEvent('submit', this, tmp_values))
{
form.submit ({
url : this.url,
method : this.method,
waitMsg : this.waitMessage,
success : this.onSuccess,
failure : this.onFailure,
scope : this
});
}
}
},


And add form.reset(); in the onFailure() function

hex_md5 was downloaded from http://pajhome.org.uk/crypt/md5/index.html

wemerson.januario
25 Sep 2009, 6:57 PM
Humm, ok, I have already thought about this, in 1.5 version of this ux, I will put this resource. I am working on free time and maybe it will be released on October.

Stripeman
28 Sep 2009, 12:00 AM
Thanks for posting Thomas.

fyi..

There is another MD5 class ux for Ext here which is the one I am using.
http://www.extjs.com/forum/showthread.php?t=28460

So I just changed one lines of code to:



tmp_values['password'] = Ext.util.MD5(tmp_values['password']);

Thomas Triplet
6 Oct 2009, 11:38 AM
Thanks for posting Thomas.

fyi..

There is another MD5 class ux for Ext here which is the one I am using.
http://www.extjs.com/forum/showthread.php?t=28460

So I just changed one lines of code to:



tmp_values['password'] = Ext.util.MD5(tmp_values['password']);



The following also works but looks nicer (no temporary vars):

Ext.getCmp(this.passwordId).setValue(Ext.util.MD5((Ext.getCmp(this.passwordId).getValue()));

Stripeman
6 Oct 2009, 10:30 PM
You meant: :P

Ext.getCmp(this.passwordId).setValue(Ext.util.MD5((Ext.getCmp(this.passwordId).getValue())));

Right?

realjax
7 Oct 2009, 1:08 AM
Hi all,

Im no php man, so plowing through the including PHP samples is not my cup of tea. I also don't speak spanish so the comments are of little help either. :)

I was just wondering how this whole md5 security works.. an md5 encrypted password is sent to the server.. and then what? How does this improve security if this same encrypted password as a string is listed in the password field of the database..

I mean, when I'm smart enough to intercept what is being sent to the server and thus obtain an md5 encrypted password then surely I am smart enough to see what request was sent to the server for logging in and just replace the md5 password with the one I intercepted...

I clearly must be missing the point here so please forgive my ignorance beforehand :D

Thanks!

Stripeman
7 Oct 2009, 1:17 AM
it only adds a little but more ...as you would still need to decrypt that MD5 string to know what the password is, because when you log in your still using your 'normal' password to log in.

Thomas Triplet
8 Oct 2009, 7:38 AM
Hi all,

Im no php man, so plowing through the including PHP samples is not my cup of tea. I also don't speak spanish so the comments are of little help either. :)

I was just wondering how this whole md5 security works.. an md5 encrypted password is sent to the server.. and then what? How does this improve security if this same encrypted password as a string is listed in the password field of the database..

I mean, when I'm smart enough to intercept what is being sent to the server and thus obtain an md5 encrypted password then surely I am smart enough to see what request was sent to the server for logging in and just replace the md5 password with the one I intercepted...

I clearly must be missing the point here so please forgive my ignorance beforehand :D

Thanks!

Right, but then your server side code should check the IP of the client. The hacker will have a different one. So you can detect some intrusions that way. Again, it's not fool-proof... but it certainly doesn't hurt to send the encrypted password. Besides, most users have the bad habit of using the same password for everything. At least, the hacker won't be able to get the plain password (we can also argue that MD5 can be broken, but it gets more complicated)

jcreator
13 Oct 2009, 8:21 AM
looks good,thanks for share it

wemerson.januario
16 Jun 2010, 6:05 PM
changes made. See atachements. Thanks

dias
26 Jun 2010, 9:38 AM
I'm trying this extension... but i think there is a bug, failure "onFailure" is fired twice.

wemerson.januario
26 Jun 2010, 5:55 PM
What is the version are you trying? Please download the lastest in google code svn. Thanks!

dias
27 Jun 2010, 6:25 AM
Hello Wemerson,

Thanks for your quick reply. I'm using version 1.6 .

wemerson.januario
27 Jun 2010, 7:15 AM
what is the line is firing twice? As soon as I arrive at home I update. Thanks for the feedback.

dias
27 Jun 2010, 2:01 PM
Não é a linha, mas sim o evento onFailure, quando faço um submit (login/password) se falhar o login, ele chama duas vezes o onFailure. Ou será que estarei a fazer algo de errado.

wemerson.januario
28 Jun 2010, 4:41 PM
Thanks Dias. Your were correct. It was calling twice. because has an actionfailed event on form definition an also has a onFailure on submit function. Remove lines 84 to 93 on form definition.
I have updated also in google code SVN

listeners: {
'actioncomplete': {
fn: this.onSuccess,
scope: this
},
'actionfailed': {
fn: this.onFailure,
scope: this
}
},

Verbal
5 Jan 2011, 11:46 PM
This makes it so you can change the Checkbox's text as well.


Ext.override(Ext.form.Field, {
setBoxLabel: function (text) {
if (this.rendered) {
this.el.up('.x-form-item', 10, true).child('.x-form-cb-label').update(text);
} else {
this.boxLabel = text;
}
}
});Here is the code used to change the language text.


Ext.getCmp(this._rememberMeId).setBoxLabel('Remeber username on this computer?');Thanks for the nice login script :)