|
|
@ -104,30 +104,18 @@ ${functions}
|
|
|
|
function login() {
|
|
|
|
function login() {
|
|
|
|
if (!$("#formAuthentication input").validInputs()) return;
|
|
|
|
if (!$("#formAuthentication input").validInputs()) return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var params = {
|
|
|
|
var params = {
|
|
|
|
account:$("#userId").val(),
|
|
|
|
account:$("#userId").val(),
|
|
|
|
password:$("#password").val(),
|
|
|
|
password:$("#password").val(),
|
|
|
|
institute:$("#institute").val()
|
|
|
|
institute:$("#institute").val()
|
|
|
|
<%--, rememberCredentials:true--%>
|
|
|
|
<%--, rememberCredentials:true--%>
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
json.post({
|
|
|
|
json.post({
|
|
|
|
url:wctx.url("/login.do"),
|
|
|
|
url:wctx.url("/login.do"),
|
|
|
|
data:params,
|
|
|
|
data:params,
|
|
|
|
success:function(resp) {
|
|
|
|
success:function(resp) {
|
|
|
|
if (resp.authenticated) {
|
|
|
|
if (!(resp.authenticated)) {
|
|
|
|
if (resp.message)
|
|
|
|
|
|
|
|
dialog.alert({
|
|
|
|
|
|
|
|
content : resp.message,
|
|
|
|
|
|
|
|
init : function() {
|
|
|
|
|
|
|
|
setDialogZindex();
|
|
|
|
|
|
|
|
focusClose();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wctx.home();
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
dialog.alert({
|
|
|
|
dialog.alert({
|
|
|
|
content:resp.reason,
|
|
|
|
content:resp.reason,
|
|
|
|
init : function() {
|
|
|
|
init : function() {
|
|
|
@ -136,7 +124,25 @@ function login() {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onClose:() => $("#userId").focus()
|
|
|
|
onClose:() => $("#userId").focus()
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(resp.message){
|
|
|
|
|
|
|
|
dialog.alert({
|
|
|
|
|
|
|
|
content : resp.message,
|
|
|
|
|
|
|
|
init : function() {
|
|
|
|
|
|
|
|
setDialogZindex();
|
|
|
|
|
|
|
|
focusClose();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
onOK : function() {
|
|
|
|
|
|
|
|
wctx.home();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wctx.home();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|