| 1 |
<?php
|
| 2 |
// $Id: invite_cancel_account.module,v 1.1.2.1.2.1 2008/03/04 20:49:20 smk Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
* Allows your users to terminate user accounts by withdrawing their
|
| 7 |
* invitation.
|
| 8 |
*/
|
| 9 |
|
| 10 |
/**
|
| 11 |
* Implementation of hook_invite().
|
| 12 |
*
|
| 13 |
* Withdrawing an invitation leads to termination of invited user's account.
|
| 14 |
*/
|
| 15 |
function invite_cancel_account_invite($op, $args) {
|
| 16 |
switch ($op) {
|
| 17 |
case 'cancel':
|
| 18 |
if (user_access('withdraw accepted invitations')) {
|
| 19 |
if ($account = user_load(array('mail' => $args['email']))) {
|
| 20 |
user_delete(array(), $account->uid);
|
| 21 |
}
|
| 22 |
}
|
| 23 |
break;
|
| 24 |
}
|
| 25 |
}
|
| 26 |
|