mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 21:27:25 +02:00
Signup - use new mailer. Plus a few details
This commit is contained in:
@@ -9,9 +9,9 @@
|
|||||||
* Administration - Site Maintenance
|
* Administration - Site Maintenance
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_admin/mailout.php,v $
|
* $Source: /cvs_backup/e107_0.8/e107_admin/mailout.php,v $
|
||||||
* $Revision: 1.26 $
|
* $Revision: 1.27 $
|
||||||
* $Date: 2009-11-18 01:04:26 $
|
* $Date: 2009-11-18 20:45:18 $
|
||||||
* $Author: e107coders $
|
* $Author: e107steved $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -737,12 +737,12 @@ function show_prefs($mailAdmin)
|
|||||||
{ // Allow selection of email address sources
|
{ // Allow selection of email address sources
|
||||||
$text .= "<tr>
|
$text .= "<tr>
|
||||||
<td>".LAN_MAILOUT_77."</td>
|
<td>".LAN_MAILOUT_77."</td>
|
||||||
<td style='text-align:right'>
|
<td>
|
||||||
";
|
";
|
||||||
$mail_enable = explode(',',$pref['mailout_enabled']);
|
$mail_enable = explode(',',$pref['mailout_enabled']);
|
||||||
foreach ($pref['e_mailout_list'] as $mailer => $v) {
|
foreach ($pref['e_mailout_list'] as $mailer => $v) {
|
||||||
$check = (in_array($mailer,$mail_enable)) ? "checked='checked'" : "";
|
$check = (in_array($mailer,$mail_enable)) ? "checked='checked'" : "";
|
||||||
$text .= $mailer." <input type='checkbox' name='mail_mailer_enabled[]' value='{$mailer}' {$check} /><br />";
|
$text .= " <input type='checkbox' name='mail_mailer_enabled[]' value='{$mailer}' {$check} /> {$mailer}<br />";
|
||||||
}
|
}
|
||||||
$text .= "</td></tr>\n";
|
$text .= "</td></tr>\n";
|
||||||
}
|
}
|
||||||
|
@@ -9,13 +9,15 @@
|
|||||||
* e107 Main
|
* e107 Main
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/e107_class.php,v $
|
* $Source: /cvs_backup/e107_0.8/e107_handlers/e107_class.php,v $
|
||||||
* $Revision: 1.73 $
|
* $Revision: 1.74 $
|
||||||
* $Date: 2009-11-18 01:04:43 $
|
* $Date: 2009-11-18 20:45:18 $
|
||||||
* $Author: e107coders $
|
* $Author: e107steved $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
|
|
||||||
|
define('LOCALHOST_IP', '0000:0000:0000:0000:0000:ffff:7f00:0001'); // IPV6 string for localhost - as stored in DB
|
||||||
/**
|
/**
|
||||||
* e107 class
|
* e107 class
|
||||||
*
|
*
|
||||||
|
@@ -6,37 +6,45 @@
|
|||||||
* Released under the terms and conditions of the
|
* Released under the terms and conditions of the
|
||||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||||
*
|
*
|
||||||
*
|
* Template for signup emails
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_themes/templates/email_template.php,v $
|
* $Source: /cvs_backup/e107_0.8/e107_themes/templates/email_template.php,v $
|
||||||
* $Revision: 1.9 $
|
* $Revision: 1.10 $
|
||||||
* $Date: 2009-11-18 01:06:08 $
|
* $Date: 2009-11-18 20:45:19 $
|
||||||
* $Author: e107coders $
|
* $Author: e107steved $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
global $pref;
|
global $pref;
|
||||||
$SIGNUPEMAIL_SUBJECT = LAN_SIGNUP_96." {SITENAME}";
|
$SIGNUPEMAIL_SUBJECT = LAN_SIGNUP_96.' {SITENAME}';
|
||||||
$SIGNUPEMAIL_USETHEME = 1; // Use CSS STYLE from THEME: 0 = Off, 1 = external, 2 = embedded
|
$SIGNUPEMAIL_USETHEME = 1; // Use CSS STYLE from THEME: 0 = Off, 1 = external, 2 = embedded
|
||||||
$SIGNUPEMAIL_LINKSTYLE = ""; // css to use on links eg. color:red;
|
$SIGNUPEMAIL_LINKSTYLE = ''; // css to use on links eg. color:red;
|
||||||
$SIGNUPEMAIL_IMAGES = e_IMAGE.$pref['sitebutton']; // comma separated paths to image to embed. referenced below with {IMAGE1} (IMAGE2} etc.
|
//$SIGNUPEMAIL_IMAGES = e_IMAGE.$pref['sitebutton']; // comma separated paths to image to embed. referenced below with {IMAGE1} (IMAGE2} etc. Not required
|
||||||
$SIGNUPEMAIL_CC = ""; // comma separated email addresses to put in CC of the signup email.
|
$SIGNUPEMAIL_CC = ""; // comma separated email addresses to put in CC of the signup email.
|
||||||
$SIGNUPEMAIL_BCC = ""; // comma separated email addresses to put in BCC of the signup email.
|
$SIGNUPEMAIL_BCC = ""; // comma separated email addresses to put in BCC of the signup email.
|
||||||
$SIGNUPEMAIL_ATTACHMENTS = ""; // files-path array of attachments. eg. array(e_FILE."myfile.zip",e_FILE."myotherfile.zip");
|
$SIGNUPEMAIL_ATTACHMENTS = ""; // files-path array of attachments. eg. array(e_FILE."myfile.zip",e_FILE."myotherfile.zip");
|
||||||
$SIGNUPEMAIL_BACKGROUNDIMAGE = "";// relative path to a background image eg. e_IMAGE."mybackground.jpg";
|
$SIGNUPEMAIL_BACKGROUNDIMAGE = ""; // absolute path to a background image eg. e_IMAGE."mybackground.jpg";
|
||||||
|
|
||||||
// Optional admin preferences Override.
|
|
||||||
$EMAIL_METHOD = ""; // php, smtp or sendmail
|
|
||||||
$EMAIL_SMTP_SERVER = ""; // smtp.myserver.com
|
|
||||||
$EMAIL_SMTP_USER = "";
|
|
||||||
$EMAIL_SMTP_PASS = "";
|
|
||||||
$EMAIL_SENDMAIL_PATH = "";
|
|
||||||
$EMAIL_FROM = ""; // admin@mysite.com
|
|
||||||
$EMAIL_FROM_NAME = ""; // Admin
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
Optional mailer admin preferences Override. The following mailer parameters can be overridden:
|
||||||
|
'mailer', 'smtp_server', 'smtp_username', 'smtp_password', 'sendmail', 'siteadminemail', 'siteadmin', 'smtp_pop3auth',
|
||||||
|
'SMTPDebug', 'subject', 'from', 'fromname', 'replyto', 'send_html', 'add_html_header', 'attachments', 'cc', 'bcc',
|
||||||
|
'bouncepath', 'returnreceipt', 'priority', 'extra_header', 'wordwrap', 'split'
|
||||||
|
|
||||||
|
See e_HANDLER.mail.php for more information
|
||||||
|
If required, uncomment the following block and add array elements for options to be overridden - array key is the option name
|
||||||
|
DON'T put in empty fields unless you wish to set the value to an empty value! */
|
||||||
|
/*
|
||||||
|
global $EMAIL_OVERRIDES;
|
||||||
|
$EMAIL_OVERRIDES = array(
|
||||||
|
'bouncepath' => 'some email address',
|
||||||
|
'returnreceipt' => 1
|
||||||
|
);
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Not used in signup email
|
||||||
$EMAIL_HEADER = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">
|
$EMAIL_HEADER = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">
|
||||||
<html xmlns='http://www.w3.org/1999/xhtml' >
|
<html xmlns='http://www.w3.org/1999/xhtml' >
|
||||||
<head>
|
<head>
|
||||||
@@ -48,6 +56,7 @@ $EMAIL_HEADER = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://ww
|
|||||||
";
|
";
|
||||||
|
|
||||||
|
|
||||||
|
// Not used in signup email
|
||||||
$EMAIL_FOOTER = "
|
$EMAIL_FOOTER = "
|
||||||
<br /><br />
|
<br /><br />
|
||||||
{SITENAME=link}
|
{SITENAME=link}
|
||||||
@@ -81,14 +90,10 @@ LAN_SIGNUP_97." {SITENAME}<br />
|
|||||||
<br />
|
<br />
|
||||||
{SITENAME}<br />
|
{SITENAME}<br />
|
||||||
{SITEURL}
|
{SITEURL}
|
||||||
<br /><br />
|
<br /><br />".($pref['sitebutton'] ? "<a href='".SITEURL."' title=''><img src='".e_IMAGE_ABS.str_replace('{e_IMAGE}', '', $pref['sitebutton'])."' alt='' /></a>" : '')."
|
||||||
{IMAGE1}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
";
|
";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
185
signup.php
185
signup.php
@@ -2,16 +2,16 @@
|
|||||||
/*
|
/*
|
||||||
* e107 website system
|
* e107 website system
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
* Copyright (C) 2001-2008 e107 Inc (e107.org)
|
||||||
* Released under the terms and conditions of the
|
* Released under the terms and conditions of the
|
||||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||||
*
|
*
|
||||||
* User signup
|
* User signup
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/signup.php,v $
|
* $Source: /cvs_backup/e107_0.8/signup.php,v $
|
||||||
* $Revision: 1.41 $
|
* $Revision: 1.42 $
|
||||||
* $Date: 2009-11-18 01:04:24 $
|
* $Date: 2009-11-18 20:45:20 $
|
||||||
* $Author: e107coders $
|
* $Author: e107steved $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -39,18 +39,18 @@ require_once(e_HANDLER.'user_handler.php');
|
|||||||
$userMethods = new UserHandler;
|
$userMethods = new UserHandler;
|
||||||
$userMethods->deleteExpired(); // Delete time-expired partial registrations
|
$userMethods->deleteExpired(); // Delete time-expired partial registrations
|
||||||
|
|
||||||
if (is_readable(THEME."signup_template.php"))
|
if (is_readable(THEME.'signup_template.php'))
|
||||||
{
|
{
|
||||||
require_once(THEME."signup_template.php");
|
require_once(THEME.'signup_template.php');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
require_once(e_THEME."templates/signup_template.php");
|
require_once(e_THEME.'templates/signup_template.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once(e_FILE."shortcode/batch/signup_shortcodes.php");
|
include_once(e_FILE.'shortcode/batch/signup_shortcodes.php');
|
||||||
|
|
||||||
$signup_imagecode = ($pref['signcode'] && extension_loaded("gd"));
|
$signup_imagecode = ($pref['signcode'] && extension_loaded('gd'));
|
||||||
$text = '';
|
$text = '';
|
||||||
$extraErrors = array();
|
$extraErrors = array();
|
||||||
$error = FALSE;
|
$error = FALSE;
|
||||||
@@ -59,9 +59,8 @@ $error = FALSE;
|
|||||||
//-------------------------------
|
//-------------------------------
|
||||||
// Resend Activation Email
|
// Resend Activation Email
|
||||||
//-------------------------------
|
//-------------------------------
|
||||||
if(e_QUERY == "resend" && !USER && ($pref['user_reg_veri'] == 1))
|
if((e_QUERY == 'resend') && !USER && ($pref['user_reg_veri'] == 1))
|
||||||
{
|
{
|
||||||
// done above: include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE);
|
|
||||||
require_once(HEADERF);
|
require_once(HEADERF);
|
||||||
|
|
||||||
$clean_email = $tp -> toDB($_POST['resend_email']);
|
$clean_email = $tp -> toDB($_POST['resend_email']);
|
||||||
@@ -120,8 +119,11 @@ if(e_QUERY == "resend" && !USER && ($pref['user_reg_veri'] == 1))
|
|||||||
// Now send the email - got some valid info
|
// Now send the email - got some valid info
|
||||||
$row['user_password'] = 'xxxxxxx'; // Don't know the real one
|
$row['user_password'] = 'xxxxxxx'; // Don't know the real one
|
||||||
$eml = render_email($row);
|
$eml = render_email($row);
|
||||||
$mailheader_e107id = $row['user_id'];
|
$eml['e107_header'] = $row['user_id'];
|
||||||
require_once(e_HANDLER."mail.php");
|
require_once(e_HANDLER.'mail.php');
|
||||||
|
$mailer = new e107Email();
|
||||||
|
|
||||||
|
if(!$mailer->sendEmail(USEREMAIL, USERNAME, $eml, FALSE))
|
||||||
|
|
||||||
$do_log['signup_action'] = LAN_SIGNUP_63;
|
$do_log['signup_action'] = LAN_SIGNUP_63;
|
||||||
|
|
||||||
@@ -188,24 +190,22 @@ if(e_QUERY == "resend" && !USER && ($pref['user_reg_veri'] == 1))
|
|||||||
|
|
||||||
if(!$_POST)
|
if(!$_POST)
|
||||||
{
|
{
|
||||||
|
$error = '';
|
||||||
$error = "";
|
$text = ' ';
|
||||||
$text = " ";
|
$password1 = '';
|
||||||
$password1 = "";
|
$password2 = '';
|
||||||
$password2 = "";
|
$email = ''; // Used in shortcodes
|
||||||
$email = ""; // Used in shortcodes
|
$loginname = '';
|
||||||
$loginname = "";
|
$realname = '';
|
||||||
$realname = "";
|
$image = '';
|
||||||
$image = "";
|
$avatar_upload = '';
|
||||||
$avatar_upload = "";
|
$photo_upload = '';
|
||||||
$photo_upload = "";
|
$_POST['ue'] = '';
|
||||||
$_POST['ue'] = "";
|
$signature = '';
|
||||||
$signature = "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ADMIN && (e_QUERY == "preview" || e_QUERY == "test" || e_QUERY == "preview.aftersignup"))
|
if(ADMIN && (e_QUERY == 'preview' || e_QUERY == 'test' || e_QUERY == 'preview.aftersignup'))
|
||||||
{
|
{
|
||||||
// done above: include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE);
|
|
||||||
if(e_QUERY == "preview.aftersignup")
|
if(e_QUERY == "preview.aftersignup")
|
||||||
{
|
{
|
||||||
require_once(HEADERF);
|
require_once(HEADERF);
|
||||||
@@ -224,17 +224,12 @@ if(ADMIN && (e_QUERY == "preview" || e_QUERY == "test" || e_QUERY == "preview.a
|
|||||||
$eml = render_email($temp,TRUE); // It ignores the data, anyway
|
$eml = render_email($temp,TRUE); // It ignores the data, anyway
|
||||||
echo $eml['preview'];
|
echo $eml['preview'];
|
||||||
|
|
||||||
if(e_QUERY == "test")
|
if(e_QUERY == 'test')
|
||||||
{
|
{
|
||||||
require_once(e_HANDLER."mail.php");
|
require_once(e_HANDLER.'mail.php');
|
||||||
$message = $eml['message'];
|
$mailer = new e107Email();
|
||||||
$subj = $eml['subject'];
|
|
||||||
$inline = $eml['inline-images'];
|
|
||||||
$Cc = $eml['cc'];
|
|
||||||
$Bcc = $eml['bcc'];
|
|
||||||
$attachments = $eml['attachments'];
|
|
||||||
|
|
||||||
if(!sendemail(USEREMAIL, $subj, $message, USERNAME, "", "", $attachments, $Cc, $Bcc, $returnpath, $returnreceipt,$inline))
|
if(!$mailer->sendEmail(USEREMAIL, USERNAME, $eml, FALSE))
|
||||||
{
|
{
|
||||||
echo "<br /><br /><br /><br > >> ".LAN_SIGNUP_42; // there was a problem.
|
echo "<br /><br /><br /><br > >> ".LAN_SIGNUP_42; // there was a problem.
|
||||||
}
|
}
|
||||||
@@ -251,14 +246,14 @@ if ($pref['membersonly_enabled'])
|
|||||||
$HEADER = "<div style='text-align:center; width:100%;margin-left:auto;margin-right:auto;text-align:center'><div style='width:70%;text-align:center;margin-left:auto;margin-right:auto'><br />";
|
$HEADER = "<div style='text-align:center; width:100%;margin-left:auto;margin-right:auto;text-align:center'><div style='width:70%;text-align:center;margin-left:auto;margin-right:auto'><br />";
|
||||||
if (file_exists(THEME."images/login_logo.png"))
|
if (file_exists(THEME."images/login_logo.png"))
|
||||||
{
|
{
|
||||||
$HEADER .= "<img src='".THEME."images/login_logo.png' alt='' />\n";
|
$HEADER .= "<img src='".THEME_ABS."images/login_logo.png' alt='' />\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$HEADER .= "<img src='".e_IMAGE."logo.png' alt='' />\n";
|
$HEADER .= "<img src='".e_IMAGE_ABS."logo.png' alt='' />\n";
|
||||||
}
|
}
|
||||||
$HEADER .= "<br />";
|
$HEADER .= '<br />';
|
||||||
$FOOTER = "</div></div>";
|
$FOOTER = '</div></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if($signup_imagecode)
|
if($signup_imagecode)
|
||||||
@@ -267,31 +262,26 @@ if($signup_imagecode)
|
|||||||
$sec_img = new secure_image;
|
$sec_img = new secure_image;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($pref['user_reg'] == 0)
|
if (USER || ($pref['user_reg'] == 0) || ($pref['auth_method'] != 'e107'))
|
||||||
{
|
{
|
||||||
header("location: ".e_HTTP."index.php");
|
header('location: '.e_HTTP.'index.php');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(USER)
|
|
||||||
{
|
|
||||||
header("location: ".e_HTTP."index.php");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------
|
//----------------------------------------
|
||||||
// After clicking the activation link
|
// After clicking the activation link
|
||||||
//----------------------------------------
|
//----------------------------------------
|
||||||
if (e_QUERY)
|
if (e_QUERY)
|
||||||
{
|
{
|
||||||
$qs = explode(".", e_QUERY);
|
$qs = explode('.', e_QUERY);
|
||||||
if ($qs[0] == "activate" && (count($qs) == 3 || count($qs) == 4) && $qs[2])
|
if ($qs[0] == 'activate' && (count($qs) == 3 || count($qs) == 4) && $qs[2])
|
||||||
{
|
{
|
||||||
//TODO use generic multilanguage selection
|
//TODO use generic multilanguage selection
|
||||||
// return the message in the correct language.
|
// return the message in the correct language.
|
||||||
if(isset($qs[3]) && strlen($qs[3]) == 2 )
|
if(isset($qs[3]) && strlen($qs[3]) == 2 )
|
||||||
{
|
{
|
||||||
require_once(e_HANDLER."language_class.php");
|
require_once(e_HANDLER.'language_class.php');
|
||||||
$slng = new language;
|
$slng = new language;
|
||||||
$the_language = $slng->convert($qs[3]);
|
$the_language = $slng->convert($qs[3]);
|
||||||
if(is_readable(e_LANGUAGEDIR.$the_language.'/lan_'.e_PAGE))
|
if(is_readable(e_LANGUAGEDIR.$the_language.'/lan_'.e_PAGE))
|
||||||
@@ -457,7 +447,9 @@ if (isset($_POST['register']))
|
|||||||
$allData['user_ip'] = $e107->getip();
|
$allData['user_ip'] = $e107->getip();
|
||||||
|
|
||||||
|
|
||||||
// check for multiple signups from the same IP address.
|
// check for multiple signups from the same IP address. But ignore localhost
|
||||||
|
if ($allData['user_ip'] != LOCALHOST_IP)
|
||||||
|
{
|
||||||
if($ipcount = $sql->db_Select('user', '*', "user_ip='".$allData['user_ip']."' and user_ban !='2' "))
|
if($ipcount = $sql->db_Select('user', '*', "user_ip='".$allData['user_ip']."' and user_ban !='2' "))
|
||||||
{
|
{
|
||||||
if($ipcount >= $pref['signup_maxip'] && trim($pref['signup_maxip']) != "")
|
if($ipcount >= $pref['signup_maxip'] && trim($pref['signup_maxip']) != "")
|
||||||
@@ -466,6 +458,7 @@ if (isset($_POST['register']))
|
|||||||
$allData['errortext']['user_email'] = LAN_SIGNUP_71;
|
$allData['errortext']['user_email'] = LAN_SIGNUP_71;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Email address confirmation.
|
// Email address confirmation.
|
||||||
if (!isset($allData['errors']['user_email']))
|
if (!isset($allData['errors']['user_email']))
|
||||||
@@ -620,14 +613,15 @@ if (isset($_POST['register']))
|
|||||||
$allData['data']['user_id'] = $nid; // User ID
|
$allData['data']['user_id'] = $nid; // User ID
|
||||||
$allData['data']['user_password'] = $savePassword; // Might need to send plaintext password in the email
|
$allData['data']['user_password'] = $savePassword; // Might need to send plaintext password in the email
|
||||||
$eml = render_email($allData['data']);
|
$eml = render_email($allData['data']);
|
||||||
$mailheader_e107id = $eml['userid'];
|
$eml['e107_header'] = $eml['userid'];
|
||||||
require_once(e_HANDLER."mail.php");
|
require_once(e_HANDLER.'mail.php');
|
||||||
|
$mailer = new e107Email();
|
||||||
|
|
||||||
|
if(!$mailer->sendEmail($allData['data']['user_email'], $allData['data']['user_name'], $eml,FALSE))
|
||||||
if(!sendemail($_POST['email'], $eml['subject'], $eml['message'], "", "", "", $eml['attachments'], $eml['cc'], $eml['bcc'], "", "", $eml['inline-images']))
|
|
||||||
{
|
{
|
||||||
$error_message = LAN_SIGNUP_42; // There was a problem, the registration mail was not sent, please contact the website administrator.
|
$error_message = LAN_SIGNUP_42; // There was a problem, the registration mail was not sent, please contact the website administrator.
|
||||||
}
|
}
|
||||||
|
unset($allData['data']['user_password']);
|
||||||
}
|
}
|
||||||
$e_event->trigger('usersup', $_POST); // Old trigger - send everything in the template, including extended fields.
|
$e_event->trigger('usersup', $_POST); // Old trigger - send everything in the template, including extended fields.
|
||||||
$e_event->trigger('userpartial', array_merge($allData['data'],$eufVals['data'])); // New trigger - send everything in the template, including extended fields.
|
$e_event->trigger('userpartial', array_merge($allData['data'],$eufVals['data'])); // New trigger - send everything in the template, including extended fields.
|
||||||
@@ -749,7 +743,13 @@ function headerjs()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Create the email to send. $userInfo is the array of DB variables
|
/**
|
||||||
|
* Create email to send to user who just registered.
|
||||||
|
*
|
||||||
|
* @param array $userInfo is the array of user-related DB variables
|
||||||
|
*
|
||||||
|
* @return array of data for mailer - field names directly compatible
|
||||||
|
*/
|
||||||
function render_email($userInfo, $preview = FALSE)
|
function render_email($userInfo, $preview = FALSE)
|
||||||
{
|
{
|
||||||
// 1 = Body
|
// 1 = Body
|
||||||
@@ -767,69 +767,74 @@ function render_email($userInfo, $preview = FALSE)
|
|||||||
$userInfo['user_sess'] = "1234567890ABCDEFGHIJKLMNOP";
|
$userInfo['user_sess'] = "1234567890ABCDEFGHIJKLMNOP";
|
||||||
}
|
}
|
||||||
|
|
||||||
define("RETURNADDRESS", (substr(SITEURL, -1) == "/" ? SITEURL."signup.php?activate.".$userInfo['user_id'].".".$userInfo['user_sess'] : SITEURL."/signup.php?activate.".$userInfo['user_id'].".".$userInfo['user_sess'].".".e_LAN));
|
define('RETURNADDRESS', (substr(SITEURL, -1) == "/" ? SITEURL."signup.php?activate.".$userInfo['user_id'].".".$userInfo['user_sess'] : SITEURL."/signup.php?activate.".$userInfo['user_id'].".".$userInfo['user_sess'].".".e_LAN));
|
||||||
$pass_show = ($pref['user_reg_secureveri'])? "*******" : $userInfo['user_password'];
|
$pass_show = ($pref['user_reg_secureveri'])? '*******' : $userInfo['user_password'];
|
||||||
|
|
||||||
if (file_exists(THEME."email_template.php"))
|
if (file_exists(THEME.'email_template.php'))
|
||||||
{
|
{
|
||||||
require_once(THEME."email_template.php");
|
require_once(THEME.'email_template.php');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
require_once(e_THEME."templates/email_template.php");
|
require_once(e_THEME.'templates/email_template.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
$inline_images = explode(",",$SIGNUPEMAIL_IMAGES);
|
/* Inline images now handled automatically - just include in email template with an absolute link
|
||||||
if($SIGNUPEMAIL_BACKGROUNDIMAGE)
|
$inlineImages = array();
|
||||||
|
$inlineImages = explode(",",$SIGNUPEMAIL_IMAGES);
|
||||||
|
if (vartrue($SIGNUPEMAIL_BACKGROUNDIMAGE))
|
||||||
{
|
{
|
||||||
$inline_images[] = $SIGNUPEMAIL_BACKGROUNDIMAGE;
|
$inlineImages[] = $SIGNUPEMAIL_BACKGROUNDIMAGE;
|
||||||
}
|
}
|
||||||
|
if (count($inlineImages)) { $ret['mail_inline_images'] = implode(",",$inlineImages); }
|
||||||
|
*/
|
||||||
|
|
||||||
$ret['userid'] = $userInfo['user_id'];
|
$ret['mail_recipient_id'] = $userInfo['user_id'];
|
||||||
$ret['cc'] = $SIGNUPEMAIL_CC;
|
if (vartrue($SIGNUPEMAIL_CC)) { $ret['mail_copy_to'] = $SIGNUPEMAIL_CC; }
|
||||||
$ret['bcc'] = $SIGNUPEMAIL_BCC;
|
if (vartrue($SIGNUPEMAIL_BCC)) { $ret['mail_bcopy_to'] = $SIGNUPEMAIL_BCC; }
|
||||||
$ret['attachments'] = $SIGNUPEMAIL_ATTACHMENTS;
|
if (vartrue($SIGNUPEMAIL_ATTACHMENTS)) { $ret['mail_attach'] = $SIGNUPEMAIL_ATTACHMENTS; }
|
||||||
$ret['inline-images'] = implode(",",$inline_images);
|
|
||||||
|
|
||||||
$style = ($SIGNUPEMAIL_LINKSTYLE) ? "style='$SIGNUPEMAIL_LINKSTYLE'" : "";
|
$style = ($SIGNUPEMAIL_LINKSTYLE) ? "style='{$SIGNUPEMAIL_LINKSTYLE}'" : "";
|
||||||
|
|
||||||
$search[0] = "{LOGINNAME}";
|
$search[0] = '{LOGINNAME}';
|
||||||
$replace[0] = $userInfo['user_loginname'];
|
$replace[0] = $userInfo['user_loginname'];
|
||||||
|
|
||||||
$search[1] = "{PASSWORD}";
|
$search[1] = '{PASSWORD}';
|
||||||
$replace[1] = $pass_show;
|
$replace[1] = $pass_show;
|
||||||
|
|
||||||
$search[2] = "{ACTIVATION_LINK}";
|
$search[2] = '{ACTIVATION_LINK}';
|
||||||
$replace[2] = "<a href='".RETURNADDRESS."' {$style}>".RETURNADDRESS."</a>";
|
$replace[2] = "<a href='".RETURNADDRESS."' {$style}>".RETURNADDRESS."</a>";
|
||||||
|
|
||||||
$search[3] = "{SITENAME}";
|
$search[3] = '{SITENAME}';
|
||||||
$replace[3] = SITENAME;
|
$replace[3] = SITENAME;
|
||||||
|
|
||||||
$search[4] = "{SITEURL}";
|
$search[4] = '{SITEURL}';
|
||||||
$replace[4] = "<a href='".SITEURL."' {$style}>".SITEURL."</a>";
|
$replace[4] = "<a href='".SITEURL."' {$style}>".SITEURL."</a>";
|
||||||
|
|
||||||
$search[5] = "{USERNAME}";
|
$search[5] = '{USERNAME}';
|
||||||
$replace[5] = $userInfo['user_name'];
|
$replace[5] = $userInfo['user_name'];
|
||||||
|
|
||||||
$search[6] = "{USERURL}";
|
$search[6] = '{USERURL}';
|
||||||
$replace[6] = varsettrue($userInfo['user_website']) ? $userInfo['user_website'] : "";
|
$replace[6] = varsettrue($userInfo['user_website']) ? $userInfo['user_website'] : "";
|
||||||
|
|
||||||
|
/* Inline images now handled automatically - just include in email template with an absolute link
|
||||||
$cnt=1;
|
$cnt=1;
|
||||||
|
foreach($inlineImages as $img)
|
||||||
foreach($inline_images as $img)
|
|
||||||
{
|
{
|
||||||
if(is_readable($inline_images[$cnt-1]))
|
if(is_readable($inlineImages[$cnt-1]))
|
||||||
{
|
{
|
||||||
$cid_search[] = "{IMAGE".$cnt."}";
|
$cid_search[] = "{IMAGE".$cnt."}";
|
||||||
$cid_replace[] = "<img alt=\"".SITENAME."\" src='cid:".md5($inline_images[$cnt-1])."' />\n";
|
$cid_replace[] = "<img alt=\"".SITENAME."\" src='cid:".md5($inlineImages[$cnt-1])."' />\n";
|
||||||
$path_search[] = "{IMAGE".$cnt."}";
|
$path_search[] = "{IMAGE".$cnt."}";
|
||||||
$path_replace[] = "<img alt=\"".SITENAME."\" src=\"".$inline_images[$cnt-1]."\" />\n";
|
$path_replace[] = "<img alt=\"".SITENAME."\" src=\"".$inlineImages[$cnt-1]."\" />\n";
|
||||||
}
|
}
|
||||||
$cnt++;
|
$cnt++;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
$subject = str_replace($search,$replace,$SIGNUPEMAIL_SUBJECT);
|
$subject = str_replace($search,$replace,$SIGNUPEMAIL_SUBJECT);
|
||||||
$ret['subject'] = $subject;
|
$ret['mail_subject'] = $subject;
|
||||||
|
$ret['send_html'] = TRUE;
|
||||||
|
|
||||||
$HEAD = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n";
|
$HEAD = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n";
|
||||||
$HEAD .= "<html xmlns='http://www.w3.org/1999/xhtml' >\n";
|
$HEAD .= "<html xmlns='http://www.w3.org/1999/xhtml' >\n";
|
||||||
@@ -843,9 +848,9 @@ function render_email($userInfo, $preview = FALSE)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$HEAD .= "</head>\n";
|
$HEAD .= "</head>\n";
|
||||||
if($SIGNUPEMAIL_BACKGROUNDIMAGE)
|
if(vartrue($SIGNUPEMAIL_BACKGROUNDIMAGE))
|
||||||
{
|
{
|
||||||
$HEAD .= "<body background=\"cid:".md5($SIGNUPEMAIL_BACKGROUNDIMAGE)."\" >\n";
|
$HEAD .= "<body background=\"".$SIGNUPEMAIL_BACKGROUNDIMAGE."\" >\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -853,16 +858,14 @@ function render_email($userInfo, $preview = FALSE)
|
|||||||
}
|
}
|
||||||
$FOOT = "\n</body>\n</html>\n";
|
$FOOT = "\n</body>\n</html>\n";
|
||||||
|
|
||||||
$SIGNUPEMAIL_TEMPLATE = $HEAD.$SIGNUPEMAIL_TEMPLATE.$FOOT;
|
$ret['mail_body'] = str_replace($search,$replace,$HEAD.$SIGNUPEMAIL_TEMPLATE.$FOOT);
|
||||||
$message = str_replace($search,$replace,$SIGNUPEMAIL_TEMPLATE);
|
$ret['preview'] = $ret['mail_body']; // Non-standard field
|
||||||
|
|
||||||
$ret['message'] = str_replace($cid_search,$cid_replace,$message);
|
|
||||||
$ret['preview'] = str_replace($path_search,$path_replace,$message);
|
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function render_after_signup($error_message)
|
function render_after_signup($error_message)
|
||||||
{
|
{
|
||||||
global $pref, $allData, $adviseLoginName, $tp;
|
global $pref, $allData, $adviseLoginName, $tp;
|
||||||
|
@@ -9,9 +9,9 @@
|
|||||||
* User settings modify
|
* User settings modify
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/usersettings.php,v $
|
* $Source: /cvs_backup/e107_0.8/usersettings.php,v $
|
||||||
* $Revision: 1.43 $
|
* $Revision: 1.44 $
|
||||||
* $Date: 2009-11-18 01:04:24 $
|
* $Date: 2009-11-18 20:45:20 $
|
||||||
* $Author: e107coders $
|
* $Author: e107steved $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
@@ -234,7 +234,7 @@ if (isset($_POST['updatesettings']))
|
|||||||
$changedEUFData = array();
|
$changedEUFData = array();
|
||||||
if (isset($_POST['ue']))
|
if (isset($_POST['ue']))
|
||||||
{
|
{
|
||||||
$eufVals = $ue->userExtendedValidateAll($_POST['ue'], varset($_POST['hide'],array())); // Validate the extended user fields
|
$eufVals = $ue->userExtendedValidateAll($_POST['ue'], varset($_POST['hide'],TRUE)); // Validate the extended user fields
|
||||||
$changedEUFData['data'] = validatorClass::findChanges($eufVals['data'], $udata,FALSE);
|
$changedEUFData['data'] = validatorClass::findChanges($eufVals['data'], $udata,FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user