diff --git a/trunk/includes/class/class.LSformRule_telephonenumber.php b/trunk/includes/class/class.LSformRule_telephonenumber.php new file mode 100644 index 00000000..29645774 --- /dev/null +++ b/trunk/includes/class/class.LSformRule_telephonenumber.php @@ -0,0 +1,48 @@ + + */ +class LSformRule_telephonenumber extends LSformRule { + + /** + * Vérification de la valeur. + * + * @param string $value Valeur à vérifier + * @param array $options Options de validation : + * - Check domain : $option['params']['checkDomain'] + * @param object $formElement L'objet formElement attaché + * + * @return boolean true si la valeur est valide, false sinon + */ + function validate($value,$option=array(),$formElement) { + $regex = '/^(01|02|03|04|05|06|08|09)[0-9]{8}$/'; + $GLOBALS['LSsession'] -> loadLSclass('LSformRule_regex'); + return LSformRule_regex :: validate($value,$regex,$formElement); + } + +} + +?>