| 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 |
| 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 |
|
|
| 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); |
| 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': |
| 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 |
} |
} |