If you still want a configuration form, then you can build upon the "Client step" and change the function brochure_client_form_submit($form, &$form_state)
so that it suits your needs (all code is untested):
function brochure_client_form_submit($form, &$form_state) {
// Setup the user account array to programatically create a new user.
$account = array(
'name' => YOUR_NAME,
'pass' => YOUR_PASS,
'mail' => YOUR_MAIL,
'status' => 1,
'init' => 'install profile', // Just an example
);
$account = user_save(null, $account);
}
If you don't need a separate configuration form during install, you can define a "formless" task like this:
/**
* Implements hook_install_tasks().
*/
function mymodule_install_tasks() {
$tasks['mymodule_setup_admin_account'] = array(
'display_name' => st('Setup admin account'),
);
return $tasks;
}
function mymodule_setup_admin_account() {
// Setup the user account array to programatically create a new user.
$account = array(
'name' => YOUR_NAME,
'pass' => YOUR_PASS,
'mail' => YOUR_MAIL,
'status' => 1,
'init' => 'install profile', // Just an example
);
$account = user_save(null, $account);
}
You still have to create the role and add it to the created user. If you have created the role prior to the user creation, then you can also pass it directly to user_save
:
$account = array(
'name' => YOUR_NAME,
'pass' => YOUR_PASS,
'mail' => YOUR_MAIL,
'status' => 1,
'init' => 'install profile', // Just an example
'roles' => array(
ROLE_ID => ROLE_ID,
),
);
$account = user_save(null, $account);
More on install profiles: How to Write a Drupal 7 Installation Profile