Help with .htaccess rules

Status
Not open for further replies.

shiromar

New Member
Messages
18
Reaction score
0
Points
1
Hello, I was wanting to know if anyone could help me with this.
I wanna add a .htaccess rule that prevents registering on my esoTalk forums with anything other than Gmail, if it's possible please get back to me as soon as you can. Reason I'm asking is because of late I've been getting spammed by bots even with a few anti spam protection features, and where most of the anti spam protection plugins haven't been or most likely won't be updated I'd like to have at least have something to fallback on. Thanks in advance.
 

ChatIndia

Community Advocate
Community Support
Messages
1,408
Reaction score
30
Points
48
I have a same kind of functionality on my website where I only allow emails from well known email providers like GMail, Outlook, Yahoo etc. You can do that with PHP.
Just split the email into an array of words separated by '@' and check the last index of the array to find the domain of email provider. If it is equal to 'gmail.com' then register the user otherwise reject it.
I'm not sure whether it is possible with .htaccess. I just gave an alternative approach, in case you might want to go with it.
 

mckx10m2

New Member
Messages
16
Reaction score
0
Points
1
I do not think it can be done via .ataccess file.

If bots is an issue maybe you should look into having a Captcha code when people try to send a message, they have to type in the captcha code else and error is displayed.

Look for securimage (yes that is not secureimage with a "e" in between), it is a Opensource Captcha code generation/validation library.
 
Last edited:

caftpx10

Well-Known Member
Messages
1,534
Reaction score
114
Points
63
Honestly, I've found restricting emails to certain domains to be a good idea. You can't use disposable emails and you could manage what would be the best email domains to throw in.
 

shiromar

New Member
Messages
18
Reaction score
0
Points
1
I do not think it can be done via .ataccess file.

If bots is an issue maybe you should look into having a Captcha code when people try to send a message, they have to type in the captcha code else and error is displayed.

Look for securimage (yes that is not secureimage with a "e" in between), it is a Opensource Captcha code generation/validation library.
I would use a Captcha but seeings as the reCaptcha plugin doesn't work because it's not up to date with Google's reCaptcha, I'm stuck with using StopForumSpam which doesn't work 100% of the time as it only blocks out known or reported IP's and emails, not only that but with how esoTalk is coded the slightest change could cause an error so it's kind of hard to work your way around it. I would use NodeBB or Discourse but these both don't work with the free plan that x10hosting provides or at least don't work for me, and with Flarum being scheduled not to be released for another few months I can't really change to anything else.

I have a same kind of functionality on my website where I only allow emails from well known email providers like GMail, Outlook, Yahoo etc. You can do that with PHP.
Just split the email into an array of words separated by '@' and check the last index of the array to find the domain of email provider. If it is equal to 'gmail.com' then register the user otherwise reject it.
I'm not sure whether it is possible with .htaccess. I just gave an alternative approach, in case you might want to go with it.
I'll look into trying this, but knowing esoTalk's coding it most likely won't let me or will cause errors somewhere in the forum software.
 

caftpx10

Well-Known Member
Messages
1,534
Reaction score
114
Points
63
I would use a Captcha but seeings as the reCaptcha plugin doesn't work because it's not up to date with Google's reCaptcha, I'm stuck with using StopForumSpam which doesn't work 100% of the time as it only blocks out known or reported IP's and emails, not only that but with how esoTalk is coded the slightest change could cause an error so it's kind of hard to work your way around it. I would use NodeBB or Discourse but these both don't work with the free plan that x10hosting provides or at least don't work for me, and with Flarum being scheduled not to be released for another few months I can't really change to anything else.


I'll look into trying this, but knowing esoTalk's coding it most likely won't let me or will cause errors somewhere in the forum software.
If you're going to modify forum software, you may need to adapt to how it all works first to be able to successfully code that feature in. I don't know what the code of this forum software looks like and is set out so I don't think I would be any use.
 

ChatIndia

Community Advocate
Community Support
Messages
1,408
Reaction score
30
Points
48
I've tried every plugin that's been released for esoTalk version 1.0.0g4, Honeypot is no exception, it's as useless as StopForumSpam at this point. :meh:
I have installed esoTalk on my local machine and changed the core file for you. It's seems to be working for me

Steps:
1. Go to your installation_folder/core/models
2. Open file "ETMemberModel.class.php" in a texteditor
3. Find this line
Code:
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) return "invalidEmail";
4. add the below code just after that line
Code:
    $allowedEmails = array('gmail.com');
     $arr = explode('@',$email);
     if(count($arr) > 2){
       return "invalidEmail";
     } else{
       if(!in_array(strtolower($arr[1]),$allowedEmails)){
         return "invalidEmail";
       }
     }
 

shiromar

New Member
Messages
18
Reaction score
0
Points
1
I have installed esoTalk on my local machine and changed the core file for you. It's seems to be working for me

Steps:
1. Go to your installation_folder/core/models
2. Open file "ETMemberModel.class.php" in a texteditor
3. Find this line
Code:
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) return "invalidEmail";
4. add the below code just after that line
Code:
    $allowedEmails = array('gmail.com');
     $arr = explode('@',$email);
     if(count($arr) > 2){
       return "invalidEmail";
     } else{
       if(!in_array(strtolower($arr[1]),$allowedEmails)){
         return "invalidEmail";
       }
     }
Thanks, hope this works. Also I'd like to ask if this would cause any issues with our social sign up/login? I ask because OpauthConnect is one of those slightly buggy plugins that you've got to manually edit and mess around with from time to time.
 

ChatIndia

Community Advocate
Community Support
Messages
1,408
Reaction score
30
Points
48
Thanks, hope this works. Also I'd like to ask if this would cause any issues with our social sign up/login? I ask because OpauthConnect is one of those slightly buggy plugins that you've got to manually edit and mess around with from time to time.
I have no idea about it. I looked at the script for the first time in my life and I took less than 2 minutes to make that modification after installing that script. I haven't done a thorough study of that script code or it's API. So I'm not sure how this modification will affect other parts of the script. I think there is only one way to find it out and that is by trying.
 

shiromar

New Member
Messages
18
Reaction score
0
Points
1
I have no idea about it. I looked at the script for the first time in my life and I took less than 2 minutes to make that modification after installing that script. I haven't done a thorough study of that script code or it's API. So I'm not sure how this modification will affect other parts of the script. I think there is only one way to find it out and that is by trying.
So far nothing is affecting the OpauthConnect plugin, again thanks for solving the problem as of now, I'm going to try to get into contact with the person that created the OpauthConnect plugin to see if he'll be able to help me more on the concern of any affects that this may or may not cause.
 
Status
Not open for further replies.
Top