Commit e28a76e6 authored by Adrian Rossouw's avatar Adrian Rossouw Committed by adrian

#567094 - reset password task

parent 3a87c2e8
<?php
/**
* @file
* Provision hooks for the provision login_reset command.
*/
/**
* Provision login_reset command
*
* These are the hooks that will be executed by the drush_invoke function
* when generating a one-time login reset URL.
*/
/**
* Generate a one-time login reset url
*/
function drush_provision_drupal_provision_login_reset($url) {
drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_FULL);
$account = user_load(1);
$onetime = user_pass_reset_url($account);
// pass the login link to the front end
drush_set_option('login_link', $onetime);
drush_log(t('Login url: !onetime', array('!onetime' => $onetime)), 'message');
sess_destroy_uid(1);
}
......@@ -29,6 +29,8 @@
* Uses hook_provision_pre_upgrade(), hook_provision_upgrade() and hook_provision_post_upgrade() hooks,
* and allows clean roll back if any errors occur. Will include stringent checking of module versions,
* and allow unit tests to be run.
* login_reset - Generate a one-time login reset URL.
*
* Not implemented yet :
* rename - Change the url of a site. This requires moving of files, and numerous other issues.
*/
......@@ -121,6 +123,12 @@ function provision_drush_command() {
'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_ROOT
);
$items['provision login_reset'] = array(
'description' => 'Generate a one-time login reset URL.',
'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_ROOT
);
$items['hostmaster migrate'] = array(
'description' => dt('Migrate an instance of the Hostmaster front end to a new platform'),
'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_ROOT,
......
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