Menu

Can't write email direccion in new team/user

pablochj
2011-02-23
2014-01-17
  • pablochj

    pablochj - 2011-02-23

    Dear iTop administrators.

    We use internal e-mail address like  user1@passdr02s  and other like user2@passdr02s.icetel , both addres work perfectly but itop have some restriccion in new user creation a new team creation.I can write this email direccion in iTop, there is a red  symbol next to the email field .  How can I deactivate this restriccions  to put any email direccion and use any format in the email direccion.

    Thanks a lot!

     
  • Denis

    Denis - 2011-02-23

    The "email validation pattern" is located in the function GetValidationPattern located in the file "core/attributedef.class.inc.php".

    Search for the class "AttributeEmailAddress" it looks like this:

    class AttributeEmailAddress extends AttributeString
    {
        public function GetValidationPattern()
        {
            // return "^([0-9a-zA-Z]([-.\\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\\w]*[0-9a-zA-Z]\\.)+[a-zA-Z]{2,9})$";
            return "^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$";
        }
    ...
    [code]
    And change the pattern for something less restrictive like:
    [code]
    class AttributeEmailAddress extends AttributeString
    {
        public function GetValidationPattern()
        {
            // return "^([0-9a-zA-Z]([-.\\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\\w]*[0-9a-zA-Z]\\.)+[a-zA-Z]{2,9})$";
            return "^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+$";
        }
    ...
    [code]
    
     
  • pablochj

    pablochj - 2011-02-28

    Yes, it works perfectly. Thank you very much.  If anyone needs it, You can use it safely and it is quite easy to implement

     
  • Jose Ramos

    Jose Ramos - 2011-08-10

    Did U try to insert or update your record from database ?? I mean use phpmysql or toad for mysql to change this value, because from the form use validation to common email format.

    Regards

     
  • Rob Harvey

    Rob Harvey - 2014-01-17

    Denis - can we modify "AttributeEmailAddress" via an extension?

    I'm about to try it anyway because modifying core files leads to all sorts of potential problems when we upgrade/re-install ...

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.