Posted on: 07/20/06 08:04pm
By: jmucchiello
Is there a function I can add to filter new user applications by email address. I have a bunch of bogus user accounts with mail.ru and cashette.com return addresses that I will I could just deny when they were creating the accounts. Is there a built in way to do this or do I need to make a hack?
Prevent new user creation
Posted on: 07/21/06 01:55am
By: Dirk
In config.php:
$_CONF['usersubmission'] = 0; // 1 = new users must be approved
(...)
// When user submission is activated, allow users from these domains to
// register without having to go through the submission queue.
$_CONF['allow_domains'] = ''; // e.g. 'mycompany.com,myothercompany.com'
bye, Dirk
Prevent new user creation
Posted on: 07/21/06 05:52am
By: jmucchiello
No, that's a whitelist. I want the opposite. I want all users to be automatically approved except for a few blacklisted domains.
Prevent new user creation
Posted on: 07/21/06 02:25pm
By: Dirk
[QUOTE BY= jmucchiello] No, that's a whitelist.[/QUOTE]
Right, but that's all Geeklog has to offer at the moment.
bye, Dirk
Prevent new user creation
Posted on: 07/22/06 01:59am
By: jmucchiello
Any chance you could add something like this to lib-common.php:
function COM_isEmail( $email )
{
if (function_exists('custom_emailblacklist'))
{
if (custom_emailblacklist($email))
{
return FALSE;
}
}
// rest of COM_isEmail continues here.
}
In lib-custom.php a sample custom_emailblacklist would look something like:
// custom_emailblacklist returns TRUE if the $email address matches a pattern on the blacklist
function custom_emailblacklist( $email )
{
if (strpos($email, 'somebad.address') !== FALSE or
strpos($email, 'someother.address') !== FALSE or
strpos($email, 'athird.address') !== FALSE)
{
return TRUE;
}
return FALSE;
}
That's may off the cuff hack anyway. Move this thread to hacks if you like.
Prevent new user creation
Posted on: 07/29/06 03:34am
By: Dirk
Actually, it appears that $_CONF['allow_domains'] has gone missing from 1.4.0 for whatever reason. I.e. it's documented and listed in config.php but not used anywhere. Hmm ...
bye, Dirk
Prevent new user creation
Posted on: 07/31/06 12:47pm
By: jmucchiello
My hack is ugly. Properly done there'd be an array of regexes in something like $_CONF["address_blacklist"] that the funciton would check using preg_match.
Prevent new user creation
Posted on: 08/08/06 10:58am
By: Anonymous (DeCEiVeR)
Hey guys, I know this is an old post but is there anyway to send an access denied email to the new users that were not approved?
Prevent new user creation
Posted on: 08/08/06 02:48pm
By: Dirk
[QUOTE BY= DeCEiVeR] is there anyway to send an access denied email to the new users that were not approved?[/QUOTE]
No, but that sounds like a good idea. Submit a feature request ...
bye, Dirk
Prevent new user creation
Posted on: 11/04/06 01:27am
By: jmucchiello
You would probably have to change COM_isEmail to return a reason code for its rejection of an address. Addresses that returned EMAIL_BAD_FORMAT would not receive the above email while addresses that return EMAIL_BANNED_DOMAIN could receive the email.
OTOH, I suspect that sending "sorry your domain is banned" emails will just result in a bunch of bounced messages in your inbox.
While I'm here, this is my current custom_blacklist function:
function custom_emailblacklist($email)
{
$blocking = Array(
'mail.ru',
'cashette.com',
'yandex.ru',
'ya.ru',
'gold-profits',
'gawab.com'
// I've eliminated the ones with curse words in them
);
foreach ($blocking as $addr) {
if (strpos($email, $addr) !== FALSE) {
COM_accessLog("tried to register $email");
return TRUE;
}
}
return FALSE;
}
Prevent new user creation
Posted on: 11/07/06 01:03am
By: scroff
This gets dropped into lib-custom?
Prevent new user creation
Posted on: 11/07/06 01:25am
By: jmucchiello
And you have to add a call to the custom function in COM_isEmail in lib-common.php as shown in my 3rd post above (dated July 22). This is a hack. 1.4.1b2 has support for something similar to this right in the config.php.
Prevent new user creation
Posted on: 11/07/06 02:15am
By: scroff
Thanks for your quick reply.
I added this to lib-custom and the call in lib-common and three blocks ceased to function, giving a 'not found' error;
phpblock_gusstats, phpblock_mg_randommedia and phpblock_mg_maenroll.
The first is for the Who's Online custom block, the second and third are from Media Gallery.
I undid it and they are back.
Just seems I can't use it.