Create a node(filedepot folder) after user registers in site Possible Duplicate:
  How to create new node programmatically, when a new user is created, in Drupal 7?  




I am using Drupal-7 and Filedepot module. In Filedepot module a folder is created when we create node of filedepot folder content type.

I want to achieve that when any user registers in the site then one filedepot folder should be created. 

Initially I used Rules module. And after registration I created a Rule to create a node of filedepot folder content type, but problem is that by using Rules I can't set some of the fields of content type. Node creation using Rules only creates node and sets title but it doesn't set the values of other fields.

Now I am planning to achieve it using other way, after user registers I want to create a node programmatically. 

How can I customize Rule's node create action?
This is how I managed it, and there was one problem regarding permission in folder creation. So I just assigned permission to create folder. and here is the code to create folder during user registration

function modulealter_user_insert(&amp;$edit, $account, $category) {
    $node = new stdClass();
    $node-&gt;type = 'filedepot_folder';
    node_object_prepare($node);
    $node-&gt;language = LANGUAGE_NONE;
    $node-&gt;uid = $account-&gt;uid;
    $node-&gt;name = $account-&gt;name;
    $node-&gt;title = check_plain($account-&gt;name);
    $node-&gt;filedepot_folder_desc[LANGUAGE_NONE][0]['value'] = 'This is private folder of author user.';
    $node-&gt;parentfolder = 4;
    $node-&gt;inherit = 0;
    node_save($node);
    watchdog('filedepot',"New folder created @name - new filedepot folder created.", array('@name' =&gt; $account-&gt;title));
}