24 include __DIR__ .
'/mainfile.php';
28 $xoops->events()->triggerEvent(
'core.register.start');
29 $xoops->loadLanguage(
'user');
44 array(
'op',
'string',
'register',
true),
45 array(
'uname',
'string',
'',
true),
46 array(
'email',
'string',
'',
true),
47 array(
'url',
'weburl',
'',
true),
48 array(
'pass',
'string',
'',
true),
49 array(
'vpass',
'string',
'',
true),
50 array(
'timezone_offset',
'float',
$xoopsConfig[
'default_TZ'],
false),
51 array(
'user_viewemail',
'boolean',
false,
false),
52 array(
'user_mailok',
'boolean',
false,
false),
53 array(
'agree_disc',
'boolean',
false,
false),
61 array(
'op',
'string',
'register',
true),
63 array(
'actkey',
'string',
'',
true),
91 if (!
$xoops->security()->check()) {
92 $stop .= implode(
'<br />',
$xoops->security()->getErrors()) .
"<br />";
109 echo
"<form action='register.php' method='post'>";
111 echo
"<br />" . $cpatcha->getCaption() .
": " . $cpatcha->render();
112 echo
"<input type='hidden' name='uname' value='" .
$myts->htmlSpecialChars(
$uname) .
"' />
113 <input type='hidden' name='email' value='" .
$myts->htmlSpecialChars(
$email) .
"' />
114 <input type='hidden' name='user_viewemail' value='" .
$user_viewemail .
"' />
115 <input type='hidden' name='timezone_offset' value='" . (float)
$timezone_offset .
"' />
116 <input type='hidden' name='url' value='" .
$myts->htmlSpecialChars(
$url) .
"' />
117 <input type='hidden' name='pass' value='" .
$myts->htmlSpecialChars(
$pass) .
"' />
118 <input type='hidden' name='vpass' value='" .
$myts->htmlSpecialChars(
$vpass) .
"' />
119 <input type='hidden' name='user_mailok' value='" .
$user_mailok .
"' />
120 <br /><br /><input type='hidden' name='op' value='finish' />"
121 .
$xoops->security()->getTokenHTML()
124 echo
"<span class='red'>$stop</span>";
134 if (!
$xoops->security()->check()) {
135 $stop .= implode(
'<br />',
$xoops->security()->getErrors()) .
"<br />";
138 if (!$xoopsCaptcha->verify()) {
139 $stop .= $xoopsCaptcha->getMessage() .
"<br />";
145 $newuser->setVar(
'uname',
$uname,
true);
146 $newuser->setVar(
'email',
$email,
true);
148 $newuser->setVar(
'url',
$xoops->formatURL(
$url),
true);
150 $newuser->setVar(
'user_avatar',
'blank.gif',
true);
151 $actkey = substr(md5(uniqid(mt_rand(), 1)), 0, 8);
152 $newuser->setVar(
'actkey', $actkey,
true);
153 $newuser->setVar(
'pass', password_hash(
$pass, PASSWORD_DEFAULT),
true);
155 $newuser->setVar(
'user_regdate', time(),
true);
156 $newuser->setVar(
'uorder',
$xoops->getConfig(
'com_order'),
true);
157 $newuser->setVar(
'umode',
$xoops->getConfig(
'com_mode'),
true);
158 $newuser->setVar(
'theme',
$xoops->getConfig(
'theme_set'),
true);
161 $newuser->setVar(
'level', 1,
true);
163 $newuser->setVar(
'level', 0,
true);
169 $newid = $newuser->getVar(
'uid');
184 $xoopsMailer =
$xoops->getMailer();
185 $xoopsMailer->useMail();
186 $xoopsMailer->setTemplate(
'register.tpl');
187 $xoopsMailer->assign(
'SITENAME',
$xoops->getConfig(
'sitename'));
188 $xoopsMailer->assign(
'ADMINMAIL',
$xoops->getConfig(
'adminmail'));
189 $xoopsMailer->assign(
'SITEURL',
$xoops_url .
"/");
190 $xoopsMailer->setToUsers(
new XoopsUser($newid));
191 $xoopsMailer->setFromEmail(
$xoops->getConfig(
'adminmail'));
192 $xoopsMailer->setFromName(
$xoops->getConfig(
'sitename'));
194 if (!$xoopsMailer->send()) {
203 $xoopsMailer =
$xoops->getMailer();
204 $xoopsMailer->useMail();
205 $xoopsMailer->setTemplate(
'adminactivate.tpl');
206 $xoopsMailer->assign(
'USERNAME',
$uname);
207 $xoopsMailer->assign(
'USEREMAIL',
$email);
208 $xoopsMailer->assign(
210 $xoops_url .
'/register.php?op=actv&id=' . $newid .
'&actkey=' . $actkey
212 $xoopsMailer->assign(
'SITENAME',
$xoops->getConfig(
'sitename'));
213 $xoopsMailer->assign(
'ADMINMAIL',
$xoops->getConfig(
'adminmail'));
214 $xoopsMailer->assign(
'SITEURL',
$xoops_url .
"/");
217 $xoopsMailer->setFromEmail(
$xoops->getConfig(
'adminmail'));
218 $xoopsMailer->setFromName(
$xoops->getConfig(
'sitename'));
220 if (!$xoopsMailer->send()) {
228 $xoopsMailer =
$xoops->getMailer();
229 $xoopsMailer->reset();
230 $xoopsMailer->useMail();
233 $xoopsMailer->setFromEmail(
$xoops->getConfig(
'adminmail'));
234 $xoopsMailer->setFromName(
$xoops->getConfig(
'sitename'));
235 $xoopsMailer->setSubject(
239 $xoopsMailer->send();
242 echo
"<span class='red bold'>{$stop}</span>";
254 $xoops->redirect(
'index.php', 1,
'');
259 if (!is_object($thisuser)) {
262 if ($thisuser->getVar(
'actkey') != $actkey) {
265 if ($thisuser->getVar(
'level') > 0) {
272 $xoopsMailer =
$xoops->getMailer();
273 $xoopsMailer->useMail();
274 $xoopsMailer->setTemplate(
'activated.tpl');
275 $xoopsMailer->assign(
'SITENAME',
$xoops->getConfig(
'sitename'));
276 $xoopsMailer->assign(
'ADMINMAIL',
$xoops->getConfig(
'adminmail'));
277 $xoopsMailer->assign(
'SITEURL',
$xoops_url .
"/");
278 $xoopsMailer->setToUsers($thisuser);
279 $xoopsMailer->setFromEmail(
$xoops->getConfig(
'adminmail'));
280 $xoopsMailer->setFromName(
$xoops->getConfig(
'sitename'));
281 $xoopsMailer->setSubject(
285 if (!$xoopsMailer->send()) {
const EMAIL_HAS_BEEN_SENT_WITH_ACTIVATION_KEY
if($uname== ''||$pass== '') $member_handler
const SF_NOTIFICATION_EMAIL_SENT_TO
const F_HAS_JUST_REGISTERED
const E_SELECTED_ACCOUNT_IS_ALREADY_ACTIVATED
const E_ACTIVATION_FAILED
const PLEASE_WAIT_FOR_ACCOUNT_ACTIVATION
const EMAIL_HAS_NOT_BEEN_SENT_WITH_ACTIVATION_KEY
if(empty($xoopsConfigUser['allow_register'])) $clean_input
const LOGIN_WITH_REGISTERED_PASSWORD
const E_YOU_HAVE_TO_AGREE_TO_DISCLAIMER
const E_WE_ARE_CLOSED_FOR_REGISTRATION
const E_USER_NOT_REGISTERED
static sendWelcome($user)
const F_USER_ACTIVATION_KEY_FOR
const S_YOU_ARE_NOW_REGISTERED
const F_NEW_USER_REGISTRATION_AT
const S_YOUR_ACCOUNT_ACTIVATED
const E_ACTIVATION_KEY_INCORRECT
const EF_NOTIFICATION_EMAIL_NOT_SENT_TO