| 1 |
<?php
|
| 2 |
// $Id: inactive_user.install,v 1.1.4.1 2008/05/19 16:21:27 deekayen Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
* The inactive user module controls inactive users.
|
| 7 |
*
|
| 8 |
* The inactive user module sends mails to inactive users.
|
| 9 |
* The user can configure the time after Drupal sends mails.
|
| 10 |
*/
|
| 11 |
|
| 12 |
/**
|
| 13 |
* Implementation of hook_install().
|
| 14 |
*/
|
| 15 |
function inactive_user_install() {
|
| 16 |
drupal_install_schema('inactive_user');
|
| 17 |
}
|
| 18 |
|
| 19 |
function inactive_user_schema() {
|
| 20 |
$schema['inactive_users'] = array(
|
| 21 |
'description' => t('The base table for inactive_users.'),
|
| 22 |
'fields' => array(
|
| 23 |
'uid' => array(
|
| 24 |
'description' => t('The primary identifier for a user.'),
|
| 25 |
'type' => 'int',
|
| 26 |
'unsigned' => TRUE,
|
| 27 |
'not null' => TRUE,
|
| 28 |
'default' => 0),
|
| 29 |
'notified_admin' => array(
|
| 30 |
'description' => t('Admin notifier.'),
|
| 31 |
'type' => 'int',
|
| 32 |
'size' => 'tiny',
|
| 33 |
'unsigned' => TRUE,
|
| 34 |
'not null' => TRUE,
|
| 35 |
'default' => 0),
|
| 36 |
'notified_user' => array(
|
| 37 |
'description' => t('User notifier.'),
|
| 38 |
'type' => 'int',
|
| 39 |
'size' => 'tiny',
|
| 40 |
'unsigned' => TRUE,
|
| 41 |
'not null' => TRUE,
|
| 42 |
'default' => 0),
|
| 43 |
'warned_user_block_timestamp' => array(
|
| 44 |
'description' => t('Timestamp warning.'),
|
| 45 |
'type' => 'int',
|
| 46 |
'unsigned' => TRUE,
|
| 47 |
'not null' => TRUE,
|
| 48 |
'default' => 0),
|
| 49 |
'notified_user_block' => array(
|
| 50 |
'description' => t('User block warning.'),
|
| 51 |
'type' => 'int',
|
| 52 |
'size' => 'tiny',
|
| 53 |
'unsigned' => TRUE,
|
| 54 |
'not null' => TRUE,
|
| 55 |
'default' => 0),
|
| 56 |
'notified_admin_block' => array(
|
| 57 |
'description' => t('Timestamp warning.'),
|
| 58 |
'type' => 'int',
|
| 59 |
'size' => 'tiny',
|
| 60 |
'unsigned' => TRUE,
|
| 61 |
'not null' => TRUE,
|
| 62 |
'default' => 0),
|
| 63 |
'warned_user_delete_timestamp' => array(
|
| 64 |
'description' => t('Timestamp warning.'),
|
| 65 |
'type' => 'int',
|
| 66 |
'unsigned' => TRUE,
|
| 67 |
'not null' => TRUE,
|
| 68 |
'default' => 0),
|
| 69 |
'protected' => array(
|
| 70 |
'description' => t('Timestamp warning.'),
|
| 71 |
'type' => 'int',
|
| 72 |
'size' => 'tiny',
|
| 73 |
'unsigned' => TRUE,
|
| 74 |
'not null' => TRUE,
|
| 75 |
'default' => 0),
|
| 76 |
),
|
| 77 |
'primary key' => array('uid'),
|
| 78 |
);
|
| 79 |
return $schema;
|
| 80 |
}
|
| 81 |
|
| 82 |
/**
|
| 83 |
* Implementation of hook_uninstall().
|
| 84 |
*/
|
| 85 |
function inactive_user_uninstall() {
|
| 86 |
drupal_uninstall_schema('inactive_user');
|
| 87 |
variable_del('inactive_user_admin_email');
|
| 88 |
variable_del('inactive_user_auto_block');
|
| 89 |
variable_del('inactive_user_auto_block_warn');
|
| 90 |
variable_del('inactive_user_auto_delete');
|
| 91 |
variable_del('inactive_user_auto_delete_warn');
|
| 92 |
variable_del('inactive_user_block_notify_text');
|
| 93 |
variable_del('inactive_user_block_warn_text');
|
| 94 |
variable_del('inactive_user_delete_notify_text');
|
| 95 |
variable_del('inactive_user_delete_warn_text');
|
| 96 |
variable_del('inactive_user_notify');
|
| 97 |
variable_del('inactive_user_notify_admin');
|
| 98 |
variable_del('inactive_user_notify_block');
|
| 99 |
variable_del('inactive_user_notify_block_admin');
|
| 100 |
variable_del('inactive_user_notify_delete');
|
| 101 |
variable_del('inactive_user_notify_delete_admin');
|
| 102 |
variable_del('inactive_user_notify_text');
|
| 103 |
variable_del('inactive_user_preserve_content');
|
| 104 |
variable_del('inactive_user_timestamp');
|
| 105 |
$settings = db_query("SELECT name FROM {variable} WHERE name LIKE 'inactive_user_%'");
|
| 106 |
while ($row = db_fetch_object($settings)) {
|
| 107 |
variable_del($row->name);
|
| 108 |
}
|
| 109 |
drupal_set_message(t('Inactive user has been uninstalled.'));
|
| 110 |
}
|