|
From: FlorinCB <ory...@us...> - 2008-10-04 07:45:04
|
Update of /cvsroot/mxbb/mx_contact/includes In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv31768/includes Modified Files: contact_constants.php contact_emailer.php contact_extend.php Log Message: upgrade Index: contact_emailer.php =================================================================== RCS file: /cvsroot/mxbb/mx_contact/includes/contact_emailer.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** contact_emailer.php 12 Dec 2007 18:41:43 -0000 1.1 --- contact_emailer.php 4 Oct 2008 07:44:53 -0000 1.2 *************** *** 32,35 **** --- 32,36 ---- var $tpl_msg = array(); + var $use_html = false; function emailer($use_smtp) *************** *** 37,40 **** --- 38,42 ---- $this->reset(); $this->use_smtp = $use_smtp; + $this->use_html = false; $this->reply_to = $this->from = ''; } *************** *** 84,87 **** --- 86,102 ---- $this->extra_headers .= trim($headers) . "\n"; } + + function set_mail_priority($priority = MAIL_NORMAL_PRIORITY) + { + $this->mail_priority = $priority; + } + + /** + * Set the email html + */ + function set_mail_html($html = false) + { + $this->use_html = $html; + } function use_template($template_file, $template_lang = '') *************** *** 103,111 **** $tpl_file = $module_root_path . 'language/lang_' . $template_lang . '/email/' . $template_file . '.tpl'; ! if (!@file_exists(@phpbb_realpath($tpl_file))) { $tpl_file = $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/email/' . $template_file . '.tpl'; ! if (!@file_exists(@phpbb_realpath($tpl_file))) { mx_message_die(GENERAL_ERROR, 'Could not find email template file :: ' . $template_file . ' @:' . $tpl_file, '', __LINE__, __FILE__); --- 118,126 ---- $tpl_file = $module_root_path . 'language/lang_' . $template_lang . '/email/' . $template_file . '.tpl'; ! if (!file_exists(realpath($tpl_file))) { $tpl_file = $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/email/' . $template_file . '.tpl'; ! if (!file_exists(realpath($tpl_file))) { mx_message_die(GENERAL_ERROR, 'Could not find email template file :: ' . $template_file . ' @:' . $tpl_file, '', __LINE__, __FILE__); *************** *** 136,140 **** function send() { ! global $board_config, $lang, $phpEx, $phpbb_root_path, $db; // Escape all quotes, else the eval will fail. --- 151,155 ---- function send() { ! global $board_config, $lang, $phpEx, $phpbb_root_path, $db, $module_root_path; // Escape all quotes, else the eval will fail. *************** *** 193,198 **** // Build header ! $this->extra_headers = (($this->reply_to != '') ? "Reply-to: $this->reply_to\n" : '') . (($this->from != '') ? "From: $this->from\n" : "From: " . $board_config['board_email'] . "\n") . "Return-Path: " . $board_config['board_email'] . "\nMessage-ID: <" . md5(uniqid(time())) . "@" . $board_config['server_name'] . ">\nMIME-Version: 1.0\nContent-type: text/plain; charset=" . $this->encoding . "\nContent-transfer-encoding: 8bit\nDate: " . date('r', time()) . "\nX-Priority: 3\nX-MSMail-Priority: Normal\nX-Mailer: PHP\nX-MimeOLE: Produced By phpBB2\n" . $this->extra_headers . (($cc != '') ? "Cc: $cc\n" : '') . (($bcc != '') ? "Bcc: $bcc\n" : ''); ! // Send message ... removed $this->encode() from subject for time being if ( $this->use_smtp ) --- 208,220 ---- // Build header ! if ($this->use_html) ! { ! $this->extra_headers = (($this->reply_to != '') ? "Reply-to: $this->reply_to\n" : '') . (($this->from != '') ? "From: $this->from\n" : "From: " . $board_config['board_email'] . "\n") . "Return-Path: " . $board_config['board_email'] . "\nMessage-ID: <" . md5(uniqid(time())) . "@" . $board_config['server_name'] . ">\nMIME-Version: 1.0\nContent-type: text/html; charset=" . $this->encoding . "\nContent-transfer-encoding: 8bit\nDate: " . date('r', time()) . "\nX-Priority: 3\nX-MSMail-Priority: Normal\nX-Mailer: PHP\nX-MimeOLE: Produced By Mx-Publisher\n" . $this->extra_headers . (($cc != '') ? "Cc: $cc\n" : '') . (($bcc != '') ? "Bcc: $bcc\n" : ''); ! } ! else ! { ! $this->extra_headers = (($this->reply_to != '') ? "Reply-to: $this->reply_to\n" : '') . (($this->from != '') ? "From: $this->from\n" : "From: " . $board_config['board_email'] . "\n") . "Return-Path: " . $board_config['board_email'] . "\nMessage-ID: <" . md5(uniqid(time())) . "@" . $board_config['server_name'] . ">\nMIME-Version: 1.0\nContent-type: text/plain; charset=" . $this->encoding . "\nContent-transfer-encoding: 8bit\nDate: " . date('r', time()) . "\nX-Priority: 3\nX-MSMail-Priority: Normal\nX-Mailer: PHP\nX-MimeOLE: Produced By Mx-Publisher\n" . $this->extra_headers . (($cc != '') ? "Cc: $cc\n" : '') . (($bcc != '') ? "Bcc: $bcc\n" : ''); ! } ! // Send message ... removed $this->encode() from subject for time being if ( $this->use_smtp ) *************** *** 200,204 **** if ( !defined('SMTP_INCLUDED') ) { ! include($phpbb_root_path . 'includes/smtp.' . $phpEx); } --- 222,226 ---- if ( !defined('SMTP_INCLUDED') ) { ! include($module_root_path . 'includes/contact_smtp.' . $phpEx); } *************** *** 210,229 **** $to = ($to == '') ? (($board_config['sendmail_fix']) ? ' ' : 'Undisclosed-recipients:;') : $to; ! $result = @mail($to, $this->subject, preg_replace("#(?<!\r)\n#s", "\n", $this->msg), $this->extra_headers); if (!$result && !$board_config['sendmail_fix'] && $empty_to_header) { $to = ' '; ! ! $sql = "UPDATE " . CONFIG_TABLE . " ! SET config_value = '1' ! WHERE config_name = 'sendmail_fix'"; ! if (!$db->sql_query($sql)) { ! mx_message_die(GENERAL_ERROR, 'Unable to update config table', '', __LINE__, __FILE__, $sql); ! } $board_config['sendmail_fix'] = 1; ! $result = @mail($to, $this->subject, preg_replace("#(?<!\r)\n#s", "\n", $this->msg), $this->extra_headers); } } --- 232,266 ---- $to = ($to == '') ? (($board_config['sendmail_fix']) ? ' ' : 'Undisclosed-recipients:;') : $to; ! $result = mail($to, $this->subject, preg_replace("#(?<!\r)\n#s", "\n", $this->msg), $this->extra_headers); if (!$result && !$board_config['sendmail_fix'] && $empty_to_header) { $to = ' '; ! ! switch (PORTAL_BACKEND) { ! case 'phpbb2': ! ! $sql = "UPDATE " . CONFIG_TABLE . " ! SET config_value = '1' ! WHERE config_name = 'sendmail_fix'"; ! if (!$db->sql_query($sql)) ! { ! mx_message_die(GENERAL_ERROR, 'Unable to update config table', '', __LINE__, __FILE__, $sql); ! } ! break; ! ! case 'internal': ! case 'phpbb3': ! ! if (!$board_config['board_email']) ! { ! mx_message_die(GENERAL_ERROR, 'The is no default email adress configured were to notify the admin.', '', __LINE__, __FILE__, ''); ! } ! break; ! } $board_config['sendmail_fix'] = 1; ! $result = mail($to, $this->subject, preg_replace("#(?<!\r)\n#s", "\n", $this->msg), $this->extra_headers); } } *************** *** 358,362 **** function encode_file($sourcefile) { ! if (is_readable(phpbb_realpath($sourcefile))) { $fd = fopen($sourcefile, "r"); --- 395,399 ---- function encode_file($sourcefile) { ! if (is_readable(realpath($sourcefile))) { $fd = fopen($sourcefile, "r"); Index: contact_extend.php =================================================================== RCS file: /cvsroot/mxbb/mx_contact/includes/contact_extend.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** contact_extend.php 12 Dec 2007 18:41:43 -0000 1.1 --- contact_extend.php 4 Oct 2008 07:44:53 -0000 1.2 *************** *** 77,81 **** else { ! if($row['sent'] >= 3) { mx_message_die(GENERAL_ERROR, $lang['Thankyou_limit']); --- 77,81 ---- else { ! if(($row['sent'] >= 3) && !($userdata['user_level'] == ADMIN)) { mx_message_die(GENERAL_ERROR, $lang['Thankyou_limit']); *************** *** 103,107 **** $email_headers .= 'X-AntiAbuse: User ID - ' . $userdata['user_id'] . "\n"; $email_headers .= 'X-AntiAbuse: Username - ' . $userdata['username'] . "\n"; ! $email_headers .= 'X-AntiAbuse: User IP - ' . decode_ip($user_ip) . "\n"; empty($email) ? $emailer->email_address() : $emailer->email_address($email); --- 103,107 ---- $email_headers .= 'X-AntiAbuse: User ID - ' . $userdata['user_id'] . "\n"; $email_headers .= 'X-AntiAbuse: Username - ' . $userdata['username'] . "\n"; ! $email_headers .= 'X-AntiAbuse: User IP - ' . contact_decode_ip($user_ip) . "\n"; empty($email) ? $emailer->email_address() : $emailer->email_address($email); *************** *** 117,121 **** 'COMMENTS' => $comments, ! 'USER_IP' => decode_ip($user_ip), 'TIMEDATE' => $timedate, 'SITENAME' => $board_config['sitename']) --- 117,121 ---- 'COMMENTS' => $comments, ! 'USER_IP' => contact_decode_ip($user_ip), 'TIMEDATE' => $timedate, 'SITENAME' => $board_config['sitename']) Index: contact_constants.php =================================================================== RCS file: /cvsroot/mxbb/mx_contact/includes/contact_constants.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** contact_constants.php 12 Dec 2007 18:41:43 -0000 1.1 --- contact_constants.php 4 Oct 2008 07:44:53 -0000 1.2 *************** *** 23,30 **** --- 23,48 ---- $mx_user->extend(MX_LANG_MAIN, MX_IMAGES_NONE); + // ********************************************************************** + // Read language definition + // ********************************************************************** + + if ( !file_exists($module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx) ) + { + include($module_root_path . 'language/lang_english/lang_main.' . $phpEx ); + } + else + { + include($module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx); + } + define('CONTACT_TABLE', $mx_table_prefix . 'contact'); define('CONTACT_CONFIG_TABLE', $mx_table_prefix . 'contact_config'); define('CONTACT_MSGS_TABLE', $mx_table_prefix . 'contact_msgs'); define('CONTACT_EMAILS_TABLE', $mx_table_prefix . 'contact_emails'); + define('CONTACT_MASS_TABLE', $mx_table_prefix . 'contact_mass_news'); + // Email Priority Settings + @define('MAIL_LOW_PRIORITY', 4); + @define('MAIL_NORMAL_PRIORITY', 3); + @define('MAIL_HIGH_PRIORITY', 2); ?> \ No newline at end of file |