LSldapObjet->validateAttrsData() : if LSform is specified, only check LSform's not freezed attributes

This commit is contained in:
Benjamin Renard 2019-02-26 17:47:29 +01:00
parent 5bf1a80aa2
commit 274ccad0f2
2 changed files with 25 additions and 1 deletions

View file

@ -499,6 +499,28 @@ class LSform {
}
}
/**
* Check if form has a specified element (by attr name)
*
* @param[in] $attr string The element/attribute name
*
* @retval boolean
**/
public function hasElement($name) {
return isset($this -> elements[$name]);
}
/**
* Check if a specified element (by attr name) is freezed
*
* @param[in] $attr string The element/attribute name
*
* @retval boolean
**/
public function isFreeze($name) {
return isset($this -> elements[$name]) && $this -> elements[$name] -> isFreeze($name);
}
/**
* Ajoute une règle sur un élément du formulaire
*

View file

@ -403,7 +403,9 @@ class LSldapObject {
else {
$LSform=false;
}
foreach($this -> attrs as $attr) {
foreach($this -> attrs as $attr_name => $attr) {
if ($LSform && (!$LSform -> hasElement($attr_name) || $LSform -> isFreeze($attr_name)))
continue;
$attr_values = $attr -> getValue();
if (!$attr -> isValidate()) {
if($attr -> isUpdate()) {