| 1 |
<?php |
<?php |
| 2 |
// $Id: node_invite.install,v 1.9 2009/09/01 19:00:13 hadsie Exp $ |
// $Id: node_invite.install,v 1.9.2.1 2009/09/02 05:43:38 hadsie Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 141 |
return $ret; |
return $ret; |
| 142 |
} |
} |
| 143 |
|
|
| 144 |
|
/** |
| 145 |
|
* Add the hash column and populate it. |
| 146 |
|
*/ |
| 147 |
|
function node_invite_update_6003() { |
| 148 |
|
$ret = array(); |
| 149 |
|
db_add_field($ret, 'node_invites', 'hash', |
| 150 |
|
array( |
| 151 |
|
'description' => t('A unique hash associated with each invite'), |
| 152 |
|
'type' => 'varchar', |
| 153 |
|
'length' => 255, |
| 154 |
|
'default' => '', |
| 155 |
|
) |
| 156 |
|
); |
| 157 |
|
|
| 158 |
|
// Now that we have the new column... populate it. |
| 159 |
|
$hashes = array(); |
| 160 |
|
$invites = db_query('SELECT iid, email_invitee, sent FROM {node_invites}'); |
| 161 |
|
while ($invite = db_fetch_object($invites)) { |
| 162 |
|
$hash = md5($invite->email_invitee . $invite->sent); |
| 163 |
|
$ret[] = update_sql( |
| 164 |
|
"UPDATE {node_invites} SET hash = '$hash' WHERE iid = $invite->iid"); |
| 165 |
|
} |
| 166 |
|
|
| 167 |
|
return $ret; |
| 168 |
|
} |
| 169 |
|
|
| 170 |
function node_invite_uninstall() { |
function node_invite_uninstall() { |
| 171 |
drupal_uninstall_schema('node_invite'); |
drupal_uninstall_schema('node_invite'); |
| 172 |
variable_del('node_invite_node_types'); |
variable_del('node_invite_node_types'); |