1
0
mirror of https://github.com/kakwa/ldapcherry synced 2024-12-01 21:45:51 +01:00
ldapcherry/resources/static/js/ppolicy.js

28 lines
735 B
JavaScript
Raw Normal View History

$('#form').validator({
custom: {
'ppolicy': function($el) {
2016-07-05 19:57:35 +02:00
if(! $el.prop('required') && $el.val() == 0){
return true;
};
var $ret = 'PPolicy error';
$.ajax({
url: '/checkppolicy',
type: 'POST',
2016-07-05 19:57:35 +02:00
dataType: 'json',
async: false,
data: 'pwd=' + $el.val(),
success: function(data) {
$ret = data;
2016-07-05 19:57:35 +02:00
}
});
this.options.errors['ppolicy'] = $ret['reason'];
return $ret['match'];
}
},
errors: {
'ppolicy': 'PPolicy error',
}
})
2016-07-05 19:57:35 +02:00
// vim:set expandtab tabstop=4 shiftwidth=4: