It would be awesome to make use of the BotScout API -
http://botscout.com/api.htm
and get it to check the user e-mail address field on the WebSignupForm.
...
--- SEE THE WORKING CODE BELOW ---
It would be really nice to have a simple BotScout class that would take the BotScout URL and optional API key as arguments to the constructor. It could have methods that just returned true or false like this:
bsCheckEmail($address) {
return (_bsCheck($address,'email'));
}
bsCheckIp($ip) {
return (_bsCheck($ip,'ip'));
}
// etc.
_bsCheck($string, $method) {
switch ($method) {
case 'email':
//contact bs here
break;
case 'ip':
//contact bs here
break;
// etc.
}
} // (used internally to actually do the check)
Then it could be easily used in WLPE, SPForm, eForm, etc.
Just my $.02.
I haven't run all the tests YET but I put this just _above_ //verify email in websignup.inc.php
// mrhaw - kick in BotScout.com
$botdata='';
$XIP = $_SERVER['REMOTE_ADDR'];
$XMAIL = $_POST['email'];
$XMAIL =urlencode($XMAIL);
//add missing : to the url below this to hinder forum auto-linking.
$apiquery = "http //botscout.com/test/?multi&mail=$XMAIL&ip=$XIP";
$ch = curl_init($apiquery);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$returned_data = curl_exec($ch);
curl_close($ch);
$botdata = explode('|', $returned_data);
if(substr($returned_data, 0,1) == '!'){
// if the first character is an exclamation mark, an error has occurred
$output .="Error: $returned_data";
return;
}
if($botdata[3] > 0 || $botdata[5] > 0){
// your 'rejection' code would go here....
// for example, print a fake error message and exit the process.
$errnum = round(rand(1100, 25000));
$output .="Confabulation Error #$errnum, Halting.";
return;
}
The $apiquery address needs an key to be used often (register on webpage)
//It works all NICE!!!!!!!!
[ed. note: mrhaw last edited this post 14 years, 10 months ago.]
mrhaw
Thanks for your reply to my capture IP. I really like this email verification. Can it be used to verify that email addresses are from 10 different corporate domains?
I ask because I need people to register for site access but verify without them knowing that they do indeed work for Widget, Inc and are registering with with
[email protected] address.
Is there a way to also track what docs (resources) they view?
MySQL: 5.0.45
PHP: 5.2.6
Linux 2.6.9-023stab048.6-enterprise #1
cURL enabled
PDO enabled
FFox Apple 3.6.8
Firebug DIS-abled
The above code with a &key=REGISTER-2-GET-IT in the end of the url in $apiquery variable
works nice checking the e-mail against botscout’s database.
You would want to use something like this (
EXAMPLE CODE ONLY)
based on
http://modxcms.com/forums/index.php/topic,38986.msg235151.html#msg235151
still to be put just above //verify email in websignup.inc.php
$XMAIL = $_POST['email'];
$allowed='[email protected], [email protected], [email protected]';
$allowed2 = ",".$allowed.",";
$CHECK = strpos($allowed2,',' . $XMAIL . ',');
if ($CHECK === false) {
$errnum = round(rand(1100, 25000));
$output .="Confabulation Error #$errnum, Halting.";
return;
}
else {
// ok, they are fine!
return;
}
This would need some careful testing.
Ehh, that would require you to add EVERYBODY to the list...
with http://se2.php.net/substr or some other method this could be
worked out to only compare against the domain name.
More candy
http://modxcms.com/forums/index.php/topic,33978.msg206635.html#msg206635
http://modxcms.com/forums/index.php/topic,30978.msg187748/topicseen.html#msg187748
Ehh, that would require you to add EVERYBODY to the list...
with http://se2.php.net/substr or some other method this could be
worked out to only compare against the domain name.
I checked out the substr link above. Amazing how many functions people contributed. In the example code you provided,
can a function just check for something.com or even *.something.com, meaning any
[email protected] so I could concern myself with only list the 10-20 domains that are allowed?
MySQL: 5.0.45
PHP: 5.2.6
Linux 2.6.9-023stab048.6-enterprise #1
cURL enabled
PDO enabled
FFox Apple 3.6.8
Firebug DIS-abled
If ’@domain123.com’ is in there; allow:
$XMAIL = $_POST['email'];
$CHECK = strpos($XMAIL, '@domain123.com');
if ($CHECK === false) {
$errnum = round(rand(1100, 25000));
$output .="Confabulation Error #$errnum, Halting.";
return;
}
else {
// ok, they are fine!
return;
}