ソースを参照

Remove extra popup message in login validation

version-14
Nijil Y 13年前
コミット
3a483b32e8
2個のファイルの変更11行の追加6行の削除
  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 ファイルの表示

@@ -17,8 +17,9 @@ pscript.onLoginReply = function(r, rtext) {
pscript.login_btn.done_working(); pscript.login_btn.done_working();
if(r.message=="Logged In"){ if(r.message=="Logged In"){
window.location.href='index.html' + (get_url_arg('page') ? ('?page='+get_url_arg('page')) : ''); 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); //if(r.exc)alert(r.exc);
} }
} }
@@ -53,4 +54,4 @@ pscript.show_forgot_password = function(){
} }
d.show(); d.show();
pscript.forgot_dialog = d; pscript.forgot_dialog = d;
}
}

+ 7
- 3
py/webnotes/auth.py ファイルの表示

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


if not (user and 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) # custom authentication (for single-sign on)
self.load_control_panel() self.load_control_panel()
if hasattr(self.cp, 'authenticate'): 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)) 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: 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] self.user = p[0][0]


読み込み中…
キャンセル
保存