mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-26 11:52:59 +01:00
LSldapObject::validateAttrData(): fix checking LDAP validation result
This commit is contained in:
parent
7ef6e57c49
commit
957777d44f
1 changed files with 19 additions and 18 deletions
|
@ -533,27 +533,28 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check result
|
// Check result
|
||||||
if(LSconfig :: get('result', null, 'int', $test) == 0) {
|
$configured_result = LSconfig :: get('result', null, 'int', $test);
|
||||||
if($ret != 0) {
|
if(
|
||||||
|
($configured_result == 0 && $ret != 0) ||
|
||||||
|
($configured_result > 0 && $ret <= 0)
|
||||||
|
) {
|
||||||
|
$retval = false;
|
||||||
|
self :: log_warning(
|
||||||
|
"validateAttrData(".$LSform->idForm.", ".$attr->name."): ".
|
||||||
|
"validation with LDAP search on base DN='$sbasedn' and ".
|
||||||
|
"filter='".$sfilter->as_string()."' error ($ret object(s) found)"
|
||||||
|
);
|
||||||
if ($LSform)
|
if ($LSform)
|
||||||
$LSform -> setElementError($attr, $msg_error);
|
$LSform -> setElementError($attr, $msg_error);
|
||||||
$retval = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if($ret < 0) {
|
|
||||||
if ($LSform)
|
|
||||||
$LSform -> setElementError($attr, $msg_error);
|
|
||||||
$retval = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
self :: log_trace(
|
self :: log_trace(
|
||||||
"validateAttrData(".$LSform->idForm.", ".$attr->name."): ".
|
"validateAttrData(".$LSform->idForm.", ".$attr->name."): ".
|
||||||
"validation with LDAP search on base DN='$sbasedn' and ".
|
"validation with LDAP search on base DN='$sbasedn' and ".
|
||||||
"filter='".$sfilter->as_string()."' success ($ret object(s) found)"
|
"filter='".$sfilter->as_string()."' success ($ret object(s) found)"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Validation using external function
|
// Validation using external function
|
||||||
else if(isset($test['function'])) {
|
else if(isset($test['function'])) {
|
||||||
if (function_exists($test['function'])) {
|
if (function_exists($test['function'])) {
|
||||||
|
|
Loading…
Reference in a new issue