diff --git a/trunk/conf/LSobjects/config.LSobjects.LSeepeople.php b/trunk/conf/LSobjects/config.LSobjects.LSeepeople.php index 650a87db..00ace6ea 100644 --- a/trunk/conf/LSobjects/config.LSobjects.LSeepeople.php +++ b/trunk/conf/LSobjects/config.LSobjects.LSeepeople.php @@ -229,7 +229,7 @@ $GLOBALS['LSobjects']['LSeepeople'] = array ( 'ldap_type' => 'boolean', 'html_type' => 'boolean', 'required' => 1, - 'default_value' => '/bin/false', + 'default_value' => 'no', 'rights' => array( 'self' => 'r', 'admin' => 'w' diff --git a/trunk/includes/class/class.LSattr_ldap_boolean.php b/trunk/includes/class/class.LSattr_ldap_boolean.php index 0fa8b913..84dcc102 100644 --- a/trunk/includes/class/class.LSattr_ldap_boolean.php +++ b/trunk/includes/class/class.LSattr_ldap_boolean.php @@ -34,9 +34,11 @@ class LSattr_ldap_boolean extends LSattr_ldap { * @retval mixed La valeur d'affichage de l'attribut */ function getDisplayValue($data) { - if ($data==NULL) - return; - return ($this -> isTrue($data))?'yes':'no'; + if ($this -> isTrue($data)) + return 'yes'; + if ($this -> isFalse($data)) + return 'no'; + return; } /** @@ -50,9 +52,10 @@ class LSattr_ldap_boolean extends LSattr_ldap { if ($data[0]=='yes') { return array($this -> config['true_value']); } - else { + if ($data[0]=='no') { return array($this -> config['false_value']); } + return array(); } /** @@ -71,6 +74,23 @@ class LSattr_ldap_boolean extends LSattr_ldap { } return; } + + /** + * Determine si la valeur passé en paramètre correspond a False ou non + * + * @param[in] $data La valeur de l'attribut + * + * @retval boolean True ou False + */ + function isFalse($data) { + if (!is_array($data)) { + $data=array($data); + } + if ($data[0] == $this -> config['false_value']) { + return true; + } + return; + } } ?> diff --git a/trunk/includes/class/class.LSformElement_boolean.php b/trunk/includes/class/class.LSformElement_boolean.php index 3a965aa3..bd6b6d32 100644 --- a/trunk/includes/class/class.LSformElement_boolean.php +++ b/trunk/includes/class/class.LSformElement_boolean.php @@ -49,7 +49,7 @@ class LSformElement_boolean extends LSformElement { } else { foreach ($this -> values as $value) { - $return['html'] .= "