PDA

View Full Version : AJAX: check for banned email on registration and changing mail


MrNase
05-16-2005, 10:00 PM
Hello there!

Yet another kickin' AJAX hack for your forums :banana:

What does this hack do?
Some of you have banned mail accounts for good reason.. This hack checks for banned mails and displays an error message if a banned one is entered. The submit field is also disabled so that you can't register unless you change your input.

This hack is working on the registration page and your UserCP!


Features:
* can be turned off or on via the AdminCP
* uses the vB phrases and can easily be translated
* the user gets the error message without reloading the page
* he/she can't complete the registration if the mail is banned
* works on the 'change mail' site in your UserPC also
* HTML instructions for your pleasure ;)


Do I need to be an expert to install this hack?
Like my first AJAX hack this is not complicate at all. You have to upload one file, edit two files, edit two template and add some custom CSS. Besides this there are 4 queries you need to run (see the point 'Warning:' for more information). Should be pretty easy and I'll support you as good as I can.


Demo:
You may take this for a test drive at my forums but please don't complete the registration unless you want to join my german community :hurt:
http://www.pagodentreff.de/diskussi...um/register.php (http://www.pagodentreff.de/diskussionsforum/register.php)
Just use 'test@bla.com' as the email and see what happens.


Problems?
You'll notice that this hack doesn't work right from the start. To fix this you must:


Edit one phrase and save it.
Edit one vBulletin setting and save it.
This is necessary so that the cache is rebuild.



Warning:
This hack doesn't have an automatic installer. However you need to run 4 different queries for this hack to work. Those queries are for the settings in your AdminCP and for the phrases only. This hack won't affect your performance https://vborg.vbsupport.ru/
If you feel uncomfortable with running queries you may drop me a private message and I'll see what I can do for you.


I will support this hack as good as I can but please keep your questions within this thread.

Don't forget to install (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=81631) ;)

The screenshots are taken from my translated version.

This hack wouldn't be possible without the following article and the code: http://www.xml.com/pub/a/2005/02/09...tp-request.html (http://www.xml.com/pub/a/2005/02/09/xml-http-request.html)

Marco van Herwaarden
05-17-2005, 10:39 AM
Lol, keep them coming.

We will have all teh vB3.5 functions before it is even released :D

Paul M
05-17-2005, 10:41 AM
Wouldn't it have been more sensible just to have combined this with the other check rather than two seperate hacks ?

MrNase
05-17-2005, 10:42 AM
This one was requested by Christine via PM so don't blame me :D


The worst thing was to write the instructions.. That took like an hour :/

And, as always, I think i might have forgotten something so that this hack doesn't work. Iam impatiently waiting for the first saying it's working ;)

Paul M: No, I don't think so.. Those of you who don't ban email adresses don't need this hack :)

j_86
05-17-2005, 10:48 AM
MAybe in 3 weeks time if more AJAX hacks come about you could release an AJAX Functionality Power Pack :)

GJ

nexialys
05-17-2005, 11:11 AM
ok, username, password... now the image verification, the referrer and the Complete button... lol

hey, joking... i'm happy now!

j_86
05-17-2005, 11:18 AM
Already registered e-mail address? :)

MrNase
05-17-2005, 11:20 AM
No, not yet.. I can't bring those 2 together.. Sorry :(

Christine
05-17-2005, 11:53 PM
Woohoo! Thanks so much!

Why I requested (in case anyone is wondering): If you are blocking free emails for new users, they seem to ignore the BIG BOLD LETTERS that tell them this (WITH examples like hotmail, gmail and yahoo listed) and still email me to ask why their hotmail account is being shown as 'invalid'.

Now, when they tab off the field, it can say "per the registration screen to your LEFT, we do not allow free emails any longer. Please register an email from your ISP or a private domain" -- rather than getting to the end and just seeing 'email is invalid'.

Should cut down on the vast majority of my support emails -- and I get between 7-10 a day asking about this.

* Christine installs with gratitude

Lizard King
05-18-2005, 03:14 AM
This didn't work for usercp change e-mail option. Any idea why ?
Saved a phrase and settings.

MrNase
05-18-2005, 05:42 PM
lol that's what I said in the very first posting: Edit and save one phrase and one setting ;)

Christine: Did you try it? Does it work for you? :)

Christine
05-18-2005, 10:53 PM
Yes!!! :D

Loaded in minutes and worked like a charm right off the bat. No more 'why do you think my email is invalid' emails every day to c/p the canned response into.

Me --> :D :D :D

Barakat
05-20-2005, 11:27 AM
An error occurred while attempting to execute your query. The following information was returned.
error number: 1064
error desc: You have an error in your SQL syntax near ';

INSERT INTO `phrase` (`phraseid`, `languageid`, `varname`, `text`, `phrase' at line 1
i tried to insert them but this error have been displayed

MrNase
05-21-2005, 03:07 PM
You have to execute them one by one and not all together.

First run the first query, wait if it's working than run the second query and so on :)

Brent H
05-24-2005, 07:28 AM
This isn't working for me :( I followed all the instructions, checked and double-checked and then triple-checked all the modifications.

I changed and saved a phrase and a vB setting, still nothing :( Anyone else have this problem? It's a fresh install of vB.

Brent H
05-24-2005, 04:25 PM
I've just done a complete reinstall of vBulletin, followed all the instructions and nothing is happening :( I installed the AJAX username check as well, and now if I put in a banned email the "This user already exists" thing pops up, but not the email one. WTF?

Christine
05-25-2005, 04:44 PM
TheHeggy,

Are you entering in the banned email into the 'banning options' of the Control Panel as email@domain.com emaiil2@domain2.com or domain.com domain2.com with spaces between?

Brent H
05-25-2005, 07:26 PM
I've tried banned@email.com without any other emails, and when that didn't work I tried @hotmail.com.

MrNase
05-26-2005, 08:07 PM
This one uses a default vB function to validate the emails.. It should work just like the 'normal' banned email feature :)

Christine
05-27-2005, 01:56 AM
TheHeggy,

Please try entering just hotmail.com into that section of the vB options and removing everything else (including spaces). Then try to register with <whatever>@hotmail.com and see what the system does.

Barakat
06-03-2005, 03:43 AM
thanks for that nice hack