Page Index Toggle Pages: [1] 2 3 4 Send TopicPrint
Very Hot Topic (More than 25 Replies) Distilled Email Domains beta 4 Y2 (Read 9042 times)
astropilot
God Member
*****
Offline



Posts: 828
Location: Louisville
Joined: Jun 18th, 2003
Gender: Male
Distilled Email Domains beta 4 Y2
Nov 8th, 2005 at 1:59am
Print Post  
Distilled Email Domains beta 4 Y2
--------------------------------------------------------

This mod allows admins to designate which email domain a person can register with and also allows the admin to choose to block certain domains from registering. Gmods and admins are immune and can change their and a users emaill address to whatever.

If the admin allows only certain domains, at registration, a new user can add their userid and then select which domain their email is located from a dropdown menu on the registration page.  If they enter a full email address in the field, an error will occur.  If a new user tries to change their email address in their profile, they will only be able to select the domains that the admin allows.

If an admin blocks certain domains, an error will occur if a user tries to register with any domain that is blocked.  If they register and then try to change it to a "bad" domain in their profile, they will get an error there too.

Current members will still be able to change their email as they please unless it is a blocked domain.  Once they choose an email from an allowed domain, they will always have to choose from the allowed domain list. An admin can force their users to a certain domain by setting a date they must change by and then deleting their account if they had not changed.

With this and having email password or account activation enabled and having a new password emailed everytime a email address is changed, an admin can effectively distill the domains available to their community.

Installation
---------------------
1. Uninstall any previous version
2. Install new version and upload files (Admin.pl, AdminSubList.pl, Register.pl, Profile.pl & AdminIndex.pl) to their appropiate directory in ASCII.
3. Upload the language file to the language folder (chose your translation if available) in ASCII.
4. Upload the Distilled_Email_Domains.txt file to the Variable directory in ASCII.

History
-----------
beta 1 - Initial release
beta 2 - Changed mod name, added domain blocking, added distillation from profile screen
beta 3 - Minor fixes for mod file.
beta 4 - Made domain blocking more specific

Comments
--------------
- Admins really can define the suffix of an email addres (i.e. ".schoolname.somethingelse@lgfl.net") and is not limited to just domain names.
- This mod and idea was originally by Carsten for YaBB 1.3. This is a new coding of this mod for YaBB2 and includes new features.  This is not an update.

Test It
----------
http://www.valleynazarene.org/cgi-bin/yabb2/YaBB.pl?action=register

Hope this is useful.

astro-pilot
« Last Edit: Feb 20th, 2007 at 3:40pm by Administrator »  

Distilled_Email_Domains.zip ( 3 KB | Downloads )

"For I am not ashamed of the gospel of Christ..."
Romans 1:16
---
http://www.ssflynn.com
www.flynnfarmsofkentucky.com
Back to top
 
IP Logged
 
astropilot
God Member
*****
Offline



Posts: 828
Location: Louisville
Joined: Jun 18th, 2003
Gender: Male
Re: Allowed Email Domains beta 1.0 Y2
Reply #1 - Nov 8th, 2005 at 2:25am
Print Post  
One thing that people talked about with Carsten's old mod was that people could register with a a true but dummy account, get the password or activate, and then login and change the email address.  I have a solution to this almost finished (well it is, but I just didn't know if people were interested in it).

In this feature, if someone tried to change their email, they would be forced to select an email address in the same way as when they registered.  If you combine this with the feature to with the email new password with email address change feature, you can combat such issues.

We could take this even further to require everyone, even those before the mod was installed, to have an email address from a certain domain.

Anyway, just seeing if people were interested.

ap
  

"For I am not ashamed of the gospel of Christ..."
Romans 1:16
---
http://www.ssflynn.com
www.flynnfarmsofkentucky.com
Back to top
 
IP Logged
 
Xavier
Senior Member
****
Offline



Posts: 442
Location: Ipswich
Joined: Apr 5th, 2005
Gender: Male
Re: Allowed Email Domains beta 1.0 Y2
Reply #2 - Nov 8th, 2005 at 2:48am
Print Post  
is it possible to ban certain domains as well
  
Back to top
WWWYIM  
IP Logged
 
astropilot
God Member
*****
Offline



Posts: 828
Location: Louisville
Joined: Jun 18th, 2003
Gender: Male
Re: Allowed Email Domains beta 1.0 Y2
Reply #3 - Nov 8th, 2005 at 2:54am
Print Post  
What do you mean by ban domains?  This mod is for new registrants only (for right now).

This mod says that a registrant must have an email address from the domains you set.  Look at the example page to get an idea of what i mean.
  

"For I am not ashamed of the gospel of Christ..."
Romans 1:16
---
http://www.ssflynn.com
www.flynnfarmsofkentucky.com
Back to top
 
IP Logged
 
Xavier
Senior Member
****
Offline



Posts: 442
Location: Ipswich
Joined: Apr 5th, 2005
Gender: Male
Re: Allowed Email Domains beta 1.0 Y2
Reply #4 - Nov 8th, 2005 at 2:58am
Print Post  
By Certain Doamins I mean like setting domains a user cant register with like hotmail.com yahoo.com etc. also needs to be wildcard compatible
  
Back to top
WWWYIM  
IP Logged
 
tompocz
Full Member
***
Offline


The WORST day fishing
is better than the BEST
day

Posts: 124
Location: Adelaide
Joined: Dec 27th, 2002
Gender: Male
Re: Allowed Email Domains beta 1.0 Y2
Reply #5 - Nov 8th, 2005 at 3:00am
Print Post  
I just installed the mod thru BoardMod and it seemed fine

However, when I wen to the admin page I clicked on the link and it simply returned me to the main admin page
  

allowedemaildomainsprob.jpg (Attachment deleted)

The WORST day fishing is better than the BEST day working !
Back to top
WWW  
IP Logged
 
astropilot
God Member
*****
Offline



Posts: 828
Location: Louisville
Joined: Jun 18th, 2003
Gender: Male
Re: Allowed Email Domains beta 1.0 Y2
Reply #6 - Nov 8th, 2005 at 3:06am
Print Post  
Duh, I forgot one thing.  Give me 10mins or less.

ap
  

"For I am not ashamed of the gospel of Christ..."
Romans 1:16
---
http://www.ssflynn.com
www.flynnfarmsofkentucky.com
Back to top
 
IP Logged
 
Xavier
Senior Member
****
Offline



Posts: 442
Location: Ipswich
Joined: Apr 5th, 2005
Gender: Male
Re: Allowed Email Domains beta 1.0 Y2
Reply #7 - Nov 8th, 2005 at 3:06am
Print Post  
make sure the adminsublist is uploaded to the admin folder
  
Back to top
WWWYIM  
IP Logged
 
astropilot
God Member
*****
Offline



Posts: 828
Location: Louisville
Joined: Jun 18th, 2003
Gender: Male
Re: Allowed Email Domains beta 1.0 Y2
Reply #8 - Nov 8th, 2005 at 3:07am
Print Post  
Quote:
By Certain Doamins I mean like setting domains a user cant register with like hotmail.com yahoo.com etc. also needs to be wildcard compatible

Nope, can't do this.  But what you can do is identify the domains that can register.  But, I will put some thought into your idea.

ap
  

"For I am not ashamed of the gospel of Christ..."
Romans 1:16
---
http://www.ssflynn.com
www.flynnfarmsofkentucky.com
Back to top
 
IP Logged
 
astropilot
God Member
*****
Offline



Posts: 828
Location: Louisville
Joined: Jun 18th, 2003
Gender: Male
Re: Allowed Email Domains beta 1.0 Y2
Reply #9 - Nov 8th, 2005 at 3:16am
Print Post  
Its up.  I forgot to add the SubList stuff in the mod file.

ap
  

"For I am not ashamed of the gospel of Christ..."
Romans 1:16
---
http://www.ssflynn.com
www.flynnfarmsofkentucky.com
Back to top
 
IP Logged
 
tompocz
Full Member
***
Offline


The WORST day fishing
is better than the BEST
day

Posts: 124
Location: Adelaide
Joined: Dec 27th, 2002
Gender: Male
Re: Allowed Email Domains beta 1.0 Y2
Reply #10 - Nov 8th, 2005 at 4:29am
Print Post  
Thanks for that AP - I will try again.

As far as idenitfying domains to "allow" to register, that would be All domains minus the ones you want to ban. There must be millions there to allow, and Im just thinking of Carsten's Mod which had the flag option from admin center to either deny or allow.

I have included Carsten's mod here if it would help.

Will get back to you on the results

cheers
Tom

Quote:
<id>
Mail Domain for SP 1.3.1
</id>

<version>
0.6 beta
</version>

<mod info>

This mod lets admin create a list of mail domains legal or illegal for registration

Apply this mod.

Upload (in ASCII mode):
english.lng
Sources/Admin.pl
Sources/Register.pl
Sources/SubList.pl

Variables/maildom.txt  (chmod 666)

Go to Admin Center - Member Controls and click on the new "Set mail domains for registration" link
to add/change your list of legal or illegal mail domains.

</mod info>

<author>
Carsten
</author>

<homepage>
http://www.langaa-net.dk/cgi-bin/kayabb/YaBB.pl
</homepage>


<edit file>
english.lng
</edit file>

<search for>
if($MenuType == 1) {
     $menusep = ' | ';
</search for>

<add before>

%mdltxt = (
'01' => "Set mail domains for registration",
'02' => "One mail domain per line",
'03' => "Mail domains not valid for registration",
'04' => "Mail domains valid for registration",
'05' => "Sorry, you can not register using the Mail Domain :"
);

</add before>


<edit file>
Sources/Admin.pl
</edit file>

<search for>
       - <a href="$cgi;action=ipban">$txt{'206'}</a><br>
</search for>

<add after>
       - <a href="$cgi;action=setmaildom">$mdltxt{'01'}</a><br>
</add after>

<search for>
sub ml {
</search for>

<add before>
sub SetMaildom {
&is_admin;
my( @maildom, $maildomcnt, $i, $x, $setsel, $ssetsel0, $ssetsel1);
if(!-e ("$vardir/maildom.txt")) {
     fopen(FILE, ">$vardir/maildom.txt", 1);
           print FILE "0\n";
     fclose(FILE);
}
fopen(FILE, "$vardir/maildom.txt");
@maildom = <FILE>;
$maildomcnt = @maildom;
fclose(FILE);
chomp $maildom[0];
$setsel = $maildom[0];
if ($setsel eq "0") { $ssetsel0 = 'checked' } else { $ssetsel1 = 'checked' }

$yymain .= qq~
     <table border=0 cellspacing=1 bgcolor="$color{'bordercolor'}" class="bordercolor" align="center" cellpadding="4">
     <tr>
           <td bgcolor="$color{'titlebg'}" class="titlebg">
                 <img src="$imagesdir/register.gif" alt="" border="0">
                 <font size="2" class="text1" color="$color{'titletext'}"><b>$mdltxt{'01'}</b></font></td>
     </tr><tr>
           <td bgcolor="$color{'windowbg'}" class="windowbg">
                 <form name="maildom" action="$cgi;action=setmaildom2" method="POST">
                 <input type="radio" class="windowbg" name="setsel" value="0" $ssetsel0> <font size="2">$mdltxt{'03'}</font><br>
                 <input type="radio" class="windowbg" name="setsel" value="1" $ssetsel1> <font size="2">$mdltxt{'04'}</font></td>
     </tr><tr>
           <td align="center" bgcolor="$color{'windowbg2'}" class="windowbg2">
                 <font size="2">$mdltxt{'02'}</font><br>
                 <textarea cols=30 rows=6 name="maildom">~;
                 $x=0;
                 foreach $i (@maildom) {
                       chomp $i;
                       if($x>0) {
                             $i =~ s~\t~~g;
                             if( $i !~ m~\A[\S|\s]*[\n\r]*\Z~) { next; }
                             $yymain .= "$i\n";
                       }
                       $x++;
                 }
                 $yymain .= qq~</textarea><br>
                 <input type=submit value="$txt{'10'}">
                 </form></td>
     </tr>
     </table>
~;
$yytitle = "$mdltxt{'01'}";
&template;
exit;
}

sub SetMaildom2 {
     &is_admin;
     $FORM{'maildom'} =~ tr/\r//d;
     $FORM{'maildom'} =~ s~\A[\s\n]+~~;
     $FORM{'maildom'} =~ s~[\s\n]+\Z~~;
     $FORM{'maildom'} =~ s~\n\s*\n~\n~g;
     my $setselc = $FORM{'setsel'} eq '1' ? '1' : '0';
     fopen(FILE, ">$vardir/maildom.txt", 1);
     print FILE "$setselc\n";
     print FILE $FORM{'maildom'};
     fclose(FILE);
     $yySetLocation = qq~$cgi;action=admin~;
     &redirectexit;
}

</add before>


<edit file>
Sources/Register.pl
</edit file>

<search for>
if ($allow_hide_email == 1) { $yymain .= qq~
       <td><font class="text6"><input type=text maxlength="50" name=email size=40> <input type="checkbox" name="hideemail" value="checked" checked> $txt{'721'}</font></td>
~;
} else { $yymain .= qq~
       <td><input type=text name=email size=30>
       <BR><font class="text2a">$txt{'679'}</font></td>
~;
}
</search for>

<replace>
$setsel = 0;
$domsel = "";
if(-e ("$vardir/maildom.txt")) {
     fopen(FILE, "$vardir/maildom.txt");
     @maildom = <FILE>;
     $maildomcnt = @maildom;
     fclose(FILE);
     chomp $maildom[0];
     $setsel = $maildom[0];
     if($setsel == 1 && $maildomcnt > 1) {
           $domsel .= qq~ @ <select name="mdomsel"><option value=""></option>~;
           for($i=1; $i<$maildomcnt; $i++) { $domsel .= qq~<option value="$maildom[$i]">$maildom[$i]</option>~; }
           $domsel .= qq~</select>~;
     }
}

if ($allow_hide_email == 1) { $yymain .= qq~
       <td><font class="text6"><input type=text maxlength="50" name=email size=40>
~;
if($setsel == 1 && $maildomcnt > 1) {$yymain .= qq~$domsel<br>~;}
$yymain .= qq~
       <input type="checkbox" name="hideemail" value="checked" checked> $txt{'721'}</font></td>
~;
} else { $yymain .= qq~
       <td><input type=text name=email size=40>
~;
if($setsel == 1 && $maildomcnt > 1) {$yymain .= qq~$domsel~;}
$yymain .= qq~
       <BR><font class="text2a">$txt{'679'}</font></td>
~;
}
</replace>


<search for>
     &fatal_error("$txt{'240'} $txt{'69'} $txt{'241'}") if($member{'email'} !~ /[\w\-\.\+]+\@[\w\-\.\+]+\.(\w{2,4}$)/);
</search for>

<add before>

     fopen(FILE, "$vardir/maildom.txt") || &fatal_error("$txt{'23'} maildom.txt");
     @maildom = <FILE>;
     $maildomcn = @maildom;
     fclose(FILE);
     chomp $maildom[0];
     $getsel = $maildom[0];
     if($getsel == 1 && $maildomcn > 1) {
           $member{'email'} = qq~$member{'email'}@~;
           $member{'email'} .= qq~$member{'mdomsel'}~;
     }
     ($dummy, $memmaildom) = split(/\@/, $member{'email'});
     $x=0;
     $domcheck = $getsel;
     foreach $chkmaildom (@maildom) {
           chomp $chkmaildom;
           if($x>0) {
                 if($getsel == 0) {
                       if($memmaildom =~ m/\Q$chkmaildom\E/ig) { $domcheck = 1; }
                 }
                 else {
                       if($memmaildom =~ m/\Q$chkmaildom\E/ig) { $domcheck = 0; }
                 }
           }
           $x++;
     }
     if($x==1) {$domcheck = 0}
#      if($domcheck) { &fatal_error("$mdltxt{'05'} $memmaildom"); }

     if($domcheck) { &fatal_error_email_domain("&nbsp;&nbsp;&nbsp;&nbsp;<b>UserID :</b> $member{'username'}<br>&nbsp;&nbsp;&nbsp;&nbsp;<b>Email Address :</b> $member{'email'}<p><center><b><span style=\"font-size:8pt ; weight:bold ; font-family:Arial,Helvetica,sans-serif ; color:#006600\">Sorry, Your Domain Address <font color=\"#ff0000\"><b>$memmaildom</b></font> is not permitted at <b><font color=\"#800000\">fish</font><font color=\"#0000ff\">SA</font><font color=\"#000000\">.com</font></b>.</span></b></center>"); }

</add before>


<edit file>
Sources/SubList.pl
</edit file>

<search for>
'setcensor2',"AdminEdit.pl&SetCensor2",
</search for>

<add after>
'setmaildom',"Admin.pl&SetMaildom",
'setmaildom2',"Admin.pl&SetMaildom2",
</add after>
  

The WORST day fishing is better than the BEST day working !
Back to top
WWW  
IP Logged
 
tompocz
Full Member
***
Offline


The WORST day fishing
is better than the BEST
day

Posts: 124
Location: Adelaide
Joined: Dec 27th, 2002
Gender: Male
Re: Allowed Email Domains beta 1.0 Y2
Reply #11 - Nov 8th, 2005 at 4:38am
Print Post  
AP - just read your post No. 1 regarding the checks in people changing their email address to a banned one in their profile. I think this is a good idea as it ensure that those domains you potentially ban are TRULY banned.
  

The WORST day fishing is better than the BEST day working !
Back to top
WWW  
IP Logged
 
tompocz
Full Member
***
Offline


The WORST day fishing
is better than the BEST
day

Posts: 124
Location: Adelaide
Joined: Dec 27th, 2002
Gender: Male
Re: Allowed Email Domains beta 1.0 Y2
Reply #12 - Nov 8th, 2005 at 4:41am
Print Post  
So as to further highlight Carsten's Mod for 1.3 below is the image from within admin center, to help visualise the intent

I try and ban ALL free email domains from registering on my site, as this weeds out most trouble makers who hide behind such accounts like hotmail. IT also provides better audit trails if they are forced to use their ISP account, as most major ISP's in Australia have a "greviance" department to handle any pests.
  

emaildomimage.jpg (Attachment deleted)

The WORST day fishing is better than the BEST day working !
Back to top
WWW  
IP Logged
 
astropilot
God Member
*****
Offline



Posts: 828
Location: Louisville
Joined: Jun 18th, 2003
Gender: Male
Re: Allowed Email Domains beta 1.0 Y2
Reply #13 - Nov 8th, 2005 at 2:14pm
Print Post  
Yeah, it shouldn't be a problem to add that, just not today.  Hopefully tomorrow.

ap
  

"For I am not ashamed of the gospel of Christ..."
Romans 1:16
---
http://www.ssflynn.com
www.flynnfarmsofkentucky.com
Back to top
 
IP Logged
 
CasRas
Junior Member
**
Offline



Posts: 98
Location: Terra, the blue planet
Joined: Jun 7th, 2005
Gender: Male
Re: Allowed Email Domains beta 1.0 Y2
Reply #14 - Nov 8th, 2005 at 6:35pm
Print Post  
Thanks, here a german language file
Code
Select All
#-----------------------------------------------------------------#
# Distilled_Email_Domains.lng (Distilled_Email_Domains txt definitions)#
# for YaBB 2									    #
# by Shawn Flynn								  #
#-----------------------------------------------------------------#
# Copyright: 2005 'Shawn Flynn' - All Rights Reserved			#
# Released: November 6, 2005							#
# e-mail:	  shawnflynn@louisville.edu				  #
#-----------------------------------------------------------------#
# Any redistribution of this script without the expressed written #
# consent of 'cd-profil as' is strictly prohibited. Copying any	    #
# of the code contained within this script and claiming it as	    #
# your own is also prohibited.							#
#-----------------------------------------------------------------#
# By using this script you agree to indemnify 'Shawn Flynn'		#
# from any liability that might arise from its use.			#
#-----------------------------------------------------------------#
# You may not remove any of these header notices.			#
#-----------------------------------------------------------------#

%Distilled_Email_Domains_txt = (
'1' => "Wer darf sich registrieren",
'2' => "Distilled Email Domains",
'3' => "Geben Sie die Domains ein, unter denen man sich registrieren darf. Lassen Sie das Feld leer um die Funktion abzuschalten.<br />Nur eine Domain pro Zeile. (z.B. yahoo.com)",
'4' => "erlaubte Email Domains",
'5' => "erlaubte Email Domains bearbeiten",
'6' => "blockierte Email Domains",
'7' => "Geben Sie die Domains ein, die blockiert werden sollen. Lassen Sie das Feld leer um die Funktion abzuschalten.<br />Nur eine Domain pro Zeile. (z.B. yahoo.com)",
'8' => "Sie dürfen sich unter dieser Email Domain nicht registrieren oder eine solche als aktuelle Emailadresse nutzen",
);

1; 

« Last Edit: Nov 10th, 2005 at 7:45am by CasRas »  

See Ya CasRas
aka RasCas
aka Vip2002
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 3 4
Send TopicPrint