Customized IsValidEmailAddress in FEU

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
markr
New Member
New Member
Posts: 5
Joined: Mon Nov 27, 2006 2:18 pm

Customized IsValidEmailAddress in FEU

Post by markr »

Hi,

I would like to have a customized IsValidEmailAddress() in FrontEndUsers (FEU). I use the SelfRegistion module, but only users with e-mail addresses of a fixed set of domains are allowed to register themselves.

What is the cleanest approach to achieve this? Now I just hacked FrontEndUsers.api.php:

function IsValidEmailAddress( $email, $smtpvalidate = false, $uid = -1 )
  {
  ...

  $AllowedDomains = array('@example.com', 'me@somewhere.eu');
  $regex = '('.join('|', $AllowedDomains).')$';
  if ( !eregi($regex, $email) )
    {
  $result[0] = false;
  $result[1] = "Invalid domain";
  return $result;
    }



Mark
Post Reply

Return to “Developers Discussion”