diff --git a/include/simpleplugin/class_helpersAttribute.inc b/include/simpleplugin/class_helpersAttribute.inc index 9b477058c8c7ab04184f27f162b18e0611f1100e..e4211e8a5280e4af5395799054c88b0794441aaf 100644 --- a/include/simpleplugin/class_helpersAttribute.inc +++ b/include/simpleplugin/class_helpersAttribute.inc @@ -18,21 +18,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ -/*! \brief This class allow to handle easily a String LDAP attribute that contains a mail address - * - */ -class MailAttribute extends StringAttribute -{ - protected $trim = TRUE; - - function validate () - { - if (!tests::is_email($this->value)) { - return msgPool::invalid($this->getLabel(), $this->value); - } - } -} - /*! \brief This class allow to handle easily a String LDAP attribute that needs to be validated by a test from class tests * @@ -50,6 +35,16 @@ class TestValidateAttribute extends StringAttribute } } +/*! \brief This class allow to handle easily a String LDAP attribute that contains a mail address + * + */ +class MailAttribute extends TestValidateAttribute +{ + protected $trim = TRUE; + protected $testFunc = 'is_email'; + protected $inputType = 'email'; +} + /*! \brief This class allow to handle easily a String LDAP attribute that contains a host name * */