mirror of
https://github.com/e107inc/e107.git
synced 2025-07-26 01:11:28 +02:00
More mailout updated - starting on bounce handling
This commit is contained in:
@@ -9,47 +9,45 @@
|
||||
* Administration - Site Maintenance
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_admin/mailout.php,v $
|
||||
* $Revision: 1.28 $
|
||||
* $Date: 2009-11-23 21:05:50 $
|
||||
* $Revision: 1.29 $
|
||||
* $Date: 2009-11-24 20:40:34 $
|
||||
* $Author: e107steved $
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
TODO:
|
||||
1. Improve maintenance screen
|
||||
2. 'Mail hold' function
|
||||
3. Admin log
|
||||
1. Improve maintenance page
|
||||
2. Bounce handling
|
||||
*/
|
||||
|
||||
/*
|
||||
Features:
|
||||
1. Additional sources of email addresses for mailouts can be provided via plugins
|
||||
1. Additional sources of email addresses for mailouts can be provided via plugins, and can be enabled via the mailout preferences page
|
||||
2. Both list of email recipients and the email are separately stored in the DB using a documented interface (allows alternative creation/mailout routines)
|
||||
- see mail_manager_class.php
|
||||
3. Can specify qmail in the sendmail path
|
||||
|
||||
Interface to add extra mailout (source) handlers - these provide email addresses:
|
||||
1. The handler is called 'e_mailout.php' in the plugin directory.
|
||||
2. Mailout options has a facility to enable the individual handlers
|
||||
3. Certain variables may be defined at load time to determine whether this is exclusive or supplementary
|
||||
4. The class name must be 'mailout_plugin_path'
|
||||
|
||||
|
||||
$pref['mailout_enabled'][plugin_path] - array of flags determining which mailers are active
|
||||
|
||||
*/
|
||||
|
||||
Extra mailout address handlers - these provide email addresses
|
||||
------------------------------
|
||||
1. The handler is called 'e_mailout.php' in the plugin directory.
|
||||
2. Mailout options includes a facility to enable the individual handlers
|
||||
3. Certain variables may be defined at load time to determine whether loading is exclusive or supplementary
|
||||
4. Interface is implemented as a class, which must be called 'plugin_path_mailout'
|
||||
5. see mailout_class.php in the handlers directory for an example (also simpler examples in newsletter and event calendar plugins)
|
||||
|
||||
|
||||
/*
|
||||
All information is stored in two db tables (see mail_manager_class.php)
|
||||
|
||||
Each mailout task is implemented as a class, which must include a number of mandatory entry points:
|
||||
Each mailout task class, must include a number of mandatory entry points:
|
||||
show_select($allow_edit = FALSE) - in edit mode, returns text which facilitates address selection. Otherwise shows the current selection criteria
|
||||
- the display is assigned to a single table cell
|
||||
function returnSelectors() - returns storable representation of user-entered selection criteria
|
||||
select_init() - initialise the selection mechanism
|
||||
select_add() - routine pulls out email addresses etc, for caller to add to the list of addressees
|
||||
select_close() - selection complete
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@@ -73,8 +71,6 @@ Valid actions ($_GET['mode']):
|
||||
|
||||
'resend' - resend failures on a specific list
|
||||
|
||||
'orphans' - data tidy routine
|
||||
|
||||
'debug' - not currently used; may be useful to list other info
|
||||
|
||||
Valid subparameters (where required):
|
||||
@@ -92,10 +88,6 @@ if (!getperms('W'))
|
||||
|
||||
$e_sub_cat = 'mail';
|
||||
|
||||
// TODO: Possibly next two lines not needed any more?
|
||||
//set_time_limit(180);
|
||||
//session_write_close();
|
||||
|
||||
|
||||
|
||||
require_once(e_ADMIN.'auth.php');
|
||||
@@ -103,9 +95,9 @@ require_once(e_HANDLER.'ren_help.php');
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_users.php');
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_mailout.php');
|
||||
require_once(e_HANDLER.'userclass_class.php');
|
||||
require_once(e_HANDLER.'mailout_class.php'); // Class handler for core mailout functions
|
||||
require_once(e_HANDLER.'mailout_admin_class.php'); // Admin tasks handler
|
||||
require_once(e_HANDLER.'mail_manager_class.php'); // Mail DB API
|
||||
require_once(e_HANDLER.'mailout_class.php'); // Class handler for core mailout functions
|
||||
require_once(e_HANDLER.'mailout_admin_class.php'); // Admin tasks handler
|
||||
require_once(e_HANDLER.'mail_manager_class.php'); // Mail DB API
|
||||
require_once (e_HANDLER.'message_handler.php');
|
||||
$emessage = &eMessage :: getInstance();
|
||||
|
||||
@@ -165,7 +157,7 @@ if (isset($_POST['targetaction']))
|
||||
}
|
||||
|
||||
//echo "Action: {$action} MailId: {$mailId} Target: {$targetId}<br />";
|
||||
// ----------------- Actions ----------------------------------------------->
|
||||
// ----------------- Actions ------------------->
|
||||
switch ($action)
|
||||
{
|
||||
case 'prefs' :
|
||||
@@ -280,7 +272,15 @@ switch ($action)
|
||||
break;
|
||||
|
||||
case 'mailhold' :
|
||||
$emessage->add('Mail hold - not implemented yet: '.$mailId, E_MESSAGE_ERROR);
|
||||
$action = 'held';
|
||||
if ($mailAdmin->holdEmail($mailId))
|
||||
{
|
||||
$emessage->add(str_replace('--ID--', $mailId, LAN_MAILOUT_229), E_MESSAGE_SUCCESS);
|
||||
}
|
||||
else
|
||||
{
|
||||
$errors[] = str_replace('--ID--', $mailId, LAN_MAILOUT_230);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'mailcancel' :
|
||||
@@ -298,15 +298,6 @@ switch ($action)
|
||||
case 'maildelete' :
|
||||
break;
|
||||
|
||||
case 'mailtargets' :
|
||||
$action = 'recipients';
|
||||
// Intentional fall-through
|
||||
case 'recipients' :
|
||||
if (isset($_POST['etrigger_ecolumns']))
|
||||
{
|
||||
$mailAdmin->mailbodySaveColumnPref($action);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'marksend' : // Actually do something with an email and list of recipients - entry from email confirm page
|
||||
$action = 'saved';
|
||||
@@ -353,13 +344,11 @@ switch ($action)
|
||||
$emessage->add('Not implemented yet', E_MESSAGE_ERROR);
|
||||
break;
|
||||
|
||||
case 'mailtargets' :
|
||||
$action = 'recipients';
|
||||
// Intentional fall-through
|
||||
case 'recipients' :
|
||||
case 'saved' : // Show template emails - probably no actions
|
||||
if (isset($_POST['etrigger_ecolumns']))
|
||||
{
|
||||
$mailAdmin->mailbodySaveColumnPref($action);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'sent' :
|
||||
case 'pending' :
|
||||
case 'held' :
|
||||
@@ -371,7 +360,7 @@ switch ($action)
|
||||
|
||||
case 'maint' : // Perform any maintenance actions required
|
||||
if (isset($_POST['email_dross']))
|
||||
if ($mailAdmin->dbTidy())
|
||||
if ($mailAdmin->dbTidy()) // Admin logging done in this routine
|
||||
{
|
||||
$emessage->add(LAN_MAILOUT_184, E_MESSAGE_SUCCESS);
|
||||
}
|
||||
@@ -397,6 +386,7 @@ switch ($midAction)
|
||||
// $emessage->add($pageMode.': Would delete here: '.$mailId, E_MESSAGE_SUCCESS);
|
||||
// break; // Delete this
|
||||
$result = $mailAdmin->deleteEmail($mailId, 'all');
|
||||
$admin_log->log_event('MAIL_04','ID: '.$mailId,E_LOG_INFORMATIVE,'');
|
||||
if (($result === FALSE) || !is_array($result))
|
||||
{
|
||||
$errors[] = str_replace('--ID--', $mailId, LAN_MAILOUT_166);
|
||||
@@ -431,6 +421,7 @@ switch ($midAction)
|
||||
if ($mailAdmin->activateEmail($mailId, FALSE))
|
||||
{
|
||||
$emessage->add(LAN_MAILOUT_185, E_MESSAGE_SUCCESS);
|
||||
$admin_log->log_event('MAIL_06','ID: '.$mailId,E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -526,6 +517,7 @@ function saveMailPrefs(&$emessage)
|
||||
{
|
||||
global $pref;
|
||||
$e107 = e107::getInstance();
|
||||
$bounceOpts = array('none' => LAN_MAILOUT_232, 'auto' => LAN_MAILOUT_233, 'mail' => LAN_MAILOUT_234);
|
||||
unset($temp);
|
||||
if (!in_array($_POST['mailer'], array('smtp', 'sendmail', 'php'))) $_POST['mailer'] = 'php';
|
||||
$temp['mailer'] = $_POST['mailer'];
|
||||
@@ -558,7 +550,19 @@ function saveMailPrefs(&$emessage)
|
||||
$temp['mail_pausetime'] = intval($_POST['mail_pausetime']);
|
||||
$temp['mail_workpertick'] = intval($_POST['mail_workpertick']);
|
||||
$temp['mail_workpertick'] = min($temp['mail_workpertick'],1000);
|
||||
$temp['mail_bounce_email'] = $e107->tp->toDB($_POST['mail_bounce_email']);
|
||||
$temp['mail_bounce'] = isset($bounceOpts[$_POST['mail_bounce']]) ? $_POST['mail_bounce'] : 'none';
|
||||
switch ($temp['mail_bounce'])
|
||||
{
|
||||
case 'none' :
|
||||
$temp['mail_bounce_email'] = '';
|
||||
break;
|
||||
case 'auto' :
|
||||
$temp['mail_bounce_email'] = $e107->tp->toDB($_POST['mail_bounce_email2']);
|
||||
break;
|
||||
case 'mail' :
|
||||
$temp['mail_bounce_email'] = $e107->tp->toDB($_POST['mail_bounce_email']);
|
||||
break;
|
||||
}
|
||||
$temp['mail_bounce_pop3'] = $e107->tp->toDB($_POST['mail_bounce_pop3']);
|
||||
$temp['mail_bounce_user'] = $e107->tp->toDB($_POST['mail_bounce_user']);
|
||||
$temp['mail_bounce_pass'] = $e107->tp->toDB($_POST['mail_bounce_pass']);
|
||||
@@ -765,7 +769,7 @@ function show_prefs($mailAdmin)
|
||||
|
||||
$text .= "</table>
|
||||
<fieldset id='core-mail-prefs-bounce'>
|
||||
<legend".($mode ? " class='e-hideme'" : "").">".LAN_MAILOUT_31."</legend>
|
||||
<legend>".LAN_MAILOUT_31."</legend>
|
||||
<table cellpadding='0' cellspacing='0' class='adminedit'>
|
||||
<colgroup span='2'>
|
||||
<col class='col-label' />
|
||||
@@ -773,11 +777,32 @@ function show_prefs($mailAdmin)
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Last Bounce Processed</td><td>".$lastBounceText."</td>
|
||||
</tr>
|
||||
<td>".LAN_MAILOUT_231."</td><td>";
|
||||
|
||||
// bounce divs = mail_bounce_none, mail_bounce_auto, mail_bounce_mail
|
||||
$autoDisp = ($pref['mail_bounce'] != 'auto') ? "style='display:none;'" : "";
|
||||
$autoMail = ($pref['mail_bounce'] != 'mail') ? "style='display:none;'" : "";
|
||||
$bounceOpts = array('none' => LAN_MAILOUT_232, 'auto' => LAN_MAILOUT_233, 'mail' => LAN_MAILOUT_234);
|
||||
$text .= "<select name='mail_bounce' class='tbox' onchange='bouncedisp(this.value)'>\n<option value=''> </option>\n";
|
||||
foreach ($bounceOpts as $k => $v)
|
||||
{
|
||||
$selected = ($pref['mail_bounce'] == $k) ? " selected='selected'" : '';
|
||||
$text .= "<option value='{$k}'{$selected}>{$v}</option>\n";
|
||||
}
|
||||
$text .= "</select>\n</td>
|
||||
</tr></tbody></table>
|
||||
|
||||
|
||||
<table cellpadding='0' cellspacing='0' class='adminedit' id='mail_bounce_auto' {$autoDisp}>
|
||||
<colgroup span='2'>
|
||||
<col class='col-label' />
|
||||
<col class='col-control' />
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr><td>".LAN_MAILOUT_32."</td><td><input class='tbox' size='40' type='text' name='mail_bounce_email2' value=\"".$pref['mail_bounce_email']."\" /></td></tr>
|
||||
|
||||
<tr>
|
||||
<td>Auto-process script</td><td><b>".(e_DOCROOT ? substr(e_DOCROOT, 0, -1) : '/').e_HANDLER_ABS."bounce_handler.php</b>";
|
||||
<td>".LAN_MAILOUT_233."</td><td><b>".(e_DOCROOT ? substr(e_DOCROOT, 0, -1) : '/').e_HANDLER_ABS."bounce_handler.php</b>";
|
||||
|
||||
if(!is_readable(e_HANDLER.'bounce_handler.php'))
|
||||
{
|
||||
@@ -787,10 +812,18 @@ function show_prefs($mailAdmin)
|
||||
{
|
||||
$text .= "<br /><span class='required'>".LAN_MAILOUT_162."</span>";
|
||||
}
|
||||
$text .= "<br /><span class='field-help'>".LAN_MAILOUT_235."</span></td></tr>
|
||||
<tr><td>".LAN_MAILOUT_236."</td><td>".$lastBounceText."</td></tr>
|
||||
</tbody></table>";
|
||||
|
||||
// TODO: Determine type of bounce processing
|
||||
$text .= "</td>
|
||||
</tr>
|
||||
// Parameters for mail-account based bounce processing
|
||||
$text .= "
|
||||
<table cellpadding='0' cellspacing='0' class='adminedit' id='mail_bounce_mail' {$autoMail}>
|
||||
<colgroup span='2'>
|
||||
<col class='col-label' />
|
||||
<col class='col-control' />
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr><td>".LAN_MAILOUT_32."</td><td><input class='tbox' size='40' type='text' name='mail_bounce_email' value=\"".$pref['mail_bounce_email']."\" /></td></tr>
|
||||
<tr><td>".LAN_MAILOUT_33."</td><td><input class='tbox' size='40' type='text' name='mail_bounce_pop3' value=\"".$pref['mail_bounce_pop3']."\" /></td></tr>
|
||||
<tr><td>".LAN_MAILOUT_34."</td><td><input class='tbox' size='40' type='text' name='mail_bounce_user' value=\"".$pref['mail_bounce_user']."\" /></td></tr>
|
||||
@@ -920,6 +953,26 @@ function headerjs()
|
||||
document.getElementById('smtp').style.display = 'none';
|
||||
document.getElementById('sendmail').style.display = 'none';
|
||||
}
|
||||
|
||||
function bouncedisp(type)
|
||||
{
|
||||
if(type == 'auto')
|
||||
{
|
||||
document.getElementById('mail_bounce_auto').style.display = '';
|
||||
document.getElementById('mail_bounce_mail').style.display = 'none';
|
||||
return;
|
||||
}
|
||||
|
||||
if(type =='mail')
|
||||
{
|
||||
document.getElementById('mail_bounce_auto').style.display = 'none';
|
||||
document.getElementById('mail_bounce_mail').style.display = '';
|
||||
return;
|
||||
}
|
||||
|
||||
document.getElementById('mail_bounce_auto').style.display = 'none';
|
||||
document.getElementById('mail_bounce_mail').style.display = 'none';
|
||||
}
|
||||
</script>";
|
||||
|
||||
return $text;
|
||||
|
@@ -98,6 +98,7 @@
|
||||
<core name='loginname_maxlength'>30</core>
|
||||
<core name='longdate'>%A %d %B %Y - %H:%M:%S</core>
|
||||
<core name='mail_pause'>3</core>
|
||||
<core name='mail_bounce'>none</core>
|
||||
<core name='mail_pausetime'>4</core>
|
||||
<core name='mailer'>php</core>
|
||||
<core name='main_wordwrap'></core>
|
||||
|
@@ -85,7 +85,7 @@ class e107Bounce
|
||||
e107::getEvent()->trigger('email-bounce-transient', $the);
|
||||
if($num_attempts > 10)
|
||||
{
|
||||
$this->setUser_Bounced($the['user_email']);
|
||||
$this->setUser_Bounced($the['user_email'], $the['user_id']);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -120,12 +120,18 @@ class e107Bounce
|
||||
|
||||
|
||||
|
||||
function setUser_Bounced($id_or_email)
|
||||
function setUser_Bounced($email, $bounceString = '')
|
||||
{
|
||||
if(!$id_or_email){ return; }
|
||||
if(!$email && !$bounceString){ return; }
|
||||
// echo "Email bounced ID: ".$id_or_email;
|
||||
$query = (is_numeric($id_or_email)) ? "user_ban = 3 WHERE user_id = ".intval($id_or_email)." LIMIT 1" : "user_ban = 3 WHERE user_email = '".$id_or_email."' ";
|
||||
return e107::getDb()->db_Update('user',$query);
|
||||
require_once(e_HANDLER.'mail_manager_class.php');
|
||||
$mailHandler = new e107MailManager();
|
||||
if ($mailManager->markBounce($bounceString, $email))
|
||||
{ // Success
|
||||
}
|
||||
// Failure
|
||||
// $query = (is_numeric($id_or_email)) ? "user_ban = 3 WHERE user_id = ".intval($id_or_email)." LIMIT 1" : "user_ban = 3 WHERE user_email = '".$id_or_email."' ";
|
||||
// return e107::getDb()->db_Update('user',$query);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -9,8 +9,8 @@
|
||||
* e107 Main
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/mail_manager_class.php,v $
|
||||
* $Revision: 1.6 $
|
||||
* $Date: 2009-11-23 21:05:58 $
|
||||
* $Revision: 1.7 $
|
||||
* $Date: 2009-11-24 20:40:34 $
|
||||
* $Author: e107steved $
|
||||
*/
|
||||
|
||||
@@ -581,7 +581,8 @@ class e107MailManager
|
||||
// Set up any extra mailer parameters that need it
|
||||
if (!vartrue($email['e107_header']))
|
||||
{
|
||||
$email['e107_header'] = intval($email['mail_source_id']).'/'.intval($email['mail_target_id']).'/'.md5($email['mail_source_id'].$email['mail_target_id'].$email['mail_recipient_email']); // Set up an ID
|
||||
$temp = intval($email['mail_recipient_id']).'/'.intval($email['mail_source_id']).'/'.intval($email['mail_target_id']).'/';
|
||||
$email['e107_header'] = $temp.md5($temp); // Set up an ID
|
||||
}
|
||||
if (isset($email['mail_attach']) && (trim($email['mail_attach']) || is_array($email['mail_attach'])))
|
||||
{
|
||||
@@ -942,6 +943,131 @@ class e107MailManager
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Put email on hold, including marking all unsent recipient entries
|
||||
* @var integer $handle - as returned by makeEmail()
|
||||
* @return boolean - TRUE on success, FALSE on failure
|
||||
*/
|
||||
public function holdEmail($handle)
|
||||
{
|
||||
if (($handle <= 0) || !is_numeric($handle)) return FALSE;
|
||||
$this->checkDB(1); // Make sure DB object created
|
||||
// Set status of individual emails first, so we can get a count
|
||||
if (FALSE === ($count = $this->db->db_Update('mail_recipients','`mail_status` = '.MAIL_STATUS_HELD.' WHERE `mail_detail_id` = '.intval($handle).' AND `mail_status` >'.MAIL_STATUS_FAILED)))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if ($count == 0) return TRUE; // If zero count, must have held email just as queue being emptied, so don't touch main status
|
||||
|
||||
if (!$this->db->db_Update('mail_content','`mail_content_status` = '.MAIL_STATUS_HELD.' WHERE `mail_source_id` = '.intval($handle)))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Handle a bounce report.
|
||||
* @var string $bounceString - the string from header X-e107-id
|
||||
* @var string $emailAddress - optional email address string for checks
|
||||
* @return boolean - TRUE on success, FALSE on failure
|
||||
*/
|
||||
public function markBounce($bounceString, $emailAddress = '')
|
||||
{
|
||||
$errors = array(); // Log all errors, at least until proven
|
||||
$vals = explode('/',$bounceString); // Should get one or four fields
|
||||
if (!is_numeric($vals[0])) // Email recipient user id number (may be zero)
|
||||
{
|
||||
$errors[] = 'Bad user ID: '.$vals[0];
|
||||
}
|
||||
$uid = intval($vals[0]); // User ID (zero is valid)
|
||||
if (count($vals) == 4)
|
||||
{
|
||||
if (md5($vals[0].'/'.$vals[1].'/'.$vals[2].'/') != $vals[3])
|
||||
{ // 'Extended' ID has md5 validation
|
||||
$errors[] = 'Bad md5';
|
||||
}
|
||||
if (!is_numeric($vals[1])) // Email body record number
|
||||
{
|
||||
$errors[] = 'Bad body record: '.$vals[1];
|
||||
}
|
||||
if (!is_numeric($vals[2])) // Email recipient table record number
|
||||
{
|
||||
$errors[] = 'Bad recipient record: '.$vals[2];
|
||||
}
|
||||
$vals[1] = intval($vals[1]);
|
||||
$vals[2] = intval($vals[2]);
|
||||
if (count($errors) == 0)
|
||||
{ // Look up in mailer DB if no errors so far
|
||||
$this->checkDB(1);
|
||||
if (FALSE === ($this->DB->db_Select_gen(
|
||||
"SELECT mr.`mail_recipient_id`, mr.`mail_recipient_email` FROM `#mail_recipients` AS mr
|
||||
LEFT JOIN `#mail_content` as mc ON mr.`mail_detail_id` = mc.`mail_source_id`
|
||||
WHERE mr.`mail_target_id` = {$vals[2]} AND mc.`mail_source_id` = {$vals[1]}")))
|
||||
{ // Invalid mailer record
|
||||
$errors[] = 'Not found in DB: '.$vals[1].'/'.$vals[2];
|
||||
}
|
||||
$row = $this->db->db_Fetch(MYSQL_ASSOC);
|
||||
if ($emailAddress && ($emailAddress != $row['mail_recipient_email']))
|
||||
{ // Email address mismatch
|
||||
$errors[] = 'Email address mismatch: '.$emailAddress.'/'.$row['mail_recipient_email'];
|
||||
}
|
||||
if ($uid != $row['mail_recipient_id'])
|
||||
{ // User ID mismatch
|
||||
$errors[] = 'User ID mismatch: '.$uid.'/'.$row['mail_recipient_id'];
|
||||
}
|
||||
if (count($errors) == 0)
|
||||
{ // All passed - can update mailout databases
|
||||
$this->db->db_Update('mail_content', '`mail_bounce_count` = `mail_bounce_count` + 1 WHERE `mail_source_id` = '.$vals[1]);
|
||||
$this->db->db_Update('mail_recipients', '`mail_status` = '.MAIL_STATUS_BOUNCED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((count($vals) != 1) && (count($vals) != 4))
|
||||
{
|
||||
$errors[] = 'Bad element count: '.count($vals);
|
||||
}
|
||||
elseif ($uid || $emailAddress)
|
||||
{ // Now log the bounce against the user
|
||||
$this->checkDB(1);
|
||||
$qry = '';
|
||||
if ($uid) { $qry = '`user_id`='.$uid; }
|
||||
if ($emailAddress) { if ($qry) $qry .= ' OR '; $qry .= '`user_email` = '.$emailAddress; }
|
||||
$qry = 'WHERE '.$qry;
|
||||
if (FALSE === $this->db->db_Select('user', 'user_id, user_email', $qry))
|
||||
{
|
||||
$errors[] = 'User not found: '.$uid.'/'.$emailAddress;
|
||||
}
|
||||
else
|
||||
{
|
||||
$row = $this->db->db_Fetch(MYSQL_ASSOC);
|
||||
if ($uid && ($uid != $row['user_id']))
|
||||
{
|
||||
$errors[] = 'UID mismatch: '.$uid.'/'.$row['user_id'];
|
||||
}
|
||||
elseif ($emailAddress && ($emailAddress != $row['user_email']))
|
||||
{
|
||||
$errors[] = 'User email mismatch: '.$emailAddress.'/'.$row['user_email'];
|
||||
}
|
||||
else
|
||||
{ // Valid user!
|
||||
$this->db->db_Update('user', '`user_ban` = 3 WHERE `user_id` = '.$row['user_id'].' LIMIT 1');
|
||||
}
|
||||
}
|
||||
}
|
||||
if (count($errors))
|
||||
{
|
||||
$this->e107->admin_log->e_log_event(10,-1,'BOUNCE','Bounce receive error',$bounceString.'('.$emailAddress.')[!br!]'.implode('[!br!]',$errors),FALSE,LOG_TO_ROLLING);
|
||||
return FALSE;
|
||||
}
|
||||
$this->e107->admin_log->e_log_event(10,-1,'BOUNCE','Bounce received/logged',$bounceString.'('.$emailAddress.')',FALSE,LOG_TO_ROLLING);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Does a query to select one or more emails for which status is required.
|
||||
* @var $start - sets the offset of the first email to return based on the search criteria
|
||||
@@ -1127,8 +1253,8 @@ class e107MailManager
|
||||
global $pref;
|
||||
if ($format == 'textonly')
|
||||
{ // Plain text email - strip bbcodes etc
|
||||
$temp = $this->e107->tp->toHTML($text, TRUE, 'E_BODY_PLAIN'); // Decode bbcodes into HTML, plain text as far as possible etc
|
||||
return stripslashes(strip_tags($temp)); // Have to do strip_tags() again in case bbcode added some
|
||||
$temp = $this->e107->tp->toHTML($text, TRUE, 'E_BODY_PLAIN'); // Decode bbcodes into HTML, plain text as far as possible etc
|
||||
return stripslashes(strip_tags($temp)); // Have to do strip_tags() again in case bbcode added some
|
||||
}
|
||||
|
||||
$consts = $incImages ? ',consts_abs' : 'consts_full'; // If inline images, absolute constants so we can change them
|
||||
@@ -1151,12 +1277,10 @@ class e107MailManager
|
||||
if ($format == 'texttheme')
|
||||
{
|
||||
$message_body .= "<div style='padding:10px;width:97%'><div class='forumheader3'>\n";
|
||||
//$message_body .= $this->e107->tp->toEmail($text)."</div></div></body></html>";
|
||||
$message_body .= $this->e107->tp->toHTML($text, TRUE, 'E_BODY'.$consts)."</div></div></body></html>";
|
||||
}
|
||||
else
|
||||
{
|
||||
//$message_body .= $this->e107->tp->toEmail($text)."</body></html>";
|
||||
$message_body .= $this->e107->tp->toHTML($text, TRUE, 'E_BODY'.$consts)."</body></html>";
|
||||
$message_body = str_replace(""", '"', $message_body);
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
// e107 Language File.
|
||||
// $Id: lan_log_messages.php,v 1.39 2009-11-20 22:23:02 e107steved Exp $
|
||||
// $Id: lan_log_messages.php,v 1.40 2009-11-24 20:40:34 e107steved Exp $
|
||||
|
||||
/*
|
||||
The definitions in this file are for standard 'explanatory' messages which might be entered
|
||||
@@ -340,7 +340,7 @@ define('LAN_AL_MAIL_02', 'Mailshot created');
|
||||
define('LAN_AL_MAIL_03', 'Mail settings updated');
|
||||
define('LAN_AL_MAIL_04', 'Mailshot details deleted');
|
||||
define('LAN_AL_MAIL_05', 'Mail Database tidy');
|
||||
define('LAN_AL_MAIL_06', '');
|
||||
define('LAN_AL_MAIL_06', 'Mailout activated');
|
||||
define('LAN_AL_MAIL_07', '');
|
||||
|
||||
// Plugin Manager
|
||||
|
@@ -9,8 +9,8 @@
|
||||
* Administration - Site Maintenance
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_mailout.php,v $
|
||||
* $Revision: 1.11 $
|
||||
* $Date: 2009-11-20 22:23:02 $
|
||||
* $Revision: 1.12 $
|
||||
* $Date: 2009-11-24 20:40:35 $
|
||||
* $Author: e107steved $
|
||||
*
|
||||
*/
|
||||
@@ -247,8 +247,18 @@ define('LAN_MAILOUT_225', 'Include images in email');
|
||||
define('LAN_MAILOUT_226', '--COUNT-- orphaned recipient records removed');
|
||||
define('LAN_MAILOUT_227', 'Deleted --COUNT-- records from --TABLE--');
|
||||
define('LAN_MAILOUT_228', '--COUNT-- anomalies in mail_content corrected; records: --RECORDS--');
|
||||
define('LAN_MAILOUT_229', '');
|
||||
define('LAN_MAILOUT_230', '');
|
||||
define('LAN_MAILOUT_229', 'Email ID --ID-- put on hold');
|
||||
define('LAN_MAILOUT_230', 'Error holding email with ID --ID--');
|
||||
define('LAN_MAILOUT_231', 'Processing method');
|
||||
define('LAN_MAILOUT_232', 'None');
|
||||
define('LAN_MAILOUT_233', 'Auto-process script');
|
||||
define('LAN_MAILOUT_234', 'Mail account');
|
||||
define('LAN_MAILOUT_235', '(Your server has to be configured to use this script)');
|
||||
define('LAN_MAILOUT_236', 'Last Bounce Processed');
|
||||
define('LAN_MAILOUT_237', '');
|
||||
define('LAN_MAILOUT_238', '');
|
||||
define('LAN_MAILOUT_239', '');
|
||||
define('LAN_MAILOUT_240', '');
|
||||
|
||||
|
||||
define('LAN_SEND', 'Send');
|
||||
|
11
install_.php
11
install_.php
@@ -9,9 +9,9 @@
|
||||
* Installation file
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/install_.php,v $
|
||||
* $Revision: 1.54 $
|
||||
* $Date: 2009-11-18 01:04:24 $
|
||||
* $Author: e107coders $
|
||||
* $Revision: 1.55 $
|
||||
* $Date: 2009-11-24 20:40:35 $
|
||||
* $Author: e107steved $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -1231,6 +1231,7 @@ class e_install
|
||||
$filename = "{$this->e107->e107_dirs['ADMIN_DIRECTORY']}sql/core_sql.php";
|
||||
$fd = fopen ($filename, "r");
|
||||
$sql_data = fread($fd, filesize($filename));
|
||||
$sql_data = preg_replace("#\/\*.*?\*\/#mis", '', $sql_data); // Strip comments
|
||||
fclose ($fd);
|
||||
|
||||
if (!$sql_data)
|
||||
@@ -1248,10 +1249,6 @@ class e_install
|
||||
|
||||
foreach ($result[0] as $sql_table)
|
||||
{
|
||||
// preg_match("/CREATE TABLE\s(.*?)\s\(/si", $sql_table, $match);
|
||||
// $tablename = $match[1];
|
||||
|
||||
// preg_match_all("/create(.*?)myisam;/si", $sql_data, $result );
|
||||
$sql_table = preg_replace("/create table\s/si", "CREATE TABLE {$this->previous_steps['mysql']['prefix']}", $sql_table);
|
||||
|
||||
// Drop existing tables before creating.
|
||||
|
Reference in New Issue
Block a user