I want to allow registrations only with gmail.com and hotmail.com email accounts, to reduce spam.
So, I added this piece of coding in my elgg/actions/register.php file:
list($un, $isp) =explode("@", $password);
$gmail="gmail.com";
$hotmail="hotmail.com";
if ((strcmp($isp,$gmail) != 0) && (strcmp($isp,$hotmail) != 0)) {
throw new RegistrationException(elgg_echo('RegistrationException:EmailMismatch'));
}
yet, when I log in with my testing account, it still throws me the exception...
what am I doing wrong?
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Team Webgalli@webgalli

Team Webgalli - 0 likes
- zoika_blat@deavitae

zoika_blat - 0 likes
- Team Webgalli@webgalli

Team Webgalli - 0 likes
- Rafael Bonifaz@rbonifaz

Rafael Bonifaz - 0 likes
You must log in to post replies.#1 ) dont modify core files. Create a hook for registration and add your condition with high priority
FYI : there is already a plugin available for emaildomains. Search for it here.
dont know yet what a hook is, but thanx anyway :)
i'll look up for the plugin you said.
https://github.com/Elgg/emaildomains
If spam is your problem, why don't you try this plugin:
http://community.elgg.org/pg/plugins/project/774755/developer/RayJ/spam-login-filter
It took away 99% of my spam and that 1% can be reported so it won't bother other forums using the stopforumspam.
Regards,
Rafael