Revision 2063
Added by Dietmar almost 11 years ago
- problems with confirmation mail solved
branches/2.8.x/CHANGELOG | ||
---|---|---|
12 | 12 |
=============================================================================== |
13 | 13 |
|
14 | 14 |
|
15 |
01 Jan-2014 Build 2063 Dietmar Woellbrink (Luisehahne) |
|
16 |
# problems with confirmation mail solved |
|
15 | 17 |
01 Jan-2014 Build 2062 Manuela v.d.Decken(DarkViper) |
16 | 18 |
! wb::mail added message on error if DEBUG is set |
17 | 19 |
01 Jan-2014 Build 2061 Manuela v.d.Decken(DarkViper) |
branches/2.8.x/wb/admin/interface/version.php | ||
---|---|---|
51 | 51 |
|
52 | 52 |
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled) |
53 | 53 |
if(!defined('VERSION')) define('VERSION', '2.8.4'); |
54 |
if(!defined('REVISION')) define('REVISION', '2062');
|
|
54 |
if(!defined('REVISION')) define('REVISION', '2063');
|
|
55 | 55 |
if(!defined('SP')) define('SP', ''); |
branches/2.8.x/wb/account/signup_mails.php | ||
---|---|---|
23 | 23 |
} |
24 | 24 |
/* -------------------------------------------------------- */ |
25 | 25 |
|
26 |
$search = array(); |
|
27 |
$replace = array(); |
|
26 | 28 |
//WB_MAILER settings |
27 | 29 |
$sServerEmail = (defined('SERVER_EMAIL') && SERVER_EMAIL != '' ? SERVER_EMAIL : emailAdmin()); |
28 | 30 |
$sWebMailer = (defined('WBMAILER_DEFAULT_SENDERNAME') && WBMAILER_DEFAULT_SENDERNAME != '' ? WBMAILER_DEFAULT_SENDERNAME : 'WebsiteBaker Mailer'); |
... | ... | |
42 | 44 |
|
43 | 45 |
$mail_replyto = $email_to; |
44 | 46 |
$mail_replyName = $sDisplayName; |
45 |
$mail_message = $MESSAGE['SIGNUP2_ADMIN_INFO'];
|
|
46 |
$email_subject = $MESSAGE['SIGNUP2_NEW_USER'];
|
|
47 |
$mail_message = $mLang->MESSAGE_SIGNUP2_ADMIN_INFO;
|
|
48 |
$email_subject = $mLang->MESSAGE_SIGNUP2_NEW_USER;
|
|
47 | 49 |
$search = array('{LOGIN_EMAIL}','{LOGIN_ID}', '{SIGNUP_DATE}', '{LOGIN_NAME}', '{LOGIN_IP}'); |
48 | 50 |
$replace = array($email_to, $email_fromname.' ('.$user_id.')', date(DATE_FORMAT.' '.TIME_FORMAT,$get_ts ), $sLoginName, $get_ip); |
49 | 51 |
$mail_message = str_replace($search, $replace, $mail_message); |
... | ... | |
53 | 55 |
|
54 | 56 |
// prepare confirmation mail to user, easy old style |
55 | 57 |
if(($email_to != '') && $bSaveRegistration) { |
56 |
$email_subject = $MESSAGE['SIGNUP2_SUBJECT_LOGIN_INFO'];
|
|
57 |
$mail_message = $MESSAGE['SIGNUP2_BODY_LOGIN_INFO'].$MESSAGE['SUCCESS_EMAIL_TEXT_GENERATED'];
|
|
58 |
$search = array('{LOGIN_DISPLAY_NAME}', '{LOGIN_WEBSITE_TITLE}', '{LOGIN_NAME}', '{LOGIN_PASSWORD}'); |
|
58 |
$sEmailSubject = $mLang->MESSAGE_SIGNUP2_SUBJECT_LOGIN_INFO;
|
|
59 |
$mail_message = $mLang->MESSAGE_SIGNUP2_BODY_LOGIN_INFO.$mLang->MESSAGE_SUCCESS_EMAIL_TEXT_GENERATED;
|
|
60 |
$search = array('{LOGIN_DISPLAY_NAME}', '{LOGIN_WEBSITE_TITLE}', '{LOGIN_NAME}', '{LOGIN_PASSWORD}');
|
|
59 | 61 |
$replace = array($sDisplayName, WEBSITE_TITLE, $sLoginName, $sNewPassword); |
60 | 62 |
$mail_message = str_replace($search, $replace, $mail_message); |
61 | 63 |
} |
... | ... | |
64 | 66 |
if(($email_to != '') && $bSaveRegistration) { |
65 | 67 |
// $daylight_saving = date('I'); |
66 | 68 |
$sConfirmedTimeOut = gmdate('Y/m/d H:i',$sTimeOut).' GMT'; |
67 |
$email_subject = $MESSAGE['SIGNUP_ACTIVATION'];
|
|
68 |
$search = array('{LOGIN_DISPLAY_NAME}', '{LOGIN_WEBSITE_TITLE}', '{LOGIN_NAME}', '{LINK}', '{CONFIRMED_REGISTRATION_ENDTIME}');
|
|
69 |
$sEmailSubject = $mLang->MESSAGE_SIGNUP_ACTIVATION;
|
|
70 |
$search = array("{LOGIN_DISPLAY_NAME}", "{LOGIN_WEBSITE_TITLE}", "{LOGIN_NAME}", "{LINK}", "{CONFIRMED_REGISTRATION_ENDTIME}" );
|
|
69 | 71 |
$replace = array($sDisplayName, WEBSITE_TITLE, $sLoginName, $sConfirmedLink,$sConfirmedTimeOut); |
70 |
$mail_message = $MESSAGE['SEND_CONFIRMED_REGISTRATION'].$MESSAGE['SUCCESS_EMAIL_TEXT_GENERATED'];
|
|
72 |
$mail_message = $mLang->MESSAGE_SEND_CONFIRMED_REGISTRATION.$mLang->MESSAGE_SUCCESS_EMAIL_TEXT_GENERATED;
|
|
71 | 73 |
$mail_message = str_replace($search, $replace, $mail_message); |
74 |
//print '<pre style="text-align: left;"><strong>function '.__FUNCTION__.'( '.''.' );</strong> basename: '.basename(__FILE__).' line: '.__LINE__.' -> <br />'; |
|
75 |
//print_r( $mail_message ); print '</pre>'; // flush ();sleep(10); die(); |
|
72 | 76 |
} |
73 | 77 |
} |
74 | 78 |
// now send user email, first prepare values for both of type |
... | ... | |
77 | 81 |
$recipient = preg_replace( $regex, "?", $sDisplayName ); |
78 | 82 |
$email_fromname = preg_replace( "/(content-type:|bcc:|cc:|to:|from:)/im", "?", $recipient ); |
79 | 83 |
$email_body = preg_replace( "/(content-type:|bcc:|cc:|to:|from:)/im", "", $mail_message ); |
80 |
|
|
81 |
$bSendRegistrationMailtoUser = $wb->mail($sServerEmail,$email_to,$email_subject,$email_body,$sWebMailer); |
|
84 |
$bSendRegistrationMailtoUser = $wb->mail($sServerEmail,$email_to,$sEmailSubject,$email_body,$sWebMailer); |
branches/2.8.x/wb/account/confirm_form_mask.php | ||
---|---|---|
16 | 16 |
*/ |
17 | 17 |
/* -------------------------------------------------------- */ |
18 | 18 |
// Must include code to stop this file being accessed directly |
19 |
if(defined('WB_PATH') == false)
|
|
20 |
{
|
|
21 |
die('<h2 style="color:red;margin:3em auto;text-align:center;">Cannot access this file directly</h2>');
|
|
19 |
if(!defined('WB_PATH')) {
|
|
20 |
require_once(dirname(dirname(__FILE__)).'/framework/globalExceptionHandler.php');
|
|
21 |
throw new IllegalFileException();
|
|
22 | 22 |
} |
23 | 23 |
/* -------------------------------------------------------- */ |
24 |
$sIncludeHeadLinkCss = ''; |
|
25 |
if( is_readable(WB_PATH .'/account/frontend.css')) { |
|
26 |
$sIncludeHeadLinkCss .= '<link href="'.WB_URL.'/account/frontend.css"'; |
|
27 |
$sIncludeHeadLinkCss .= ' rel="stylesheet" type="text/css" media="screen" />'."\n"; |
|
28 |
} |
|
24 | 29 |
|
25 |
|
|
26 | 30 |
// set template file and assign module and template block |
27 | 31 |
$oTpl = new Template(dirname(__FILE__).'/htt','keep'); |
28 | 32 |
$oTpl->set_file('page', 'confirm.htt'); |
branches/2.8.x/wb/account/confirm.php | ||
---|---|---|
15 | 15 |
* |
16 | 16 |
*/ |
17 | 17 |
|
18 |
require_once('../config.php'); |
|
18 |
$config_file = realpath('../framework/initialize.php'); |
|
19 |
if(file_exists($config_file) && !defined('WB_URL')) |
|
20 |
{ |
|
21 |
$sAutoLanguage = 'EN'; |
|
22 |
// detect client language |
|
23 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { |
|
24 |
if(preg_match('/([a-z]{2})(?:-[a-z]{2})*/i', strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']), $matches)) { |
|
25 |
$sAutoLanguage = strtoupper($matches[1]); |
|
26 |
} |
|
27 |
} |
|
28 |
$sAutoLanguage=( isset($_SESSION['LANGUAGE'] ) ? $_SESSION['LANGUAGE'] : $sAutoLanguage); |
|
29 |
if(!defined('LANGUAGE')) { define('LANGUAGE',$sAutoLanguage); } |
|
30 |
|
|
31 |
require_once($config_file); |
|
32 |
} |
|
19 | 33 |
$mLang = Translate::getinstance(); |
20 | 34 |
$mLang->enableAddon('account'); |
21 | 35 |
|
branches/2.8.x/wb/account/signup.php | ||
---|---|---|
23 | 23 |
*/ |
24 | 24 |
|
25 | 25 |
// Include config file |
26 |
$config_file = realpath('../config.php');
|
|
26 |
$config_file = realpath('../framework/initialize.php');
|
|
27 | 27 |
if(file_exists($config_file) && !defined('WB_URL')) |
28 | 28 |
{ |
29 |
$sAutoLanguage = 'EN'; |
|
30 |
// detect client language |
|
31 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { |
|
32 |
if(preg_match('/([a-z]{2})(?:-[a-z]{2})*/i', strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']), $matches)) { |
|
33 |
$sAutoLanguage = strtoupper($matches[1]); |
|
34 |
} |
|
35 |
} |
|
36 |
$sAutoLanguage=( isset($_SESSION['LANGUAGE'] ) ? $_SESSION['LANGUAGE'] : $sAutoLanguage); |
|
37 |
if(!defined('LANGUAGE')) { define('LANGUAGE',$sAutoLanguage); } |
|
38 |
|
|
29 | 39 |
require_once($config_file); |
30 | 40 |
} |
31 | 41 |
|
... | ... | |
61 | 71 |
$wb->send_header(WB_URL.'/index.php'); |
62 | 72 |
} |
63 | 73 |
|
64 |
$langDir = WB_PATH . '/languages/' . LANGUAGE . '.php'; |
|
65 |
require_once(!file_exists($langDir) ? WB_PATH . '/languages/EN.php' : $langDir ); |
|
74 |
//$langDir = WB_PATH . '/languages/' . LANGUAGE . '.php';
|
|
75 |
//require_once(!file_exists($langDir) ? WB_PATH . '/languages/EN.php' : $langDir );
|
|
66 | 76 |
|
67 | 77 |
$_SESSION['display_form'] = true; |
68 | 78 |
|
branches/2.8.x/wb/account/save_confirm.php | ||
---|---|---|
30 | 30 |
$sLoginName = $database->escapeString($wb->StripCodeFromText($wb->get_post('new_loginname'))); |
31 | 31 |
$sConfirmationId = $database->escapeString($wb->StripCodeFromText($wb->get_post('confirm_code'))); |
32 | 32 |
|
33 |
$bSendRegistrationMailtoUser = false; |
|
33 |
$bSendRegistrationMailtoUser = false;
|
|
34 | 34 |
$bSendRegistrationMailtoAdmin = false; |
35 | 35 |
$aUser = array(); |
36 | 36 |
if( ($sPassword=='') || ($sLoginName=='') ) { |
branches/2.8.x/wb/account/confirm_form.php | ||
---|---|---|
16 | 16 |
*/ |
17 | 17 |
/* -------------------------------------------------------- */ |
18 | 18 |
// Must include code to stop this file being accessed directly |
19 |
if(defined('WB_PATH') == false)
|
|
20 |
{
|
|
21 |
die('<h2 style="color:red;margin:3em auto;text-align:center;">Cannot access this file directly</h2>');
|
|
19 |
if(!defined('WB_PATH')) {
|
|
20 |
require_once(dirname(dirname(__FILE__)).'/framework/globalExceptionHandler.php');
|
|
21 |
throw new IllegalFileException();
|
|
22 | 22 |
} |
23 | 23 |
/* -------------------------------------------------------- */ |
24 | 24 |
|
... | ... | |
27 | 27 |
// load module language file |
28 | 28 |
$mLang = Translate::getInstance(); |
29 | 29 |
$mLang->enableAddon('account'); |
30 |
$sIncludeHeadLinkCss = ''; |
|
31 |
if( is_readable(WB_PATH .'/account/frontend.css')) { |
|
32 |
$sIncludeHeadLinkCss .= '<link href="'.WB_URL.'/account/frontend.css"'; |
|
33 |
$sIncludeHeadLinkCss .= ' rel="stylesheet" type="text/css" media="screen" />'."\n"; |
|
34 |
print $sIncludeHeadLinkCss; |
|
35 |
} |
|
30 | 36 |
|
31 | 37 |
$sConfirmationId = ( isset($_GET['id']) ? $_GET['id'] : ( isset($_POST['confirm_code']) ? $_POST['confirm_code'] : '' ) ); |
32 | 38 |
$sSubmitAction = 'show'; // default action |
... | ... | |
37 | 43 |
$sSubmitAction = 'cancel'; // default action |
38 | 44 |
} |
39 | 45 |
|
40 |
$sIncludeHeadLinkCss = ''; |
|
41 |
if( is_readable(WB_PATH .'/account/frontend.css')) { |
|
42 |
$sIncludeHeadLinkCss .= '<link href="'.WB_URL.'/account/frontend.css"'; |
|
43 |
$sIncludeHeadLinkCss .= ' rel="stylesheet" type="text/css" media="screen" />'."\n"; |
|
44 |
} |
|
45 |
|
|
46 | 46 |
$output = ''; |
47 | 47 |
msgQueue::clear(); |
48 | 48 |
switch($sSubmitAction) : |
... | ... | |
59 | 59 |
default: |
60 | 60 |
include(dirname(__FILE__).'/confirm_form_mask.php'); |
61 | 61 |
endswitch; // end of switch |
62 |
|
|
63 |
|
|
64 |
// if(!msgQueue::isEmpty()) |
|
65 |
// { |
|
66 |
// } |
|
67 |
// if( ($msg = msgQueue::getSuccess()) != '') |
|
68 |
// { |
|
69 |
// $output = $admin->format_message($msg, 'ok').$output; |
|
70 |
// } |
|
71 |
// if( ($msg = msgQueue::getError()) != '') |
|
72 |
// { |
|
73 |
// $output = $admin->format_message($msg, 'error').$output; |
|
74 |
// } |
|
75 |
// print $output; |
branches/2.8.x/wb/account/frontend.css | ||
---|---|---|
46 | 46 |
div.box-info { border-color :#bb7a00; color :#003ff2; } |
47 | 47 |
div.box-warning { border-color :#ffa500; color :#ffa500; } |
48 | 48 |
/* Border attributes for mbox and other elements also *********************** */ |
49 |
|
|
49 |
.signup { } |
|
50 |
.nixhier {display: none;} |
|
50 | 51 |
/* ]]> */ |
branches/2.8.x/wb/account/languages/EN.php | ||
---|---|---|
36 | 36 |
$HEADING['SIGNUP2_CONFIMED_REGISTRATION'] = 'Unlock account'; |
37 | 37 |
$HEADING['MESSAGE_WELCOME'] = 'Welcome to unlock of your account'; |
38 | 38 |
|
39 |
$HELP['SIGNUP_REMEMBER_PASSWORD'] = '<i>Remember your Loginname and Passwoprd please! You will need it later to complete the activation!</i>';
|
|
39 |
$HELP['SIGNUP_REMEMBER_PASSWORD'] = '<i>"Please remember your login name and password! Afterwards you will need it to complete your activation!" </i>';
|
|
40 | 40 |
$HELP['CONFIRM_PASSWORD'] = '<i>Enter your Loginname and Password please to finish the the activation!</i>'; |
41 | 41 |
|
42 | 42 |
$MESSAGE['ACTIVATED_NEW_USER'] = '<b>Your account is activated. You can logon now.</b>'; |
... | ... | |
95 | 95 |
$MESSAGE['CONFIRMED'] .= 'Thank you!'; |
96 | 96 |
$MESSAGE['CHANGE_PASSWORD'] = 'For security reasons change the password as soon as possible please. For that visit following website:'; |
97 | 97 |
|
98 |
$MESSAGE['LOGIN_BOTH_BLANK'] = 'Give your login name and password please';
|
|
99 |
$MESSAGE['LOGIN_PASSWORD_BLANK'] = 'Give your password please';
|
|
98 |
$MESSAGE['LOGIN_BOTH_BLANK'] = 'Please enter your login name and password';
|
|
99 |
$MESSAGE['LOGIN_PASSWORD_BLANK'] = 'Please enter your password';
|
|
100 | 100 |
$MESSAGE['LOGIN_PASSWORD_TOO_LONG'] = 'given password is too long'; |
101 | 101 |
$MESSAGE['LOGIN_PASSWORD_TOO_SHORT'] = 'given password is too short'; |
102 |
$MESSAGE['LOGIN_USERNAME_BLANK'] = 'Give your login name please';
|
|
102 |
$MESSAGE['LOGIN_USERNAME_BLANK'] = 'Please enter your login name';
|
|
103 | 103 |
$MESSAGE['LOGIN_USERNAME_TOO_LONG'] = 'given login name is too long'; |
104 | 104 |
$MESSAGE['LOGIN_USERNAME_TOO_SHORT'] = 'given login name is too short'; |
105 | 105 |
$MESSAGE['MAIL_GENERATED'] = 'This email is autogenerated by WebsiteBaker! Do NOT answer to this e-mail! If you need some help or you have any questions, please contact <a href="mailto:{{webmaster_email}}">Webmaster</a>'; |
... | ... | |
142 | 142 |
$MESSAGE['SIGNUP2_SUBJECT_LOGIN_INFO'] = 'Your WB account data ...'; |
143 | 143 |
$MESSAGE['SIGNUP_NO_EMAIL'] = 'Please key in your valid email address'; |
144 | 144 |
|
145 |
$MESSAGE['SIGNUP_CONFIRMED_REGISTRATION'] = "To be able to use your account, receive during the next minutes e-mail with a link to activate your account.
|
|
145 |
$MESSAGE['SIGNUP_CONFIRMED_REGISTRATION'] = "During the next minutes you will be receive an e-mail with a link to activate your account.
|
|
146 | 146 |
<br /><b>The activation must be done during 24 hours. Otherwise the account will be deleted.</b> |
147 | 147 |
"; |
148 | 148 |
$MESSAGE['SIGNUP_REGISTRATION'] = 'You get your data by e-mail!!'; |
branches/2.8.x/wb/account/languages/DE.php | ||
---|---|---|
27 | 27 |
// Array fuer alle sprachabhaengigen Textausgaben im Front- und Backend |
28 | 28 |
// Hinweis: Verwende nachfolgende Namenskonvention für die Sprachausgabe des Moduls: $MOD_MODULE_DIRECTORY |
29 | 29 |
$MOD_PREFERENCE = array( |
30 |
'PLEASE_SELECT' => 'bitte wählen',
|
|
31 |
'DETAILS_SAVED' => 'allgemeine Einstellungen geändert',
|
|
30 |
'PLEASE_SELECT' => 'bitte wählen',
|
|
31 |
'DETAILS_SAVED' => 'allgemeine Einstellungen geändert',
|
|
32 | 32 |
'SAVE_SETTINGS' => 'Einstellungen speichern', |
33 | 33 |
'SAVE_EMAIL' => 'Email speichern', |
34 | 34 |
'SAVE_PASSWORD' => 'Passwort speichern', |
... | ... | |
144 | 144 |
|
145 | 145 |
"; |
146 | 146 |
|
147 |
$MESSAGE['SIGNUP2_SUBJECT_NEW_USER'] = 'Vielen Dank für Ihre Registrierung!';
|
|
147 |
$MESSAGE['SIGNUP2_SUBJECT_NEW_USER'] = 'Vielen Dank für Ihre Registrierung!';
|
|
148 | 148 |
$MESSAGE['SIGNUP2_NEW_USER'] = 'Es wurde ein neuer User regisriert'; |
149 | 149 |
$MESSAGE['SIGNUP2_SUBJECT_LOGIN_INFO'] = 'Deine WB Logindaten ...'; |
150 | 150 |
$MESSAGE['SIGNUP_NO_EMAIL'] = 'Bitte geben Sie Ihre E-Mail Adresse an'; |
151 | 151 |
|
152 |
$MESSAGE['SIGNUP_CONFIRMED_REGISTRATION'] = "Um Ihr Konto nutzen zu können, erhalten Sie eine E-Mail mit einem Link, um Ihr Konto zu aktivieren.
|
|
153 |
<br /><b>Die Aktivierung muss innerhalb 24 Stunden erfolgen, da ansonsten das Konto wieder gelöscht wird.</b>
|
|
152 |
$MESSAGE['SIGNUP_CONFIRMED_REGISTRATION'] = "Um Ihr Konto nutzen zu können, erhalten Sie eine E-Mail mit einem Link, um Ihr Konto zu aktivieren.
|
|
153 |
<br /><b>Die Aktivierung muss innerhalb 24 Stunden erfolgen, da ansonsten das Konto wieder gelöscht wird.</b>
|
|
154 | 154 |
"; |
155 | 155 |
$MESSAGE['SIGNUP_REGISTRATION'] = 'Sie erhalten Ihre Zugangsdaten per E-Mail!!'; |
156 | 156 |
$MESSAGE['SIGNUP_NEW_USER'] = '<b>Das Konto wurde angelegt.</b>'; |
157 | 157 |
$MESSAGE['SIGNUP_ACTIVATION'] = 'Kontoaktivierung'; |
158 | 158 |
|
159 |
$TEXT['NEED_CURRENT_PASSWORD'] = 'mit aktuellem Passwort bestätigen';
|
|
159 |
$TEXT['NEED_CURRENT_PASSWORD'] = 'mit aktuellem Passwort bestätigen';
|
|
160 | 160 |
$TEXT['NEED_TO_LOGIN'] = 'Müssen Sie sich einloggen?'; |
161 | 161 |
$TEXT['NEW_PASSWORD'] = 'Neues Passwort'; |
162 | 162 |
$TEXT['PASSWORD'] = 'Kennwort'; |
branches/2.8.x/wb/account/confirm_mails.php | ||
---|---|---|
17 | 17 |
|
18 | 18 |
/* -------------------------------------------------------- */ |
19 | 19 |
// Must include code to stop this file being accessed directly |
20 |
if(defined('WB_PATH') == false)
|
|
21 |
{
|
|
22 |
die('<h2 style="color:red;margin:3em auto;text-align:center;">Cannot access this file directly</h2>');
|
|
20 |
if(!defined('WB_PATH')) {
|
|
21 |
require_once(dirname(dirname(__FILE__)).'/framework/globalExceptionHandler.php');
|
|
22 |
throw new IllegalFileException();
|
|
23 | 23 |
} |
24 | 24 |
/* -------------------------------------------------------- */ |
25 | 25 |
if (!function_exists('ObfuscateIp')) { |
... | ... | |
48 | 48 |
// load module language file |
49 | 49 |
$mLang = Translate::getInstance(); |
50 | 50 |
$mLang->enableAddon('account'); |
51 |
|
|
51 | 52 |
//WB_MAILER settings |
52 | 53 |
$sServerEmail = (defined('SERVER_EMAIL') && SERVER_EMAIL != '' ? SERVER_EMAIL : emailAdmin()); |
53 | 54 |
$sWebMailer = (defined('WBMAILER_DEFAULT_SENDERNAME') && WBMAILER_DEFAULT_SENDERNAME != '' ? WBMAILER_DEFAULT_SENDERNAME : 'WebsiteBaker Mailer'); |
55 |
$sIncludeHeadLinkCss = ''; |
|
56 |
if( is_readable(WB_PATH .'/account/frontend.css')) { |
|
57 |
$sIncludeHeadLinkCss .= '<link href="'.WB_URL.'/account/frontend.css"'; |
|
58 |
$sIncludeHeadLinkCss .= ' rel="stylesheet" type="text/css" media="screen" />'."\n"; |
|
59 |
print $sIncludeHeadLinkCss; |
|
60 |
} |
|
54 | 61 |
|
55 | 62 |
/** |
56 | 63 |
* now send user email, if activation don't failed' |
... | ... | |
79 | 86 |
|
80 | 87 |
$mail_replyto = $email_to; |
81 | 88 |
$mail_replyName = $sDisplayName; |
82 |
$mail_message = $MESSAGE['SIGNUP2_ADMIN_INFO'];
|
|
83 |
$email_subject = $MESSAGE['SIGNUP2_NEW_USER'];
|
|
89 |
$mail_message = $mLang->MESSAGE_SIGNUP2_ADMIN_INFO;
|
|
90 |
$email_subject = $mLang->MESSAGE_SIGNUP2_NEW_USER;
|
|
84 | 91 |
$search = array('{LOGIN_EMAIL}','{LOGIN_ID}', '{SIGNUP_DATE}', '{LOGIN_NAME}', '{LOGIN_IP}'); |
85 | 92 |
$replace = array($email_to, $email_fromname.' ('.$iUserId.')', date(DATE_FORMAT.' '.TIME_FORMAT,$get_ts ), $sLoginName, $sLoginIp); |
86 | 93 |
$mail_message = str_replace($search, $replace, $mail_message); |
... | ... | |
96 | 103 |
$oTpl->set_file('page', 'success.htt'); |
97 | 104 |
$oTpl->debug = false; // false, true |
98 | 105 |
$oTpl->set_block('page', 'main_block', 'main'); |
106 |
// $oTpl->parse('CSS_BLOCK', $sIncludeHeadLinkCss); |
|
99 | 107 |
// show messages, default block off |
100 | 108 |
$oTpl->set_block('main_block', 'show_registration_block', 'message'); |
101 | 109 |
$oTpl->parse('message', ''); |
branches/2.8.x/wb/account/save_signup.php | ||
---|---|---|
66 | 66 |
return false; |
67 | 67 |
} |
68 | 68 |
} |
69 |
// load module language file |
|
70 |
//$lang = (dirname(__FILE__)) . '/languages/' . LANGUAGE . '.php'; |
|
71 |
//require_once(!file_exists($lang) ? (dirname(__FILE__)) . '/languages/EN.php' : $lang ); |
|
69 | 72 |
|
70 | 73 |
//if(isset($_POST['action']) && $_POST['action']=='send') |
71 | 74 |
if($wb->StripCodeFromText($wb->get_post('action'))=='send') |
... | ... | |
102 | 105 |
// Check if username already exists |
103 | 106 |
$sql = 'SELECT `user_id` FROM `'.TABLE_PREFIX.'users` WHERE `username` = \''.$_SESSION['USERNAME'].'\''; |
104 | 107 |
if($database->get_one($sql)){ |
105 |
// $aErrorMsg[] = $MESSAGE['USERS_USERNAME_TAKEN']; |
|
106 |
msgQueue::add($MESSAGE['USERS_USERNAME_TAKEN']); |
|
108 |
msgQueue::add($mLang->MESSAGE_USERS_USERNAME_TAKEN); |
|
107 | 109 |
$_SESSION['USERNAME'] = ''; |
108 | 110 |
} else { |
109 | 111 |
if(preg_match('/^[a-z]{1}[a-z0-9_-]{3,}$/i', $_SESSION['USERNAME'])==false) { |
110 |
// $aErrorMsg[] = $MESSAGE['USERS_NAME_INVALID_CHARS']; |
|
111 |
msgQueue::add($MESSAGE['USERS_NAME_INVALID_CHARS']); |
|
112 |
msgQueue::add($mLang->MESSAGE_USERS_NAME_INVALID_CHARS); |
|
112 | 113 |
$_SESSION['USERNAME'] = ''; |
113 | 114 |
} |
114 | 115 |
} |
115 | 116 |
} else { |
116 |
// $aErrorMsg[] = $MESSAGE['LOGIN_USERNAME_BLANK']; |
|
117 |
msgQueue::add($MESSAGE['LOGIN_USERNAME_BLANK']); |
|
117 |
msgQueue::add($mLang->MESSAGE_LOGIN_USERNAME_BLANK); |
|
118 | 118 |
} |
119 | 119 |
|
120 | 120 |
// check that display_name is unique in whoole system (prevents from User-faking) |
121 | 121 |
$sql = 'SELECT COUNT(*) FROM `'.TABLE_PREFIX.'users` '; |
122 | 122 |
$sql .= 'WHERE `user_id` <> '.(int)$admin->get_user_id().' AND `display_name` LIKE "'.$wb->get_session('DISPLAY_NAME').'"'; |
123 | 123 |
if( ($iFoundUser = intval($database->get_one($sql))) > 0 ){ |
124 |
msgQueue::add($MESSAGE['USERS_USERNAME_TAKEN'].' ('.$TEXT['DISPLAY_NAME'].')'); |
|
124 |
// msgQueue::add($mLang->MESSAGE_USERS_USERNAME_TAKEN ); |
|
125 |
// $_SESSION['USERNAME'] = ''; |
|
126 |
// } else { |
|
127 |
if($wb->get_session('DISPLAY_NAME') == '') { |
|
128 |
msgQueue::add($mLang->MESSAGE_GENERIC_FILL_IN_ALL.' ('.$mLang->TEXT_DISPLAY_NAME.')'); |
|
125 | 129 |
$_SESSION['DISPLAY_NAME'] = ''; |
126 |
} else { |
|
127 |
if($wb->get_session('DISPLAY_NAME') == '') { |
|
128 |
msgQueue::add($MESSAGE['GENERIC_FILL_IN_ALL'].' ('.$TEXT['DISPLAY_NAME'].')'); |
|
129 | 130 |
} |
130 | 131 |
} |
131 | 132 |
|
... | ... | |
133 | 134 |
// Check if the email already exists |
134 | 135 |
$sql = 'SELECT `user_id` FROM `'.TABLE_PREFIX.'users` WHERE `email` = \''.$_SESSION['EMAIL'].'\''; |
135 | 136 |
if($database->get_one($sql)){ |
136 |
msgQueue::add($MESSAGE['USERS_EMAIL_TAKEN']);
|
|
137 |
msgQueue::add($mLang->MESSAGE_USERS_EMAIL_TAKEN);
|
|
137 | 138 |
$_SESSION['EMAIL'] = ''; |
138 | 139 |
} else { |
139 | 140 |
if(!$wb->validate_email($_SESSION['EMAIL'])){ |
140 |
msgQueue::add($MESSAGE['USERS_INVALID_EMAIL']);
|
|
141 |
msgQueue::add($mLang->MESSAGE_USERS_INVALID_EMAIL);
|
|
141 | 142 |
$_SESSION['EMAIL'] = ''; |
142 | 143 |
} |
143 | 144 |
} |
144 | 145 |
} else { |
145 |
msgQueue::add($MESSAGE['SIGNUP_NO_EMAIL']);
|
|
146 |
msgQueue::add($mLang->MESSAGE_SIGNUP_NO_EMAIL);
|
|
146 | 147 |
} |
147 | 148 |
|
148 |
// if($wb->get_session('DISPLAY_NAME') == "") { |
|
149 |
//// $aErrorMsg[] = $MESSAGE['GENERIC_FILL_IN_ALL']; |
|
150 |
// msgQueue::add($MESSAGE['GENERIC_FILL_IN_ALL'].' ('.$TEXT['DISPLAY_NAME'].')'); |
|
151 |
// } |
|
152 |
|
|
153 | 149 |
if(CONFIRMED_REGISTRATION) { |
154 | 150 |
$iMinPassLength = 6; |
155 | 151 |
// receive password vars and calculate needed action |
... | ... | |
163 | 159 |
$sPwHashNew = false; |
164 | 160 |
if($sNewPassword != '') { |
165 | 161 |
if(strlen($sNewPassword) < $iMinPassLength) { |
166 |
msgQueue::add($MESSAGE['USERS_PASSWORD_TOO_SHORT']);
|
|
162 |
msgQueue::add($mLang->MESSAGE_USERS_PASSWORD_TOO_SHORT);
|
|
167 | 163 |
} else { |
168 | 164 |
if($sNewPassword != $sNewPasswordRetyped) { |
169 |
msgQueue::add($MESSAGE['USERS_PASSWORD_MISMATCH']);
|
|
165 |
msgQueue::add($mLang->MESSAGE_USERS_PASSWORD_MISMATCH);
|
|
170 | 166 |
} else { |
171 | 167 |
$pattern = '/[^'.$wb->password_chars.']/'; |
172 | 168 |
if (preg_match($pattern, $sNewPassword)) { |
173 |
msgQueue::add($MESSAGE['PREFERENCES_INVALID_CHARS']);
|
|
169 |
msgQueue::add($mLang->MESSAGE_PREFERENCES_INVALID_CHARS);
|
|
174 | 170 |
}else { |
175 | 171 |
$sPwHashNew = md5($sNewPassword); |
176 | 172 |
} |
177 | 173 |
} |
178 | 174 |
} |
179 | 175 |
} else { |
180 |
msgQueue::add($MESSAGE['LOGIN_PASSWORD_BLANK']);
|
|
176 |
msgQueue::add($mLang->MESSAGE_LOGIN_PASSWORD_BLANK);
|
|
181 | 177 |
} |
182 | 178 |
|
183 | 179 |
} else { |
... | ... | |
190 | 186 |
{ |
191 | 187 |
// Check for a mismatch get email user_id |
192 | 188 |
if(!isset($_POST['captcha']) OR !isset($_SESSION['captcha']) OR $_POST['captcha'] != $_SESSION['captcha']) { |
193 |
msgQueue::add(replace_vars($MESSAGE['INCORRECT_CAPTCHA'], $aReplacement));
|
|
189 |
msgQueue::add(replace_vars($mLang->MESSAGE_INCORRECT_CAPTCHA, $aReplacement));
|
|
194 | 190 |
} |
195 | 191 |
} else { |
196 |
msgQueue::add(replace_vars($MESSAGE['INCORRECT_CAPTCHA'],$aReplacement ));
|
|
192 |
msgQueue::add(replace_vars($mLang->MESSAGE_INCORRECT_CAPTCHA,$aReplacement ));
|
|
197 | 193 |
} |
198 | 194 |
} |
199 | 195 |
if(isset($_SESSION['captcha'])) { unset($_SESSION['captcha']); } |
... | ... | |
213 | 209 |
|
214 | 210 |
if( ($msg = msgQueue::getError()) != '') { |
215 | 211 |
// back to signup_form to show errors, otherwise save user and send mail |
212 |
|
|
216 | 213 |
} else { |
217 | 214 |
$get_ip = ObfuscateIp(); |
218 | 215 |
$get_ts = time(); |
... | ... | |
268 | 265 |
} |
269 | 266 |
} else { |
270 | 267 |
$bSaveRegistration = true; |
271 |
msgQueue::add($MESSAGE['SIGNUP_NEW_USER'],true);
|
|
272 |
|
|
268 |
msgQueue::add($mLang->MESSAGE_SIGNUP_NEW_USER,true);
|
|
269 |
// send mails and check if $bSendRegistrationMailtoUser was send |
|
273 | 270 |
include(dirname(__FILE__).'/signup_mails.php'); |
274 | 271 |
|
275 | 272 |
if($bSaveRegistration && $bSendRegistrationMailtoUser) { |
276 | 273 |
// send success message to screen, no signup form |
277 | 274 |
$_SESSION['display_form'] = false; |
275 |
} else { |
|
276 |
msgQueue::add('No Activation E-Mail was send! Contact your Administrator'); |
|
278 | 277 |
} |
279 | 278 |
|
280 | 279 |
} // end success $bSaveRegistration |
branches/2.8.x/wb/account/signup_form.php | ||
---|---|---|
28 | 28 |
//require_once(!file_exists($lang) ? (dirname(__FILE__)) . '/languages/EN.php' : $lang ); |
29 | 29 |
|
30 | 30 |
require_once(WB_PATH.'/include/captcha/captcha.php'); |
31 |
|
|
32 | 31 |
include_once (WB_PATH.'/framework/functions.php'); |
33 | 32 |
|
34 | 33 |
$mLang = Translate::getinstance(); |
35 | 34 |
$mLang->enableAddon('account'); |
35 |
$oDb = WbDatabase::getInstance(); |
|
36 |
$oReg = WbAdaptor::getInstance(); |
|
37 |
// default, if no information from client available |
|
36 | 38 |
|
39 |
$aLangAddons = array(); |
|
40 |
$aLangBrowser = array(); |
|
41 |
$sAutoLanguage = 'EN'; |
|
42 |
// detect client language |
|
43 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { |
|
44 |
if(preg_match('/([a-z]{2})(?:-[a-z]{2})*/i', strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']), $matches)) { |
|
45 |
$sAutoLanguage = strtoupper($matches[1]); |
|
46 |
} |
|
47 |
} |
|
48 |
|
|
49 |
$sAutoLanguage=($wb->get_session('LANGUAGE')) ? $_SESSION['LANGUAGE'] : $sAutoLanguage; |
|
50 |
if(!defined('LANGUAGE')) { define('LANGUAGE',$sAutoLanguage);} |
|
51 |
|
|
52 |
$sIncludeHeadLinkCss = ''; |
|
53 |
if( is_readable(WB_PATH .'/account/frontend.css')) { |
|
54 |
$sIncludeHeadLinkCss .= '<link href="'.WB_URL.'/account/frontend.css"'; |
|
55 |
$sIncludeHeadLinkCss .= ' rel="stylesheet" type="text/css" media="screen" />'."\n"; |
|
56 |
print $sIncludeHeadLinkCss; |
|
57 |
} |
|
58 |
|
|
37 | 59 |
if(isset($_POST['action']) && $_POST['action']=='send') { |
38 | 60 |
require(dirname(__FILE__).'/save_signup.php'); |
39 | 61 |
} else { |
... | ... | |
48 | 70 |
|
49 | 71 |
if($_SESSION['display_form']) |
50 | 72 |
{ |
51 |
|
|
52 |
$sIncludeHeadLinkCss = ''; |
|
53 |
if( is_readable(WB_PATH .'/account/frontend.css')) { |
|
54 |
$sIncludeHeadLinkCss .= '<link href="'.WB_URL.'/account/frontend.css"'; |
|
55 |
$sIncludeHeadLinkCss .= ' rel="stylesheet" type="text/css" media="screen" />'."\n"; |
|
56 |
} |
|
57 |
|
|
58 | 73 |
// set template file and assign module and template block |
59 | 74 |
$oTpl = new Template(dirname(__FILE__).'/htt','keep'); |
60 | 75 |
$oTpl->set_file('page', 'signup.htt'); |
61 | 76 |
$oTpl->debug = false; // false, true |
62 | 77 |
$oTpl->set_block('page', 'main_block', 'main'); |
63 | 78 |
// generell vars |
79 |
|
|
64 | 80 |
$oTpl->set_var(array( |
65 | 81 |
'FTAN' => $wb->getFTAN(), |
66 | 82 |
'ACTION_URL' => WB_URL.'/account/signup.php', |
... | ... | |
120 | 136 |
) |
121 | 137 |
); |
122 | 138 |
|
123 |
|
|
124 |
$aLangAddons = array(); |
|
125 |
$aLangBrowser = array(); |
|
126 | 139 |
// read available languages from table addons |
127 | 140 |
$aLangAddons = $admin->getAvailableLanguages(); |
128 | 141 |
|
129 | 142 |
// default, if no information from client available |
130 |
$sAutoLanguage = DEFAULT_LANGUAGE;
|
|
143 |
// $sAutoLanguage = 'EN';
|
|
131 | 144 |
// detect client language |
132 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { |
|
133 |
if(preg_match('/([a-z]{2})(?:-[a-z]{2})*/i', strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']), $matches)) { |
|
134 |
$sAutoLanguage = strtoupper($matches[1]); |
|
135 |
} |
|
136 |
} |
|
137 |
|
|
138 |
$sAutoLanguage=($wb->get_session('LANGUAGE')) ? $_SESSION['LANGUAGE'] : $sAutoLanguage; |
|
145 |
// if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
|
|
146 |
// if(preg_match('/([a-z]{2})(?:-[a-z]{2})*/i', strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']), $matches)) {
|
|
147 |
// $sAutoLanguage = strtoupper($matches[1]);
|
|
148 |
// }
|
|
149 |
// }
|
|
150 |
// |
|
151 |
// $sAutoLanguage=($wb->get_session('LANGUAGE')) ? $_SESSION['LANGUAGE'] : $sAutoLanguage;
|
|
139 | 152 |
|
140 | 153 |
//$sAutoLanguage = 'NL'; |
141 | 154 |
$aLangUsed = array_flip(explode(',',$wb->getLanguagesInUsed())); |
... | ... | |
161 | 174 |
$oTpl->set_block('main_block', 'captcha_block', 'captcha'); |
162 | 175 |
if(CONFIRMED_REGISTRATION) { |
163 | 176 |
$oTpl->parse('captcha', '', true); |
177 |
// $oTpl->parse('CSS_BLOCK', $sIncludeHeadLinkCss); |
|
164 | 178 |
$oTpl->set_var(array( |
165 | 179 |
'TEXT_NEW_PASSWORD' => $mLang->TEXT_NEW_PASSWORD, |
166 | 180 |
'TEXT_RETYPE_NEW_PASSWORD' => $mLang->TEXT_RETYPE_NEW_PASSWORD, |
... | ... | |
197 | 211 |
$oTpl->set_file('page', 'success.htt'); |
198 | 212 |
$oTpl->debug = false; // false, true |
199 | 213 |
$oTpl->set_block('page', 'main_block', 'main'); |
214 |
// $oTpl->parse('CSS_BLOCK', $sIncludeHeadLinkCss); |
|
200 | 215 |
// show messages, default block off |
201 | 216 |
$oTpl->set_block('main_block', 'show_registration_block', 'message'); |
202 | 217 |
$oTpl->parse('message', ''); |
Also available in: Unified diff