My request is a little bit exceptional I think. For a private community, only available for employees, we have to ensure that only one specific emailadress should accepted for registration. Quasi to change the E-MailBan to the opposite. Thanks in advance for your thoughts. :)
Regards
NetFlag
Hmmm. Looks like more than one file must be touched:
sources/controllers/Register.controller.php
sources/subs/Members.subs.php
sources/Security.php
More difficult than expected. :-\
In theory (not tried) you should be able to do it just using the hook: integrate_register_check
That hook passes two arrays: $regOptions and $reg_errors
Then you can do something like:
function only_valid_emails($regOptions, $reg_errors)
{
// if $regOptions['email'] is NOT valid
// $reg_errors->addError(array('email_notallowed', array(htmlspecialchars($regOptions['email'], ENT_COMPAT, 'UTF-8'))), 1);
}
And then you define "somwhere" a $txt['email_notallowed'].
ETA: and if it doesn't work...it's probably a bug! :P
Thanks for reply emanuele! In meantime I handle it out just edit one line of code in
sources/Security.php:
Find:
WHERE {string:email} LIKE bi.email_address
replace with:
WHERE {string:email} NOT LIKE bi.email_address
And than set settings in
Members -> Add new ban Ristrictions:
Partial ban |
Cannot registerBan on Email Address:
*@xxxx.xx
That do exactly what I want. Hope my solution can help someone else!