Revision 2063
Added by Dietmar almost 11 years ago
- problems with confirmation mail solved
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 |
Also available in: Unified diff