diff --git a/doc/conf/LSattribute/LSattr_html/LSattr_html_mailQuota.docbook b/doc/conf/LSattribute/LSattr_html/LSattr_html_mailQuota.docbook index 74fca6bf..5f80d62d 100644 --- a/doc/conf/LSattribute/LSattr_html/LSattr_html_mailQuota.docbook +++ b/doc/conf/LSattribute/LSattr_html/LSattr_html_mailQuota.docbook @@ -2,6 +2,28 @@ LSattr_html_mailQuota Ce type est utilisé pour la gestion des attributs dont la valeur est le quota d'une boite mail. Le format de la valeur générée correspondant au format - attendu par le serveur de mail &courier;. Exemple : 50000000S + attendu par le serveur de mail &courier; par défaut. Exemple : 50000000S correspond à un quota de 50Mio. + + +Structure... + array( + 'suffix' => '[suffix]', + ) +),]]> +... + + + +Paramètres de configuration + + + suffix + + Chaine de caractères suffixant la valeur du quota (Par défaut : S). + + + + + diff --git a/public_html/includes/class/class.LSerror.php b/public_html/includes/class/class.LSerror.php index d9ed63c3..a7ea6985 100644 --- a/public_html/includes/class/class.LSerror.php +++ b/public_html/includes/class/class.LSerror.php @@ -64,6 +64,7 @@ class LSerror { */ public static function addErrorCode($code=-1,$msg='') { $_SESSION['LSerror'][] = array($code,$msg); + LSlog('[ERROR] '.self::getError(array($code,$msg))); } /** @@ -114,7 +115,7 @@ class LSerror { public static function getErrors() { if(!empty($_SESSION['LSerror'])) { foreach ($_SESSION['LSerror'] as $error) { - $txt.=self::getError($error); + $txt.=self::getError($error)."
\n"; } self::resetError(); return $txt; @@ -130,7 +131,7 @@ class LSerror { * @retvat string Le texte des erreurs */ private static function getError($error) { - return "(Code ".$error[0].") ".getFData(self :: $_errorCodes[$error[0]]['msg'],$error[1])."
\n"; + return "(Code ".$error[0].") ".getFData(self :: $_errorCodes[$error[0]]['msg'],$error[1]); } /** diff --git a/public_html/includes/class/class.LSformElement_mailQuota.php b/public_html/includes/class/class.LSformElement_mailQuota.php index 78cc05b1..44181924 100644 --- a/public_html/includes/class/class.LSformElement_mailQuota.php +++ b/public_html/includes/class/class.LSformElement_mailQuota.php @@ -54,7 +54,7 @@ class LSformElement_mailQuota extends LSformElement { $quotas=array(); foreach ($this -> values as $value) { - if (ereg('([0-9]*)S',$value,$regs)) { + if (ereg('([0-9]*)'.$this -> getSuffix(),$value,$regs)) { $infos = array( 'size' => $regs[1] ); @@ -107,7 +107,21 @@ class LSformElement_mailQuota extends LSformElement { ) ); } - + + /** + * Return suffix value + * + * @retval string Suffix value + **/ + function getSuffix() { + if(isset($this -> params['html_options']['suffix'])){ + return strval($this -> params['html_options']['suffix']); + } + else { + return "S"; + } + } + /** * Recupère la valeur de l'élement passée en POST * @@ -136,7 +150,7 @@ class LSformElement_mailQuota extends LSformElement { if (isset($_POST[$this -> name.'_sizeFact'][$key]) && ($_POST[$this -> name.'_sizeFact'][$key]!=1)) { $f = $_POST[$this -> name.'_sizeFact'][$key]; } - $return[$this -> name][$key] = ($val*$f).'S'; + $return[$this -> name][$key] = ($val*$f).$this->getSuffix(); } } return true; diff --git a/public_html/includes/class/class.LSldap.php b/public_html/includes/class/class.LSldap.php index 52befc30..b66d817f 100644 --- a/public_html/includes/class/class.LSldap.php +++ b/public_html/includes/class/class.LSldap.php @@ -318,7 +318,8 @@ class LSldap { else { if (!empty($dropAttr)) { foreach($dropAttr as $attr) { - if(Net_LDAP2::isError($entry -> getValue($attr))) { + $value = $entry -> getValue($attr); + if(Net_LDAP2::isError($value) || empty($value)) { // Attribut n'existe pas dans l'annuaire continue; } diff --git a/public_html/includes/functions.php b/public_html/includes/functions.php index 97cdcb8f..af34595a 100644 --- a/public_html/includes/functions.php +++ b/public_html/includes/functions.php @@ -219,16 +219,13 @@ function varDump($data) { $GLOBALS['LSdebug_fields']=array(); function LSdebug($data,$dump=false) { if ($dump) { - $GLOBALS['LSdebug_fields'][]=varDump($data); + $data=varDump($data); } - else { - if (is_array($data)||is_object($data)) { - $GLOBALS['LSdebug_fields'][]=$data; - } - else { - $GLOBALS['LSdebug_fields'][]="[$data]"; - } + else if (!is_array($data) && !is_object($data)) { + $data="[$data]"; } + $GLOBALS['LSdebug_fields'][]=$data; + LSlog('[DEBUG] '.$data); return true; }