mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-22 18:09:06 +01:00
LSattribute :: generateValue() : Fixed bug when generated value is empty.
This commit is contained in:
parent
aeb54731ef
commit
35f293e871
1 changed files with 10 additions and 4 deletions
|
@ -472,6 +472,7 @@ class LSattribute {
|
||||||
* @retval boolean true si la valeur à put être générée, false sinon
|
* @retval boolean true si la valeur à put être générée, false sinon
|
||||||
*/
|
*/
|
||||||
function generateValue() {
|
function generateValue() {
|
||||||
|
$value=false;
|
||||||
if (function_exists($this -> config['generate_function'])) {
|
if (function_exists($this -> config['generate_function'])) {
|
||||||
$value=call_user_func($this -> config['generate_function'],$this -> ldapObject);
|
$value=call_user_func($this -> config['generate_function'],$this -> ldapObject);
|
||||||
}
|
}
|
||||||
|
@ -481,11 +482,16 @@ class LSattribute {
|
||||||
else if (is_string($this -> config['default_value']) && strlen($this -> config['default_value'])>0) {
|
else if (is_string($this -> config['default_value']) && strlen($this -> config['default_value'])>0) {
|
||||||
$value = $this -> config['default_value'];
|
$value = $this -> config['default_value'];
|
||||||
}
|
}
|
||||||
if (!empty($value)) {
|
if ($value!==false) {
|
||||||
if (!is_array($value)) {
|
if (!empty($value)) {
|
||||||
$value=array($value);
|
if (!is_array($value)) {
|
||||||
|
$value=array($value);
|
||||||
|
}
|
||||||
|
$this -> updateData=$value;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$this -> updateData=array();
|
||||||
}
|
}
|
||||||
$this -> updateData=$value;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue