| 1 |
<?php |
<?php |
| 2 |
// $Id: logintoboggan.module,v 1.169 2009/10/20 22:10:04 thehunmonkgroup Exp $ |
// $Id: logintoboggan.module,v 1.170 2009/10/21 18:11:47 thehunmonkgroup Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 23 |
*/ |
*/ |
| 24 |
|
|
| 25 |
/** |
/** |
| 26 |
* Implementation of hook_cron(). |
* Implement hook_cron(). |
| 27 |
*/ |
*/ |
| 28 |
function logintoboggan_cron() { |
function logintoboggan_cron() { |
| 29 |
// If set password is enabled, and a purge interval is set, check for |
// If set password is enabled, and a purge interval is set, check for |
| 42 |
$purged_users = array(); |
$purged_users = array(); |
| 43 |
// Delete the users from the system. |
// Delete the users from the system. |
| 44 |
foreach ($accounts as $account) { |
foreach ($accounts as $account) { |
| 45 |
user_delete(array(), $account->uid); |
user_cancel(array(), $account->uid, 'user_cancel_delete'); |
| 46 |
$purged_users[] = check_plain($account->name); |
$purged_users[] = check_plain($account->name); |
| 47 |
} |
} |
| 48 |
|
|
| 49 |
// Log the purged users. |
// Log the purged users. |
| 50 |
if (!empty($purged_users)) { |
if (!empty($purged_users)) { |
| 51 |
watchdog('logintoboggan', 'Purged the following unvalidated users: !purged_users', array('!purged_users' => theme('item_list', $purged_users))); |
batch_process(drupal_get_destination()); |
| 52 |
|
watchdog('logintoboggan', 'Purged the following unvalidated users: !purged_users', array('!purged_users' => theme('item_list', array('items' => $purged_users)))); |
| 53 |
} |
} |
| 54 |
} |
} |
| 55 |
} |
} |
| 56 |
} |
} |
| 57 |
|
|
| 58 |
/** |
/** |
| 59 |
* Implementation of hook_help(). |
* Implement hook_help(). |
| 60 |
*/ |
*/ |
| 61 |
function logintoboggan_help($path, $arg) { |
function logintoboggan_help($path, $arg) { |
| 62 |
switch ($path) { |
switch ($path) { |
| 664 |
} |
} |
| 665 |
|
|
| 666 |
/** |
/** |
| 667 |
* Implementation of hook_init() |
* Implement hook_init() |
| 668 |
* |
* |
| 669 |
* @ingroup logintoboggan_core |
* @ingroup logintoboggan_core |
| 670 |
*/ |
*/ |
| 703 |
} |
} |
| 704 |
|
|
| 705 |
/** |
/** |
| 706 |
* Implementation of hook_menu() |
* Implement hook_menu() |
| 707 |
* |
* |
| 708 |
* @ingroup logintoboggan_core |
* @ingroup logintoboggan_core |
| 709 |
*/ |
*/ |
| 1355 |
} |
} |
| 1356 |
|
|
| 1357 |
/** |
/** |
| 1358 |
* Implementation of hook_mail_alter(). |
* Implement hook_mail_alter(). |
| 1359 |
*/ |
*/ |
| 1360 |
function logintoboggan_mail_alter(&$message) { |
function logintoboggan_mail_alter(&$message) { |
| 1361 |
if ($message['id'] == 'user_register_pending_approval_admin') { |
if ($message['id'] == 'user_register_pending_approval_admin') { |