| 1 |
<?php
|
| 2 |
/**
|
| 3 |
* @file
|
| 4 |
* Provision hooks for the provision login_reset command.
|
| 5 |
*/
|
| 6 |
|
| 7 |
/**
|
| 8 |
* Provision login_reset command
|
| 9 |
*
|
| 10 |
* These are the hooks that will be executed by the drush_invoke function
|
| 11 |
* when generating a one-time login reset URL.
|
| 12 |
*/
|
| 13 |
|
| 14 |
/**
|
| 15 |
* Generate a one-time login reset url
|
| 16 |
*/
|
| 17 |
function drush_provision_drupal_provision_login_reset($url) {
|
| 18 |
drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_FULL);
|
| 19 |
$account = user_load(1);
|
| 20 |
$onetime = user_pass_reset_url($account);
|
| 21 |
// pass the login link to the front end
|
| 22 |
drush_set_option('login_link', $onetime);
|
| 23 |
drush_log(t('Login url: !onetime', array('!onetime' => $onetime)), 'message');
|
| 24 |
sess_destroy_uid(1);
|
| 25 |
}
|