You are here

function reg_with_pic_avatarapproval in Register with Picture 6

Implementation of hook_avatarapproval().

File

./reg_with_pic.module, line 146
This module allows a user picture to be uploaded at registration time.

Code

function reg_with_pic_avatarapproval($form, $form_state) {
  return array(
    'user_register' => array(
      // Specifies which user submitted avatar belongs to
      'avatar_owner' => user_load(array(
        "name" => $form['#post']['name'],
      )),
      // Field of the avatar picture upload
      'upload_field' => 'picture_upload_register',
      // If set, decide if to hook in as last (TRUE) or first (FALSE, default) submit handler
      // NOTE: in this case we need the user module to create the user before avatarapproval hooks in,
      // so we set as late submit handler to true
      'late_submit_handler' => TRUE,
    ),
  );
}