| Author |
Message |
Raven Site Admin/Owner

Joined: Aug 27, 2002 Posts: 15037 Location: Kansas
|
Posted:
Mon Oct 06, 2003 6:29 am |
|
In modules/Your_Account/index.php find this right near the top | Code: |
function userCheck($username, $user_email) {
global $stop, $user_prefix, $db; | and add these lines after the 'global' statement | Code: | if (ereg("@hotmail\.com",$user_email)) $stop = "<center>"."Hotmail addresses are not allowed"."</center><br>";
elseif (ereg("@yahoo\.com",$user_email)) $stop = "<center>"."Yahoo addresses are not allowed"."</center><br>"; | You could/should put the error message in the language file, but that's your call. You could combine that all into 1 statement, but this way you might want to have separate messages. |
|
|
|
 |
porcupinepc Involved


Joined: Sep 20, 2003 Posts: 261 Location: Schumacher, Ontario CANADA
|
Posted:
Mon Oct 06, 2003 7:19 am |
|
so between the global and the $stop we insert the replacement code?
Thanks
Joe |
|
|
 |
 |
Raven Site Admin/Owner

Joined: Aug 27, 2002 Posts: 15037 Location: Kansas
|
Posted:
Mon Oct 06, 2003 7:23 am |
|
No. | Raven wrote: | | and add these lines after the 'global' statement | means after the entire statement, i.e. after the ; as in global $stop, $user_prefix, $db; |
|
|
|
 |
porcupinepc Involved


Joined: Sep 20, 2003 Posts: 261 Location: Schumacher, Ontario CANADA
|
Posted:
Mon Oct 06, 2003 7:24 am |
|
|
 |
 |
Muffin Client

Joined: Apr 10, 2004 Posts: 649 Location: UK
|
Posted:
Mon Aug 09, 2004 5:16 am |
|
Would this affect anyone who has previously registered with either a Hotmail or Yahoo email address Raven? Like stopping them accessing the site? |
|
|
|
 |
Raven Site Admin/Owner

Joined: Aug 27, 2002 Posts: 15037 Location: Kansas
|
Posted:
Mon Aug 09, 2004 7:05 am |
|
I don't believe so. If I remember right that function is only called when a new account is created. |
|
|
|
 |
Muffin Client

Joined: Apr 10, 2004 Posts: 649 Location: UK
|
Posted:
Mon Aug 09, 2004 9:48 am |
|
oh thanks Raven, I'll have a go at this one then (dont cringe this one might work for me lol ) |
|
|
|
 |
SmackDaddy Involved


Joined: Jun 02, 2004 Posts: 268 Location: Englewood, OH
|
Posted:
Thu Aug 26, 2004 12:30 am |
|
I guess the assumption is that anyone online has an ISP of some sort unless they use a public place to access the internet (like school, or the public library, etc.....)
Would we be able to expand the statement "are not allowed" to also include a statement giving a reason as to WHY we don't want Yahoo, GMail, or Hotmail email addresses used to register at our sites? That could be helpful in explaining the reason instead of just saying "are not allowed." Or is there a max length we have to consider? |
|
|
|
 |
64bitguy The Mouse Is Extension Of Arm

Joined: Mar 06, 2004 Posts: 1140 Location: Manchester, NH USA
|
Posted:
Thu Aug 26, 2004 2:17 am |
|
I've actually expanded on this a tad by including some of the major abuser addresses that have come to my attention.
Mine looks like this:
| Code: | function userCheck($username, $user_email) {
global $stop, $user_prefix, $db;
if (ereg("@hotmail\.com",$user_email)) $stop = "<center>"._ERRORNOHOTMAIL."</center>";
elseif (ereg("@yahoo\.com",$user_email)) $stop = "<center>"._ERRORNOYAHOO."</center>";
elseif (ereg("@gmail\.com",$user_email)) $stop = "<center>"._ERRORNOFREEMAIL."</center>";
elseif (ereg("@fastmail\.fm",$user_email)) $stop = "<center>"._ERRORNOFREEMAIL."</center>";
elseif (ereg("@freemail\.org.mk",$user_email)) $stop = "<center>"._ERRORNOFREEMAIL."</center>";
if ((!$user_email) || ($user_email=="") || (!eregi("^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,6}$",$user_email))) $stop = "<center>"._ERRORINVEMAIL."</center><br>";
if (strrpos($user_email,' ') > 0) $stop = "<center>"._ERROREMAILSPACES."</center>";
if ((!$username) || ($username=="") || (ereg("[^a-zA-Z0-9_-]",$username))) $stop = "<center>"._ERRORINVNICK."</center><br>";
if (strlen($username) > 25) $stop = "<center>"._NICK2LONG."</center>";
if (eregi("^((root)|(adm)|(linux)|(webmaster)|(admin)|(god)|(administrator)|(administrador)|(nobody)|(anonymous)|(anonimo)|(anónimo)|(operator))$",$username)) $stop = "<center>"._NAMERESERVED."</center>";
if (strrpos($username,' ') > 0) $stop = "<center>"._NICKNOSPACES."</center>"; |
In my language file, I have this:
| Code: | define("_ERRORINVEMAIL","ERROR: Invalid Email Address");
define("_ERRORNOYAHOO","ERROR: Yahoo Email Addresses Are Not Allowed! - You may only register using a Valid ISP provided Email Address!");
define("_ERRORNOHOTMAIL","ERROR: Hotmail Email Addresses Are Not Allowed! - You may only register using a Valid ISP provided Email Address!");
define("_ERRORNOFREEMAIL","ERROR: Non-ISP Hosted Email Addresses Are Not Allowed! - You may only register using a Valid ISP provided Email Address!"); |
|
|
|
|
 |
kguske Site Admin

Joined: Jun 04, 2004 Posts: 4678
|
Posted:
Thu Aug 26, 2004 7:43 am |
|
I posted this on another site, but would rather repost it here than link there..
Here's a solution that let's you use the phpBB forum banlist table to prevent registration via the phpNuke Your_Account module!
The code is actually in the /includes/functions_validate.php file in a function called validate_email, but because it uses some stuff in the Forums module and the goal here is to use the ban list / banlist to prevent registration using phpNuke registration (i.e. the Your_Account module), it was easier to duplicate the code than make it fully modular (I wanted to implement this FAST). Here's how:
In your /modules/Your_Account/index.php, insert the following near the top, just before:
| Code: | | function userCheck($username, $user_email) { |
Insert:
| Code: | function validate_email($email)
{
global $user_prefix, $db, $lang;
if ($email != '')
{
if (preg_match('/^[a-z0-9\.\-_\+]+@[a-z0-9\-_]+\.([a-z0-9\-_]+\.)*?[a-z]+$/is', $email))
{
$sql = "SELECT ban_email
FROM ".$user_prefix."_bbbanlist";
if ($result = $db->sql_query($sql))
{
if ($row = $db->sql_fetchrow($result))
{
do
{
$match_email = str_replace('*', '.*?', $row['ban_email']);
if (preg_match('/^' . $match_email . '$/is', $email))
{
$db->sql_freeresult($result);
return array('error' => true, 'error_msg' => $lang['Email_banned']);
}
}
while($row = $db->sql_fetchrow($result));
}
}
$db->sql_freeresult($result);
return array('error' => false, 'error_msg' => '');
}
}
return array('error' => true, 'error_msg' => $lang['Email_invalid']);
} |
Next, in function userCheck (also in /modules/Your_Account/index.php), just after:
| Code: | | if (strrpos($user_email,' ') > 0) $stop = "<center>"._ERROREMAILSPACES."</center>"; |
Insert:
| Code: | $result = validate_email($user_email);
if ( $result['error'] ) $stop = "<center>"._ERROREMAILBANNED."</center><br>"; |
Finally, in the /modules/Your_Account/language/language-English.php (or appropriate), just after:
| Code: | | define("_ERRORINVEMAIL","ERROR: Invalid Email"); |
Insert:
| Code: | | define("_ERROREMAILBANNED","ERROR: Banned Email Address"); |
You can make the error message say whatever you like, of course. |
|
|
|
 |
Raven Site Admin/Owner

Joined: Aug 27, 2002 Posts: 15037 Location: Kansas
|
Posted:
Thu Aug 26, 2004 9:13 am |
|
This is really good stuff! Thanks for sharing this. Discussion item --> |
|
|
|
 |
jonmcc33 Hangin' Around

Joined: May 17, 2004 Posts: 40 Location: Dayton, OH
|
Posted:
Sat Jan 29, 2005 11:39 pm |
|
Raven, at that thread the guy mentioned having hundreds of free e0mail service domains and wanting to make money off of it. There are actually thousands and they can be found in a lot of places on Google.
I've added Netscape, Mail.com, and eXcite to my list. Is there any quicker way of doing this? |
|
|
 |
 |
64bitguy The Mouse Is Extension Of Arm

Joined: Mar 06, 2004 Posts: 1140 Location: Manchester, NH USA
|
Posted:
Sun Jan 30, 2005 1:02 am |
|
Yeah, the guy (I guess that would be me) has a list of 1231 banned domains, and yes, I had to type them all in by hand.... lol
Hence the reason why I'm selling the list (well, giving it away to subscribers that is). One quick import sure beats the heck out of looking them all up and typing them all in by hand.
 |
|
|
|
 |
jonmcc33 Hangin' Around

Joined: May 17, 2004 Posts: 40 Location: Dayton, OH
|
Posted:
Sun Jan 30, 2005 1:47 am |
|
Hmmm, how much does that cost?
I have a list of 30,000 total domains if you want it. |
|
|
 |
 |
64bitguy The Mouse Is Extension Of Arm

Joined: Mar 06, 2004 Posts: 1140 Location: Manchester, NH USA
|
Posted:
Sun Jan 30, 2005 1:57 am |
|
I don't think I'd trust a list with 30,000 domains on it. That sounds like someone's blacklist, whereas mine is simply freemail providers. I'd also be concerned about performance impacts from having to check a table with 30,000 entries in it, but that's just me. |
|
|
|
 |
jonmcc33 Hangin' Around

Joined: May 17, 2004 Posts: 40 Location: Dayton, OH
|
Posted:
Sun Jan 30, 2005 11:38 am |
|
That list includes free e-mail from other countries. I've taken a look a few random and they are free e-mail.
I took a look at your site. It costs $20 at minimum to subscribe. Why do you charge a government employee $120? |
|
|
 |
 |
64bitguy The Mouse Is Extension Of Arm

Joined: Mar 06, 2004 Posts: 1140 Location: Manchester, NH USA
|
Posted:
Sun Jan 30, 2005 12:05 pm |
|
| Quote: | | That list includes free e-mail from other countries. I've taken a look a few random and they are free e-mail. |
Ah, a Blacklist. My list also includes free email from other countries. In fact most of it is providers from other countries, but 30,000? Have fun checking them all.
As for my site, I maintain special sites, sections and content for Government Users and Government Contractors. It's only $50.00 for a Government employee to join and have access to that content. It's $120.00 for their branch to register first (which would be the first employee of that Branch of Government). The reason for that is each Branch gets dedicated forums, links, downloads, sub-domain controls and target content for their branch while still having cross-Government and Contractor support tools (which is what the $50.00 is for).
Hope that answers you questions. |
|
|
|
 |
jonmcc33 Hangin' Around

Joined: May 17, 2004 Posts: 40 Location: Dayton, OH
|
Posted:
Sun Jan 30, 2005 2:41 pm |
|
|
 |
 |
Mesum Useless

Joined: Aug 23, 2002 Posts: 213 Location: Chicago
|
Posted:
Sun Mar 06, 2005 2:28 am |
|
Hello guys. Do you think there is a way to block ALL extentions but let .edu e-mail addresses to register? |
|
|
|
 |
Mesum Useless

Joined: Aug 23, 2002 Posts: 213 Location: Chicago
|
Posted:
Sun Mar 06, 2005 2:44 am |
|
Nevermind, found a way around to it and it's called CNB YA  |
|
|
|
 |
Serafim Worker


Joined: Mar 25, 2006 Posts: 109 Location: Delaware Usa
|
Posted:
Wed Mar 29, 2006 6:44 pm |
|
How would I use this to exclude gmail accounts.. |
|
|
|
 |
kguske Site Admin

Joined: Jun 04, 2004 Posts: 4678
|
Posted:
Mon May 29, 2006 7:58 am |
|
That depends on which approach you take, Serafim. If you use the approach I suggested, you can simply add *@gmail.com to your ban list in the forums administration. |
|
|
|
 |
kguske Site Admin

Joined: Jun 04, 2004 Posts: 4678
|
Posted:
Mon May 29, 2006 8:03 am |
|
Also, CNB-YA provides the ability to block domains from registering. |
|
|
|
 |
Serafim Worker


Joined: Mar 25, 2006 Posts: 109 Location: Delaware Usa
|
Posted:
Mon May 29, 2006 8:39 am |
|
Im using approve membership so maybe i should check over at thier site.. |
|
|
|
 |
manunkind Client

Joined: Apr 26, 2004 Posts: 368 Location: Albuquerque, NM
|
Posted:
Mon May 29, 2006 6:29 pm |
|
Stupid question but why would somebody actually want to do this? We have thread after thread on ways to increase traffic to our sites, and then we do one thing like this that blocks 20% of the world.  |
|
|
|
 |
|
|
|
|