Jump to content
  • 0
Sign in to follow this  
Sidra Harris

Flux CP > block [email protected] From the register on the site

Question

5 answers to this question

Recommended Posts

  • 0

after a little research i found a way to do this (this is not the best way to do it but it works)

first open ../lib/Flux/LoginServer.php

search for 

		elseif (!preg_match('/^(.+?)@(.+?)$/', $email)) {
			throw new Flux_RegisterError('Invalid e-mail address', Flux_RegisterError::INVALID_EMAIL_ADDRESS);
		}

add this after it 

		elseif (eregi('^[a-zA-Z0-9._-]+@[mailionator]+\.[a-zA-Z.]{2,5}$', $email)) {
			throw new Flux_RegisterError('Invalid e-mail address', Flux_RegisterError::INVALID_EMAIL_ADDRESS);
		}

then open the files:

../modules/account/changemail.php

../modules/account/resend.php

../modules/account/resetpass.php

search for

	elseif (!preg_match('/^(.+?)@(.+?)$/', $email)) {
		$errorMessage = Flux::message('EmailInvalid');
	}

add after it 

	elseif (eregi('^[a-zA-Z0-9._-]+@[mailionator]+\.[a-zA-Z.]{2,5}$', $email)) {
		$errorMessage = Flux::message('InvalidEmailAddress');
	}

this will block registration/email changing/resetting password/resending verification email to all email with domain *@mailionator.* you can add hotmail too by ading it to the elseif.

Edited by Asheraf

Share this post


Link to post
Share on other sites
  • 0

just add more like this 

elseif (eregi('^[a-zA-Z0-9._-]+@[mailionator]+\.[a-zA-Z.]{2,5}$', $email)
		 || eregi('^[a-zA-Z0-9._-]+@[gmail]+\.[a-zA-Z.]{2,5}$', $email)
		 || eregi('^[a-zA-Z0-9._-]+@[hotmail]+\.[a-zA-Z.]{2,5}$', $email)) {

Share this post


Link to post
Share on other sites
  • 0

You really shouldn't use eregi, the ereg-extension has already been thrown out of PHP by default and it contains many problems, including security-related ones.
 
 
Stick to preg and use proper PHP validation, go for something like
 

if (!filter_var($email, FILTER_VALIDATE_EMAIL) || preg_match('/@(mailinator|hotmail|trashmail)\..+$/i', $email))
    throw new Flux_RegisterError('Invalid e-mail address', Flux_RegisterError::INVALID_EMAIL_ADDRESS);

 

For more information visit the PHP documentation on ereg and on filter_var. Keep your servers safe, folks.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.