Explorar el Código

Remove extra popup message in login validation

version-14
Nijil Y hace 13 años
padre
commit
3a483b32e8
Se han modificado 2 ficheros con 11 adiciones y 6 borrados
  1. +4
    -3
      py/core/page/login_page/login_page.js
  2. +7
    -3
      py/webnotes/auth.py

+ 4
- 3
py/core/page/login_page/login_page.js Ver fichero

@@ -17,8 +17,9 @@ pscript.onLoginReply = function(r, rtext) {
pscript.login_btn.done_working();
if(r.message=="Logged In"){
window.location.href='index.html' + (get_url_arg('page') ? ('?page='+get_url_arg('page')) : '');
} else {
$i('login_message').innerHTML = '<span style="color: RED;">'+eval(r.message)+'</span>';
} else{

$i('login_message').innerHTML = '<span style="color: RED;">'+r.message+'</span>';
//if(r.exc)alert(r.exc);
}
}
@@ -53,4 +54,4 @@ pscript.show_forgot_password = function(){
}
d.show();
pscript.forgot_dialog = d;
}
}

+ 7
- 3
py/webnotes/auth.py Ver fichero

@@ -139,8 +139,10 @@ class LoginManager:
user, pwd = webnotes.form_dict.get('usr'), webnotes.form_dict.get('pwd')

if not (user and pwd):
webnotes.msgprint('Incomplete Login Details', raise_exception=1)
webnotes.response['message'] = 'Incomplete Login Details'
raise ValidationError
#webnotes.msgprint('Incomplete Login Details', raise_exception=1)
# custom authentication (for single-sign on)
self.load_control_panel()
if hasattr(self.cp, 'authenticate'):
@@ -153,7 +155,9 @@ class LoginManager:
p = webnotes.conn.sql("select name from tabProfile where name=%s and (`password`=%s OR `password`=PASSWORD(%s)) and IFNULL(enabled,0)=1", (user, pwd, pwd))
if not p:
webnotes.msgprint('Authentication Failed', raise_exception=1)
webnotes.response['message'] = 'Authentication Failed'
raise ValidationError
#webnotes.msgprint('Authentication Failed',raise_exception=1)
self.user = p[0][0]


Cargando…
Cancelar
Guardar