Set user password using RULES

This CodeLet allows to set the user password during Rule execution, the following process can be used.

  1. create user entity ($newuser)
  2. set a rules variable $password (use PHP code to generate a random string)
  3. execute custom PHP which looks like

This way, you can also use the variable $password in say, an email to the user letting them know what their automatically generated password is.

Drupal: Programmatically manage members of sub groups

This CodeLet let you Programmatically manage members of sub groups. also you can add sub group.
you can inviter/remove peoples of sub groups. Invitation will be sent by email.
after installation of this CodeLet you must have to pass the group gid on query string, 
Ex.  yourdomain/subgroups/$gid.

CodeLet Dependencies:

  1. Organic groups ( og )
  2. Subgroups for Organic groups ( og_subgroups )
  3. OG Invite People ( og_invite_people ).

 

Programmatically create vocabulary

In some situation, you module is required to create a taxonomy which the module use to perform other tasks/features it offers. This is when you can write a code to craete the require vocabulary in the module and make it availabel as soon as the module is installed. You can also add terms programatically to that vocabulary!

Using taxonomy_save_vocabulary for Drupal 5.x & 6.x and taxonomy_vocabulary_save for 7.x, you can create the vocabulary programmatically in your module.

Here is a Drupal 6.x example: