Commit 95cc8530 authored by anarcat's avatar anarcat Committed by anarcat

#486718 by anarcat - split up admin account creation from email sendout so...

#486718 by anarcat - split up admin account creation from email sendout so that it works even if client_email is not set. while i'm here, fix up the bootstrap sequence in deploy
parent 44339e93
......@@ -91,8 +91,8 @@ function drush_provision_drupal_post_provision_deploy($url) {
if (drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_FULL)) {
drush_include_engine('drupal', 'deploy');
drush_set_option('packages', _scrub_object(provision_drupal_system_map()), 'site');
_provision_drupal_rebuild_caches();
}
_provision_drupal_rebuild_caches();
// the url is likely to have changed in the deployment
drush_set_option('site_url', $url);
}
......@@ -42,7 +42,10 @@ function install_verify_settings() {
return FALSE;
}
function install_send_welcome_mail($url, $profile, $language, $client_email) {
function install_create_admin_user($client_email = NULL) {
if (!$client_email) {
$client_email = 'webmaster@localhost';
}
// create the admin account or change some parameters if the install profile
// already created one
$account = user_load(array('uid' => 1));
......@@ -53,8 +56,10 @@ function install_send_welcome_mail($url, $profile, $language, $client_email) {
$edit['pass'] = user_password();
$edit['mail'] = $client_email;
$edit['status'] = 1;
$account = user_save($account, $edit);
return user_save($account, $edit);
}
function install_send_welcome_mail($url, $account, $profile, $language, $client_email) {
// Mail one time login URL and instructions.
$from = variable_get('site_mail', ini_get('sendmail_from'));
$onetime = user_pass_reset_url($account);
......@@ -177,8 +182,9 @@ function install_main() {
}
variable_set('install_profile', $profile);
$account = install_create_admin_user($url, $client_email);
if ($client_email) {
install_send_welcome_mail($url, $profile, $language, $client_email);
install_send_welcome_mail($url, $account, $profile, $language, $client_email);
}
}
install_main();
......@@ -261,7 +261,6 @@ function _provision_drupal_create_directories($url, $profile = NULL) {
*/
function _provision_drupal_rebuild_caches($url = NULL) {
if (PROVISION_CONTEXT_SITE) {
#drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_FULL);
drush_include_engine('drupal', 'clear');
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment