mirror of
https://github.com/kakwa/ldapcherry
synced 2024-12-22 12:50:18 +01:00
adding piece of javascript to display custom ppolicy messages
This commit is contained in:
parent
451c59e875
commit
27e05ac7f2
21
resources/static/js/ppolicy.js
Normal file
21
resources/static/js/ppolicy.js
Normal 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',
|
||||
}
|
||||
})
|
Loading…
x
Reference in New Issue
Block a user