Posts Tagged ‘drupal’

How to programmatically create and log in drupal users

Creating a new user is very easy in Drupal 6. Here’s how. <p>> <p>$new_user = array(</p> <p>&#8216;name&#8217; => $username,<br /> &#8216;mail&#8217; => $mail,<br /> &#8216;pass&#8217; => user_password(),<br /> &#8216;status&#8217; => 1,<br /> &#8216;auth_MODULENAME&#8217; => $username<br />)</p> <p>$user = user_save(NULL,$new_user)</p> <p>// log the user in</p> <p>$user = user_authenticate($new_user)</p> <p> Now for the explanation. We create a [...]

Gravatar support in Drupal

If you’ve been using WordPress you probably know about Gravatar. Gravatar is an abbreviation for “Globally Recognized Avatar”. It’s a service which provides an avatar across sites. While Gravatar support is built-in in WordPress, it requires an external module to be installed in Drupal. Recently I had to use the module in a Drupal 5 [...]