mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-22 18:09:06 +01:00
LSattribute / generate_value : the default_value is now used to generate the value of the attribute if the generate function or LSformat is not defined.
This commit is contained in:
parent
ee0d7b82fd
commit
c05741a489
1 changed files with 14 additions and 9 deletions
|
@ -451,15 +451,17 @@ class LSattribute {
|
|||
* @retval boolean true si la valeur de l'attribut peut être générée, false sinon
|
||||
*/
|
||||
function canBeGenerated() {
|
||||
if (function_exists($this -> config['generate_function'])) {
|
||||
return true;
|
||||
}
|
||||
else if (isset($this -> config['generate_value_format'])) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return ;
|
||||
}
|
||||
return (
|
||||
(function_exists($this -> config['generate_function']))
|
||||
||
|
||||
(isset($this -> config['generate_value_format']))
|
||||
||
|
||||
(
|
||||
(is_string($this -> config['default_value']))
|
||||
&&
|
||||
(strlen($this -> config['default_value'])>0)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -476,6 +478,9 @@ class LSattribute {
|
|||
else if (isset($this -> config['generate_value_format'])) {
|
||||
$value = $this -> ldapObject -> getFData($this -> config['generate_value_format']);
|
||||
}
|
||||
else if (is_string($this -> config['default_value']) && strlen($this -> config['default_value'])>0) {
|
||||
$value = $this -> config['default_value'];
|
||||
}
|
||||
if (!empty($value)) {
|
||||
//$this -> setValue($value); // pas nécéssaire ??
|
||||
$this -> updateData=array($value);
|
||||
|
|
Loading…
Reference in a new issue