From 81ef2eaacf7fcd166252e1956f0d0e8a8803edd1 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Fri, 22 Apr 2011 14:24:28 +0200 Subject: [PATCH 1/6] LSldap :: update() : Fixed bug when dropping empty attribute --- public_html/includes/class/class.LSldap.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } From a53c5c3d920f0086e4ec21d7cd88d7b322ca84b0 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Fri, 22 Apr 2011 14:28:45 +0200 Subject: [PATCH 2/6] LSerror : Remove
on getError() method and add it on getErrors() --- public_html/includes/class/class.LSerror.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public_html/includes/class/class.LSerror.php b/public_html/includes/class/class.LSerror.php index d9ed63c3..d1d03e9c 100644 --- a/public_html/includes/class/class.LSerror.php +++ b/public_html/includes/class/class.LSerror.php @@ -114,7 +114,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 +130,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]); } /** From 1b8d363ccc9503ef9e9b9ab9da9579741f854e61 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Fri, 22 Apr 2011 14:30:04 +0200 Subject: [PATCH 3/6] LSerror : Added LSlog() call on addErrorCode() method --- public_html/includes/class/class.LSerror.php | 1 + 1 file changed, 1 insertion(+) diff --git a/public_html/includes/class/class.LSerror.php b/public_html/includes/class/class.LSerror.php index d1d03e9c..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))); } /** From 938d672f65e0ea108ea7264e5f43191aec479aea Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Fri, 22 Apr 2011 14:32:44 +0200 Subject: [PATCH 4/6] LSdebug() : Added LSlog() call --- public_html/includes/functions.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) 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; } From 6e5bd2ba34de6753650f0cf96f05d2a16c0a5e24 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Fri, 22 Apr 2011 16:51:34 +0200 Subject: [PATCH 5/6] LSformElement::mailQuota : Added suffix parameter --- .../class/class.LSformElement_mailQuota.php | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) 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; From a2c3488ace7772781f0d8a80dc1646c7bb8c6b9c Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Fri, 22 Apr 2011 16:59:00 +0200 Subject: [PATCH 6/6] Doc : Updated LSattr_html_mailQuota --- .../LSattr_html/LSattr_html_mailQuota.docbook | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) 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). + + + + +