Drupal Caulfield's blog

Example usage of drupal_mail_send()

Just wanted to put this up as a quick example for future usage.

$headers = array(
'MIME-Version' => '1.0',
'Content-Type' => 'text/plain; charset=UTF-8; format=flowed; delsp=yes',
'Content-Transfer-Encoding' => '8Bit',
'X-Mailer' => 'Drupal',
drupal_mail_send($message = array(
'id' => 'test_test',
'from' => 'test@gmail.com',
'to' => 'test@gmail.com',
'subject' => 'test',
'body' => 'test2',
'headers' => $headers,

Going directly to a module's project page from the command line

Seems like I spend at least 20 minutes everyday typing out URLs to drupal.org project pages. With 6,750+ modules (and counting...), I often have to assess a new module I come across or refresh myself on the details of a certain module in use. Wouldn't it be nice to have a little hack to make this quicker? I'm usually on the command line when needing this info, so why not a command line hack?

Presentation on Securing your Social Networking Profile

I'll be presenting today on the topic of securing your online social media profile. The focus is on Facebook, Twitter, and Google. This topic was great to research, cause once you start diving into online data flows, everything starts to meld together. Leaks from one social site can easily help expose your identity or private data on other sites. Plus, Facebook makes privacy blunders about once a month now, leaving me with plenty of material.

Passwordless login to SSH using keys

So you followed the excellent guide over at http://www.csua.berkeley.edu/~ranga/notes/ssh_nopass.html to setup so you can SSH to your server without entering your password everytime, by using a public/private keypair. However, it's still not working, still asking for a password. Why is this? Well, your situation may be different, but for one server I had the problem was the permissions. SSH would only allow a connection if both the authorized_keys file AND the .ssh directory were both set to chmod 700.

Allow users to post comments but not to view them

Well, Drupal, you threw me a WTF moment, when on my latest site I gave users the post comments permission, but not the access comments permission, and much to my surprise, users were not able to post comments. I swear this either worked with D5 or there was a module to workaround it. For what it's worth, installing the comment_perm "Comment Permissions" module does NOT help this issue.

Fortunately, for D7 there is a patch, which I reviewed and found to work perfectly.


Subscribe to RSS - Drupal Caulfield's blog