1
0
mirror of https://github.com/kakwa/ldapcherry synced 2024-11-22 01:14:21 +01:00

adding piece of javascript to display custom ppolicy messages

This commit is contained in:
kakwa 2015-11-02 23:24:35 +01:00
parent 451c59e875
commit 27e05ac7f2

View File

@ -0,0 +1,21 @@
$('#form').validator({
custom: {
'ppolicy': function($el) {
var $ret = 'PPolicy error';
$.ajax({
url: '/checkppolicy',
dataType: 'json',
async: false,
data: 'pwd=' + $el.val(),
success: function(data) {
$ret = data;
}
});
this.options.errors['ppolicy'] = $ret['reason'];
return $ret['match'];
}
},
errors: {
'ppolicy': 'PPolicy error',
}
})