Commit 3a87c2e8 authored by Adrian Rossouw's avatar Adrian Rossouw Committed by adrian
Browse files

Store the onetime login link in a drush process option to pass back to the front end

parent f957768e
......@@ -78,12 +78,16 @@ function install_send_welcome_mail($url, $account, $profile, $language, $client_
// Mail one time login URL and instructions.
$from = variable_get('site_mail', ini_get('sendmail_from'));
$onetime = user_pass_reset_url($account);
$variables = array(
'!username' => $account->name, '!site' => variable_get('site_name', 'Drupal'), '!login_url' => $onetime,
'!uri' => $base_url, '!uri_brief' => preg_replace('!^https?://!', '', $base_url), '!mailto' => $account->mail,
'!date' => format_date(time()), '!login_uri' => url('user', NULL, NULL, TRUE),
'!edit_uri' => url('user/'. $account->uid .'/edit', NULL, NULL, TRUE));
// Store the one time login link in an option so the front end can direct the user to their new site.
drush_set_option('login_link', $onetime);
// allow the profile to override welcome email text
if (file_exists("./profiles/$profile/provision_welcome_mail.inc")) {
require_once "./profiles/$profile/provision_welcome_mail.inc";
......
......@@ -89,6 +89,9 @@ function install_send_welcome_mail($url, $account, $profile, $language, $client_
$mail_success = drupal_mail('install', 'welcome-admin', $client_email, user_preferred_language($account), $mail_params, $from, TRUE);
// Store the one time login link in an option so the front end can direct the user to their new site.
drush_set_option('login_link', $onetime);
if ($mail_success) {
drush_log(t('Sent welcome mail to @client', array('@client' => $client_email)), 'message');
}
......
......@@ -37,6 +37,10 @@ function install_send_welcome_mail($url, $profile, $language, $client_email) {
$mail_success = drupal_mail('install', 'welcome-admin', $account->mail, user_preferred_language($account), $mail_params, $from, TRUE);
// Store the one time login link in an option so the front end can direct the user to their new site.
drush_set_option('login_link', $onetime);
if ($mail_success) {
drush_log(t('Sent welcome mail to @client', array('@client' => $client_email)), 'message');
}
......
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