Skip to main content

Posts

Showing posts from June, 2014

Configure drupal_http_request() on the fly

The drupal_http_request() function supports connections using a proxy. You can configure a global proxy to use for all drupal_http_request() callbacks from the settings.php file of your website/installation by filling the following lines with the proper information:For those of you preferring a UI, then HTTP proxy module is for you.But what if you only want to use a proxy in some cases; like a custom module? In that case you will need the following function(modify accordingly):Now all you have to do is Call <?php _MYMODULE_change_proxy(); ?>.Do your drupal_http_request() calls.Call <?php _MYMODULE_change_proxy(TRUE); ?> to reset your previous settings.

New module: Email Validator

Today I published on drupal.org the module I was developing the last few days: Email Validator. I copy from there the description of the module:Integrates Drupal with the Email Address Online Verification API. As it is said in the service's website, the validation process includes the following steps: Syntax verificationDNS validation including MX record lookupDisposable email address (DEA) detectionSMTP connection and availability checkingTemporary unavailability detectionMailbox existence checkingCatch-All testingGreylisting detection In case the service is unavailable at the moment, this module may use Drupal's built-in valid_email_address() function, assume a valid email address or assume an invalid email address. The administrator of the website may change the action to use, using the configuration form of this module.
It was a nice challenge for me since it was the first time I played around with the Field API to make sure this module played well with the Email field widge…