LSldapObject::submitChange(): code cleaning

This commit is contained in:
Benjamin Renard 2020-12-22 19:46:57 +01:00
parent a353ca5c37
commit 7ef6e57c49

View file

@ -675,10 +675,13 @@ class LSldapObject extends LSlog_staticLoggerClass {
} }
} }
if(!empty($submitData)) { if(!empty($submitData)) {
$dn=$this -> getDn(); $dn = $this -> getDn();
if (!$dn) {
LSerror :: addErrorCode('LSldapObject_13');
return;
}
if($dn) { $this -> dn = $dn;
$this -> dn=$dn;
self :: log_debug($this." -> submitChange($idForm): submitData=".varDump($submitData)); self :: log_debug($this." -> submitChange($idForm): submitData=".varDump($submitData));
if ($new) { if ($new) {
// Check DN is not already exist // Check DN is not already exist
@ -697,6 +700,7 @@ class LSldapObject extends LSlog_staticLoggerClass {
} }
} }
if (!LSldap :: update($this -> getType(),$dn, $submitData)) { if (!LSldap :: update($this -> getType(),$dn, $submitData)) {
self :: log_debug($this." -> submitChange($idForm): LSldap :: update() failed");
return; return;
} }
self :: log_debug($this." -> submitChange($idForm): changes applied in LDAP"); self :: log_debug($this." -> submitChange($idForm): changes applied in LDAP");
@ -714,11 +718,6 @@ class LSldapObject extends LSlog_staticLoggerClass {
} }
return true; return true;
} }
else {
LSerror :: addErrorCode('LSldapObject_13');
return;
}
}
else { else {
self :: log_debug($this." -> submitChange($idForm): no change"); self :: log_debug($this." -> submitChange($idForm): no change");
return true; return true;