Well anyone can look at the 2.3 register.php file but here you go, lines 28 - 220
//$xoopsOption['pagetype'] = 'user';
include 'mainfile.php';
$module_handler = xoops_gethandler('module');
$profile_module = $module_handler->getByDirname('profile');
if ($profile_module && $profile_module->getVar('isactive')) {
header("location: ./modules/profile/register.php" . (empty($_SERVER['QUERY_STRING']) ? "" : "?" . $_SERVER['QUERY_STRING']) );
exit();
}
xoops_loadLanguage('user');
xoops_load("userUtility");
$myts =& MyTextSanitizer::getInstance();
$config_handler =& xoops_gethandler('config');
$xoopsConfigUser = $config_handler->getConfigsByCat(XOOPS_CONF_USER);
if (empty($xoopsConfigUser['allow_register'])) {
redirect_header('index.php', 6, _US_NOREGISTER);
exit();
}
function userCheck($uname, $email, $pass, $vpass)
{
trigger_error("Function " . __FUNCTION__ . " is deprecated, use XoopsUserUtility::validate() instead", E_USER_WARNING);
return XoopsUserUtility::validate($uname, $email, $pass, $vpass);
}
$op = isset($_POST['op']) ? $_POST['op'] : ( isset($_GET["op"]) ? $_GET["op"] : 'register' );
$uname = isset($_POST['uname']) ? $myts->stripSlashesGPC($_POST['uname']) : '';
$email = isset($_POST['email']) ? trim($myts->stripSlashesGPC($_POST['email'])) : '';
$url = isset($_POST['url']) ? trim($myts->stripSlashesGPC($_POST['url'])) : '';
$pass = isset($_POST['pass']) ? $myts->stripSlashesGPC($_POST['pass']) : '';
$vpass = isset($_POST['vpass']) ? $myts->stripSlashesGPC($_POST['vpass']) : '';
$timezone_offset = isset($_POST['timezone_offset']) ? intval($_POST['timezone_offset']) : $xoopsConfig['default_TZ'];
$user_viewemail = (isset($_POST['user_viewemail']) && intval($_POST['user_viewemail'])) ? 1 : 0;
$user_mailok = (isset($_POST['user_mailok']) && intval($_POST['user_mailok'])) ? 1 : 0;
$agree_disc = (isset($_POST['agree_disc']) && intval($_POST['agree_disc'])) ? 1 : 0;
switch ( $op ) {
case 'newuser':
include 'header.php';
$stop = '';
if (!$GLOBALS['xoopsSecurity']->check()) {
$stop .= implode('
', $GLOBALS['xoopsSecurity']->getErrors())."
";
}
if ($xoopsConfigUser['reg_dispdsclmr'] != 0 && $xoopsConfigUser['reg_disclaimer'] != '') {
if (empty($agree_disc)) {
$stop .= _US_UNEEDAGREE.'
';
}
}
$stop .= XoopsUserUtility::validate($uname, $email, $pass, $vpass);
if (empty($stop)) {
echo _US_USERNAME.": ".$myts->htmlSpecialChars($uname)."
";
echo _US_EMAIL.": ".$myts->htmlSpecialChars($email)."
";
if ($url != '') {
$url = formatURL($url);
echo _US_WEBSITE.': '.$myts->htmlSpecialChars($url).'
';
}
$f_timezone = ($timezone_offset < 0) ? 'GMT '.$timezone_offset : 'GMT +'.$timezone_offset;
echo _US_TIMEZONE.": $f_timezone
";
echo ";
xoops_load("XoopsFormCaptcha");
$cpatcha = new XoopsFormCaptcha();
echo "
".$cpatcha->getCaption().": ".$cpatcha->render();
echo "
.$myts->htmlSpecialChars($uname)."' />
.$myts->htmlSpecialChars($email)."' />";
echo ".$user_viewemail."' />
.(float)$timezone_offset."' />
.$myts->htmlSpecialChars($url)."' />
.$myts->htmlSpecialChars($pass)."' />
.$myts->htmlSpecialChars($vpass)."' />
.$user_mailok."' />
".$GLOBALS['xoopsSecurity']->getTokenHTML().". _US_FINISH ."' />";
} else {
echo "$stop";
include 'include/registerform.php';
$reg_form->display();
}
include 'footer.php';
break;
case 'finish':
include 'header.php';
$stop = XoopsUserUtility::validate($uname, $email, $pass, $vpass);
if (!$GLOBALS['xoopsSecurity']->check()) {
$stop .= implode('
', $GLOBALS['xoopsSecurity']->getErrors()) . "
";
}
xoops_load("captcha");
$xoopsCaptcha = XoopsCaptcha::getInstance();
if( !$xoopsCaptcha->verify() ) {
$stop .= $xoopsCaptcha->getMessage()."
";
}
if ( empty($stop) ) {
$member_handler =& xoops_gethandler('member');
$newuser =& $member_handler->createUser();
$newuser->setVar('user_viewemail',$user_viewemail, true);
$newuser->setVar('uname', $uname, true);
$newuser->setVar('email', $email, true);
if ($url != '') {
$newuser->setVar('url', formatURL($url), true);
}
$newuser->setVar('user_avatar','blank.gif', true);
$actkey = substr(md5(uniqid(mt_rand(), 1)), 0, 8);
$newuser->setVar('actkey', $actkey, true);
$newuser->setVar('pass', md5($pass), true);
$newuser->setVar('timezone_offset', $timezone_offset, true);
$newuser->setVar('user_regdate', time(), true);
$newuser->setVar('uorder',$xoopsConfig['com_order'], true);
$newuser->setVar('umode',$xoopsConfig['com_mode'], true);
$newuser->setVar('user_mailok',$user_mailok, true);
if ($xoopsConfigUser['activation_type'] == 1) {
$newuser->setVar('level', 1, true);
}
if (!$member_handler->insertUser($newuser)) {
echo _US_REGISTERNG;
include 'footer.php';
exit();
}
$newid = $newuser->getVar('uid');
if (!$member_handler->addUserToGroup(XOOPS_GROUP_USERS, $newid)) {
echo _US_REGISTERNG;
include 'footer.php';
exit();
}
if ($xoopsConfigUser['activation_type'] == 1) {
XoopsUserUtility::sendWelcome($newuser);
redirect_header('index.php', 4, _US_ACTLOGIN);
exit();
}
// Sending notification email to user for self activation
if ($xoopsConfigUser['activation_type'] == 0) {
$xoopsMailer =& xoops_getMailer();
$xoopsMailer->useMail();
$xoopsMailer->setTemplate('register.tpl');
$xoopsMailer->assign('SITENAME', $xoopsConfig['sitename']);
$xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']);
$xoopsMailer->assign('SITEURL', XOOPS_URL."/");
$xoopsMailer->setToUsers(new XoopsUser($newid));
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
$xoopsMailer->setFromName($xoopsConfig['sitename']);
$xoopsMailer->setSubject(sprintf(_US_USERKEYFOR, $uname));
if ( !$xoopsMailer->send() ) {
echo _US_YOURREGMAILNG;
} else {
echo _US_YOURREGISTERED;
}
// Sending notification email to administrator for activation
} elseif ($xoopsConfigUser['activation_type'] == 2) {
$xoopsMailer =& xoops_getMailer();
$xoopsMailer->useMail();
$xoopsMailer->setTemplate('adminactivate.tpl');
$xoopsMailer->assign('USERNAME', $uname);
$xoopsMailer->assign('USEREMAIL', $email);
$xoopsMailer->assign('USERACTLINK', XOOPS_URL.'/register.php?op=actv&id='.$newid.'&actkey='.$actkey);
$xoopsMailer->assign('SITENAME', $xoopsConfig['sitename']);
$xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']);
$xoopsMailer->assign('SITEURL', XOOPS_URL."/");
$member_handler =& xoops_gethandler('member');
$xoopsMailer->setToGroups($member_handler->getGroup($xoopsConfigUser['activation_group']));
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
$xoopsMailer->setFromName($xoopsConfig['sitename']);
$xoopsMailer->setSubject(sprintf(_US_USERKEYFOR, $uname));
if ( !$xoopsMailer->send() ) {
echo _US_YOURREGMAILNG;
} else {
echo _US_YOURREGISTERED2;
}
}
if ($xoopsConfigUser['new_user_notify'] == 1 && !empty($xoopsConfigUser['new_user_notify_group'])) {
$xoopsMailer =& xoops_getMailer();
$xoopsMailer->useMail();
$member_handler =& xoops_gethandler('member');
$xoopsMailer->setToGroups($member_handler->getGroup($xoopsConfigUser['new_user_notify_group']));
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
$xoopsMailer->setFromName($xoopsConfig['sitename']);
$xoopsMailer->setSubject(sprintf(_US_NEWUSERREGAT,$xoopsConfig['sitename']));
$xoopsMailer->setBody(sprintf(_US_HASJUSTREG, $uname));
$xoopsMailer->send();
}
} else {
echo "$stop";
include 'include/registerform.php';
$reg_form->display();
}
include 'footer.php';
break;
case 'actv':
case 'activate':