/[drupal]/contributions/modules/node_invite/node_invite.install
ViewVC logotype

Diff of /contributions/modules/node_invite/node_invite.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.9.2.1, Wed Sep 2 05:43:38 2009 UTC revision 1.9.2.2, Thu Sep 3 00:17:30 2009 UTC
# Line 1  Line 1 
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
# Line 141  function node_invite_update_6002() { Line 141  function node_invite_update_6002() {
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');

Legend:
Removed from v.1.9.2.1  
changed lines
  Added in v.1.9.2.2

  ViewVC Help
Powered by ViewVC 1.1.2