summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Beaupré2009-06-09 22:42:40 +0000
committeranarcat2009-06-09 22:42:40 +0000
commit95cc85305ccabd4c99649c7731293bef8fed0c05 (patch)
tree00091d95dc6312978a29b092e99765a3dd9cf03c
parent44339e93f6e8dffc4eb193bc4d903a1fcabfed46 (diff)
#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 deploy6.x-0.2
-rw-r--r--platform/deploy.provision.inc2
-rw-r--r--platform/drupal/install_5.inc12
-rw-r--r--platform/provision_drupal.drush.inc1
3 files changed, 10 insertions, 5 deletions
diff --git a/platform/deploy.provision.inc b/platform/deploy.provision.inc
index db0de1c..34cd6e2 100644
--- a/platform/deploy.provision.inc
+++ b/platform/deploy.provision.inc
@@ -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);
}
diff --git a/platform/drupal/install_5.inc b/platform/drupal/install_5.inc
index 3a4607e..1e9efc8 100644
--- a/platform/drupal/install_5.inc
+++ b/platform/drupal/install_5.inc
@@ -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();
diff --git a/platform/provision_drupal.drush.inc b/platform/provision_drupal.drush.inc
index 6195dd5..b9243b0 100644
--- a/platform/provision_drupal.drush.inc
+++ b/platform/provision_drupal.drush.inc
@@ -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');
}
}