mirror of
https://github.com/kakwa/ldapcherry
synced 2025-07-03 20:07:42 +02:00
adding piece of javascript to display custom ppolicy messages
This commit is contained in:
parent
451c59e875
commit
27e05ac7f2
1 changed files with 21 additions and 0 deletions
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…
Add table
Add a link
Reference in a new issue