how to User Created By Other User- email notification

User Created By module saves uid of user who creates other users. This is very helpful in sites where particular user roles are allowed to create other users and with this module it can be easily shown who created which user.

function filter_event_title_form_alter(&$form, $form_state, $form_id){
/* Altering referal fields automatically START */
if(arg(0)==’admin’ && arg(1)==’user’&& arg(2)==’user’&& arg(3)==’create’ && is_numeric($_REQUEST[‘dir_ref_uid’]) && isset($_REQUEST[‘dir_ref_side’]) ){
/* Alter Referral UID Field START*/
$referr_new_obj = user_load($_REQUEST[‘dir_ref_uid’]);
$form[‘System Info’][‘profile_referrer_username’][‘#default_value’] = $referr_new_obj->name;
$form[‘System Info’][‘profile_referrer_username’][‘#attributes’][‘readonly’] = ‘readonly’;
$form[‘System Info’][‘profile_referrer_uid’][‘#default_value’] = $referr_new_obj->uid;
$form[‘System Info’][‘profile_refer_des_side’][‘#default_value’] = $_REQUEST[‘dir_ref_side’];
$form[‘account’][‘notify’][‘#default_value’] = TRUE;
/* Alter Referral UID Field END*/
/* Altering referal fields automatically END */

Was this article helpful?

Related Articles