/[drupal]/contributions/modules/mlm/backend/mlm_ezmlm_idx.inc
ViewVC logotype

Diff of /contributions/modules/mlm/backend/mlm_ezmlm_idx.inc

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

revision 1.3, Mon Aug 10 01:09:32 2009 UTC revision 1.4, Sun Aug 23 23:06:28 2009 UTC
# Line 1  Line 1 
1  <?php // $Id: mlm_ezmlm_idx.inc,v 1.2 2009/07/17 01:21:07 vauxia Exp $  <?php // $Id: mlm_ezmlm_idx.inc,v 1.3 2009/08/10 01:09:32 vauxia Exp $
2    
3  /**  /**
4   * @file   * @file
# Line 17  class mlm_ezmlm_idx extends mlm_ezmlm { Line 17  class mlm_ezmlm_idx extends mlm_ezmlm {
17      $edit_form['troot'] = array(      $edit_form['troot'] = array(
18        '#type'          => 'textfield',        '#type'          => 'textfield',
19        '#title'         => t('Table Prefix'),        '#title'         => t('Table Prefix'),
20        '#default_value' => $this->settings['troot'],        '#default_value' => $this->settings('troot'),
21        '#description'   => t('Each list has a table prefix in the database to keep its data separate from other lists.  Enter the prefix that corresponds to the list\'s e-mail address.'),        '#description'   => t('Each list has a table prefix in the database to keep its data separate from other lists.  Enter the prefix that corresponds to the list\'s e-mail address.'),
22      );      );
23      $edit_form['key'] = array(      $edit_form['key'] = array(
24        '#type'          => 'textfield',        '#type'          => 'textfield',
25        '#title'         => t('List Key'),        '#title'         => t('List Key'),
26        '#default_value' => $this->settings['key'],        '#default_value' => $this->settings('key'),
27        '#description'   => t('Required if using automatic posting.  Otherwise, you can safely ignore this'),        '#description'   => t('Required if using automatic posting.  Otherwise, you can safely ignore this'),
28      );      );
29    
# Line 166  class mlm_ezmlm_idx extends mlm_ezmlm { Line 166  class mlm_ezmlm_idx extends mlm_ezmlm {
166    }    }
167    
168    function post($message, $account = NULL) {    function post($message, $account = NULL) {
169      $address = $this->settings['address'];      $address = $this->settings('address');
170      if ($this->autopost) {      if ($this->autopost) {
171        global $base_url;        global $base_url;
172        $table   = $this->_table('post');        $table   = $this->_table('post');
173        $key     = $this->settings['key'];        $key     = $this->settings('key');
174        $created = time();        $created = time();
175        $hash    = sha1($id . $subject . $created . $key);        $hash    = sha1($id . $subject . $created . $key);
176        $address = str_replace('@', "-autopost-{$hash}@", $address);        $address = str_replace('@', "-autopost-{$hash}@", $address);
# Line 185  class mlm_ezmlm_idx extends mlm_ezmlm { Line 185  class mlm_ezmlm_idx extends mlm_ezmlm {
185    }    }
186    
187    function _table($type = 'subscriber') {    function _table($type = 'subscriber') {
188      $troot = $this->settings['troot'];      $troot = $this->settings('troot');
189      switch ( $type ) {      switch ( $type ) {
190    
191        case 'subscriber':        case 'subscriber':
# Line 212  class mlm_ezmlm_idx extends mlm_ezmlm { Line 212  class mlm_ezmlm_idx extends mlm_ezmlm {
212      }      }
213    }    }
214    function _db($active = FALSE) {    function _db($active = FALSE) {
215      $db = $active ? $this->settings['dsn'] : NULL;      $db = $active ? $this->settings('dsn') : NULL;
216      db_set_active($db);      db_set_active($db);
217    }    }
218  }  }

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.2