Commit d873bc92 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:sparkles: feat(MailAttribute) Use email input type for MailAttribute

issue #5910
Showing with 10 additions and 15 deletions
+10 -15
...@@ -18,21 +18,6 @@ ...@@ -18,21 +18,6 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 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 /*! \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 ...@@ -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 /*! \brief This class allow to handle easily a String LDAP attribute that contains a host name
* *
*/ */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment