1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 11:50:30 +02:00

First cut of mods to signup to share validation with other user-centric modules

This commit is contained in:
e107steved
2008-12-21 22:17:05 +00:00
parent 1c428e1d5a
commit 0c5462b757
13 changed files with 460 additions and 613 deletions

View File

@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/class2.php,v $
| $Revision: 1.87 $
| $Date: 2008-12-21 11:07:58 $
| $Revision: 1.88 $
| $Date: 2008-12-21 22:17:05 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
@@ -638,7 +638,6 @@ $e107->override = new override;
$override = &$e107->override;
e107_require_once(e_HANDLER.'userclass_class.php');
$e107->e_userclass = new e_userclass;
$e107->user_class = new user_class;
$e_userclass = &$e107->user_class;

View File

@@ -9,8 +9,8 @@
* Administration Area - Users
*
* $Source: /cvs_backup/e107_0.8/e107_admin/users.php,v $
* $Revision: 1.19 $
* $Date: 2008-12-21 16:19:29 $
* $Revision: 1.20 $
* $Date: 2008-12-21 22:17:05 $
* $Author: e107steved $
*
*/
@@ -609,14 +609,6 @@ class users
$search_display = explode("|",$pref['admin_user_disp']);
}
if ($sql->db_Select("userclass_classes"))
{
while ($row = $sql->db_Fetch())
{
$class[$row['userclass_id']] = $tp->toHTML($row['userclass_name'],"","defs,emotes_off, no_make_clickable");
}
}
$text = "<div style='text-align:center'>";
if (isset($_POST['searchquery']) && $_POST['searchquery'] != "")
@@ -721,7 +713,7 @@ class users
$tmp = explode(",", $user_class);
while (list($key, $class_id) = each($tmp))
{
$text .= ($class[$class_id] ? $class[$class_id]."<br />\n" : "");
$text .= $e107->user_class->uc_get_classname($class_id)."<br />\n";
}
}
else

View File

@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_files/shortcode/batch/signup_shortcodes.php,v $
| $Revision: 1.12 $
| $Date: 2008-12-21 10:54:31 $
| $Revision: 1.13 $
| $Date: 2008-12-21 22:17:05 $
| $Author: e107steved $
|
| Mods to show extended field categories
@@ -24,7 +24,7 @@ $signup_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
/*
SC_BEGIN SIGNUP_COPPA_FORM
if (strpos(LAN_109, "stage") !== FALSE)
if (strpos(LAN_SIGNUP_77, "stage") !== FALSE)
{
return "";
}
@@ -33,10 +33,10 @@ else
return "
<form method='post' action='".e_SELF."?stage1' >\n
<div><br />
<input type='radio' name='coppa' value='0' checked='checked' /> ".LAN_200."
<input type='radio' name='coppa' value='1' /> ".LAN_201."<br />
<input type='radio' name='coppa' value='0' checked='checked' /> ".LAN_NO."
<input type='radio' name='coppa' value='1' /> ".LAN_YES."<br />
<br />
<input class='button' type='submit' name='newver' value=\"".LAN_399."\" />
<input class='button' type='submit' name='newver' value=\"".LAN_CONTINUE."\" />
</div></form>
";
}
@@ -84,7 +84,7 @@ global $pref, $rs;
if (check_class($pref['displayname_class']))
{
$dis_name_len = varset($pref['displayname_maxlength'],15);
return $rs->form_text("name", $dis_name_len+5, ($_POST['name'] ? $_POST['name'] : $name), $dis_name_len);
return $rs->form_text('username', $dis_name_len+5, ($_POST['username'] ? $_POST['username'] : $username), $dis_name_len);
}
SC_END
@@ -139,12 +139,12 @@ SC_END
SC_BEGIN SIGNUP_HIDE_EMAIL
global $rs;
$default_email_setting = 1; // Gives option of turning into a pref later if wanted
return $rs->form_radio("hideemail", 1, $default_email_setting==1)." ".LAN_SIGNUP_10."&nbsp;&nbsp;".$rs->form_radio("hideemail", 0,$default_email_setting==0)." ".LAN_200;
return $rs->form_radio("hideemail", 1, $default_email_setting==1)." ".LAN_YES."&nbsp;&nbsp;".$rs->form_radio("hideemail", 0,$default_email_setting==0)." ".LAN_NO;
SC_END
SC_BEGIN SIGNUP_USERCLASS_SUBSCRIBE
global $pref, $e_userclass, $USERCLASS_SUBSCRIBE_START, $USERCLASS_SUBSCRIBE_END;
global $pref, $e_userclass, $USERCLASS_SUBSCRIBE_START, $USERCLASS_SUBSCRIBE_END, $signupData;
$ret = "";
if($pref['signup_option_class'])
{
@@ -160,13 +160,15 @@ if($pref['signup_option_class'])
function show_signup_class($treename, $classnum, $current_value, $nest_level)
{
global $USERCLASS_SUBSCRIBE_ROW, $e_userclass, $tp;
$search = array('{USERCLASS_ID}', '{USERCLASS_NAME}', '{USERCLASS_DESCRIPTION}', '{USERCLASS_INDENT}');
$tmp = explode(',',$current_value);
$search = array('{USERCLASS_ID}', '{USERCLASS_NAME}', '{USERCLASS_DESCRIPTION}', '{USERCLASS_INDENT}', '{USERCLASS_CHECKED}');
$replace = array($classnum, $tp->toHTML($e_userclass->uc_get_classname($classnum), FALSE, 'defs'),
$tp->toHTML($e_userclass->uc_get_classdescription($classnum), FALSE, 'defs'), " style='text-indent:".(1.2*$nest_level)."em'");
$tp->toHTML($e_userclass->uc_get_classdescription($classnum), FALSE, 'defs'), " style='text-indent:".(1.2*$nest_level)."em'",
( in_array($classnum, $tmp) ? " checked='checked'" : ''));
return str_replace($search, $replace, $USERCLASS_SUBSCRIBE_ROW);
}
$ret = $USERCLASS_SUBSCRIBE_START;
$ret .= $e_userclass->vetted_tree('class',show_signup_class,'','editable');
$ret .= $e_userclass->vetted_tree('class',show_signup_class,varset($signupData['user_class'],''),'editable');
$ret .= $USERCLASS_SUBSCRIBE_END;
return $ret;
}

View File

@@ -12,8 +12,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_handlers/admin_log_class.php,v $
| $Revision: 1.13 $
| $Date: 2008-12-07 11:45:02 $
| $Revision: 1.14 $
| $Date: 2008-12-21 22:17:05 $
| $Author: e107steved $
To do:
@@ -161,6 +161,19 @@ Generic log entry point
$importance = $tp->toDB($importance,true,false,'no_html');
$eventcode = $tp->toDB($eventcode,true,false,'no_html');
if (is_array($explain))
{
$line = '';
$spacer = '';
foreach ($explain as $k => $v)
{
$line .= $spacer.$k.'=>'.$v;
$spacer = '[!br!]';
}
$explain = $line;
unset($line);
}
$explain = mysql_real_escape_string($tp->toDB($explain,true,false,'no_html'));
$event_title = $tp->toDB($event_title,true,false,'no_html');
@@ -211,10 +224,10 @@ Generic log entry point
$tmp = $source_call[$i]['file']."|".$source_call[$i]['class'].$source_call[$i]['type'].$source_call[$i]['function']."@".$source_call[$i]['line'];
foreach ($source_call[$i]['args'] as $k => $v)
{ // Add in the arguments
$explain .= "<br />".$k."=".$v;
$explain .= "[!br!]".$k."=".$v;
}
$i++;
if ($i < $back_count) $explain .= "<br />-------------------";
if ($i < $back_count) $explain .= "[!br!]-------------------";
if (!isset($tmp1)) $tmp1 = $tmp; // Pick off the immediate caller as the source
}
if (isset($tmp1)) $source_call = $tmp1; else $source_call = 'Root level';

View File

@@ -9,8 +9,8 @@
* Handler - user-related functions
*
* $Source: /cvs_backup/e107_0.8/e107_handlers/user_handler.php,v $
* $Revision: 1.3 $
* $Date: 2008-12-21 11:07:58 $
* $Revision: 1.4 $
* $Date: 2008-12-21 22:17:05 $
* $Author: e107steved $
*
*/
@@ -89,7 +89,7 @@ class UserHandler
'user_password' => array('niceName'=> LAN_USER_05, 'vetMethod' => '0', 'vetParam' => '', 'srcName' => 'password1', 'minLength' => varset($pref['signup_pass_len'],1)),
'user_sess' => array('niceName'=> LAN_USER_06, 'vetMethod' => '0', 'vetParam' => '', 'dbClean' => 'toDB'), // Photo
'user_image' => array('niceName'=> LAN_USER_07, 'vetMethod' => '0', 'vetParam' => '', 'srcName' => 'image', 'dbClean' => 'toDB'), // Avatar
'user_email' => array('niceName'=> LAN_USER_08, 'vetMethod' => '1', 'vetParam' => '', 'srcName' => 'email', 'dbClean' => 'toDB'),
'user_email' => array('niceName'=> LAN_USER_08, 'vetMethod' => '1,3', 'vetParam' => '', 'srcName' => 'email', 'dbClean' => 'toDB'),
'user_signature' => array('niceName'=> LAN_USER_09, 'vetMethod' => '0', 'vetParam' => '', 'srcName' => 'signature', 'dbClean' => 'toDB'),
'user_hideemail' => array('niceName'=> LAN_USER_10, 'vetMethod' => '0', 'vetParam' => '', 'srcName' => 'hideemail', 'dbClean' => 'intval'),
'user_xup' => array('niceName'=> LAN_USER_11, 'vetMethod' => '0', 'vetParam' => '', 'srcName' => 'user_xup', 'dbClean' => 'toDB'),
@@ -414,7 +414,7 @@ class UserHandler
DB signup usersettings quick add function
------------------------------------------------------------------------------
user_id - user_id - Unique user ID
user_name name username username Display name
user_name name$ username username Display name
user_loginname loginname loginname loginname User name (login name)
user_customtitle - customtitle - Custom title
user_password password1 password1 password1 Password (prior to encoding)
@@ -426,11 +426,12 @@ class UserHandler
user_image image image* - Avatar (may be external URL or file on server)
user_hideemail hideemail hideemail - Flag to hide user's email address
user_login realname realname realname User Real name
user_xup xupexist user_xup - XUP file link
user_xup xupexist$ user_xup - XUP file link
user_class class class userclass User class (array on form)
user_loginname may be auto-generated
* avatar (user_image) and photo (user_sess) may be uploaded files
$changed to match the majority vote
Following fields auto-filled in code as required:
user_join

View File

@@ -9,8 +9,8 @@
* Handler - general purpose validation functions
*
* $Source: /cvs_backup/e107_0.8/e107_handlers/validator_class.php,v $
* $Revision: 1.1 $
* $Date: 2008-12-21 11:07:58 $
* $Revision: 1.2 $
* $Date: 2008-12-21 22:17:05 $
* $Author: e107steved $
*
*/
@@ -34,6 +34,7 @@ define('ERR_FIELDS_DIFFERENT', '15');
define('ERR_CODE_ERROR', '16');
define('ERR_TOO_LOW', '17');
define('ERR_TOO_HIGH', '18');
define('ERR_GENERIC', '19'); // This requires coder-defined error text
/*
@@ -177,6 +178,7 @@ class validatorClass
{
$errNum = ERR_ARRAY_EXPECTED;
}
break;
default :
$errNum = ERR_CODE_ERROR; // Pick up bad values
}
@@ -230,6 +232,7 @@ class validatorClass
0 - Null method
1 - Check for duplicates - field name in table must be the same as array index unless 'dbFieldName' specifies otherwise
2 - Check against the comma-separated wordlist in the $pref named in vetParam['signup_disallow_text']
3 - Check email address against remote server, only if option enabled
*/
function dbValidateArray(&$targetData, &$definitions, $targetTable, $userID = 0)
@@ -281,6 +284,23 @@ class validatorClass
unset($tmp);
}
break;
case 3 : // Check email address against remote server
if (varsettrue($pref['signup_remote_emailcheck']))
{
require_once(e_HANDLER."mail_validation_class.php");
list($adminuser,$adminhost) = split ("@", SITEADMINEMAIL);
$validator = new email_validation_class;
$validator->localuser= $adminuser;
$validator->localhost= $adminhost;
$validator->timeout=3;
// $validator->debug=1;
// $validator->html_debug=1;
if($validator->ValidateEmailBox(trim($v)) != 1)
{
$errMsg = ERR_INVALID_EMAIL;
}
}
break;
default :
echo 'Invalid vetMethod: '.$options['vetMethod'].'<br />'; // Really a debug aid - should never get here
}
@@ -356,7 +376,14 @@ class validatorClass
{
$curLine = $format;
$curLine = str_replace('%n', $n, $curLine);
$curLine = str_replace('%t', constant($constPrefix.$n), $curLine);
if (($n == ERR_GENERIC) && isset($vars['errortext'][$f]))
{
$curLine = str_replace('%t', $vars['errortext'][$f], $curLine); // Coder-defined specific error text
}
else
{
$curLine = str_replace('%t', constant($constPrefix.$n), $curLine); // Standard messages
}
$curLine = str_replace('%v', $vars['failed'][$f],$curLine); // Possibly this should have some protection added
$curLine = str_replace('%f', $f, $curLine);
if ($checkNice & isset($niceNames[$f]['niceName']))

View File

@@ -4,8 +4,8 @@
| e107 website system - Language File.
|
| $Source: /cvs_backup/e107_0.8/e107_languages/English/English.php,v $
| $Revision: 1.7 $
| $Date: 2008-11-09 18:00:32 $
| $Revision: 1.8 $
| $Date: 2008-12-21 22:17:05 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
@@ -50,11 +50,12 @@ define("CORE_LAN_GB", "GB");
define("CORE_LAN_TB", "TB");
define("LAN_WARNING", "Warning!");
define("LAN_ERROR", "Error");
define("LAN_ANONYMOUS", "Anonymous");
define("LAN_EMAIL_SUBS", "-email-");
define('LAN_WARNING', 'Warning!');
define('LAN_ERROR', 'Error');
define('LAN_ANONYMOUS', 'Anonymous');
define('LAN_EMAIL_SUBS', '-email-');
define('LAN_YES', 'Yes');
define('LAN_NO', 'No');
define('LAN_CONTINUE', 'Continue');
?>

View File

@@ -9,51 +9,29 @@
* Language file - User signup
*
* $Source: /cvs_backup/e107_0.8/e107_languages/English/lan_signup.php,v $
* $Revision: 1.13 $
* $Date: 2008-12-21 11:07:58 $
* $Revision: 1.14 $
* $Date: 2008-12-21 22:17:05 $
* $Author: e107steved $
*
*/
define("PAGE_NAME", "Register");
define("LAN_7", "Display Name: ");
define("LAN_8", "the name that will be displayed on site");
define("LAN_9", "Username: ");
define("LAN_10", "the name that you use to login");
define("LAN_17", "Password: ");
define("LAN_103", "That username cannot be accepted as valid, please choose a different user name");
define("LAN_104", "That username already exists in the database, please choose a different username");
define("LAN_105", "The two passwords do not match");
define("LAN_106", "That doesn't appear to be a valid email address");
define("LAN_107", "Thank you! You are now a registered member of");
/*
//define("LAN_103", "That username cannot be accepted as valid, please choose a different user name");
//define("LAN_104", "That username already exists in the database, please choose a different username");
//define("LAN_105", "The two passwords do not match");
//define("LAN_106", "That doesn't appear to be a valid email address");
define("LAN_108", "Registration complete");
define("LAN_109", "This site complies with The Children's Online Privacy Protection Act of 1998 (COPPA) and as such cannot accept registrations from users under the age of 13 without a written permission document from their parent or guardian. For more information you can read the legislation");
define("LAN_110", "Registration");
define("LAN_111", "Re-type Password: ");
define("LAN_112", "Email Address: ");
define("LAN_113", "Hide email address?: ");
define("LAN_114", "This will prevent your email address from being displayed on site");
define("LAN_123", "Register");
define("LAN_185", "You left required field(s) blank");
define("LAN_201", "Yes");
define("LAN_200", "No");
define("LAN_202", "You have reached the site limit for account registrations. Please login using one of your other accounts.");
define("LAN_309", "Please enter your details below.");
define("LAN_310", "your real name, including first and last name");
define("LAN_399", "Continue");
define("LAN_400", "Usernames and passwords are <b>case-sensitive</b>.");
define("LAN_401", "Your account has now been activated, please");
define("LAN_402", "Registration activated");
define("LAN_403", "Welcome to");
define("LAN_404", "Registration details for");
define("LAN_405", "This stage of registration is complete. You will receive a confirmation email containing your login details. Please follow the link in the email to complete the signup process and activate your account.");
define("LAN_406", "Thank you!");
define("LAN_407", "Please keep this email for your own information. Your password has been encrypted and cannot be retrieved if you misplace or forget it. You can however request a new password if this happens.\n\nThanks for your registration.\n\nFrom");
define("LAN_408", "A user with that email address already exists. Please use the 'forgot password' screen to retrieve your password.");
define("LAN_409", "Invalid characters in username");
define("LAN_410", "Enter code visible in the image");
define("LAN_411", "That display name already exists in the database, please choose a different display name");
//define("LAN_408", "A user with that email address already exists. Please use the 'forgot password' screen to retrieve your password.");
//define("LAN_409", "Invalid characters in username");
//define("LAN_411", "That display name already exists in the database, please choose a different display name");
*/
define("LAN_EMAIL_01", "Dear");
define("LAN_EMAIL_04", "Please keep this email for your own information.");
@@ -70,7 +48,7 @@ define("LAN_SIGNUP_6", "Your ");
define("LAN_SIGNUP_7", " is required");
define("LAN_SIGNUP_8", "Thank you!");
define("LAN_SIGNUP_9", "Unable to proceed.");
define("LAN_SIGNUP_10", "Yes");
//define("LAN_SIGNUP_10", "Yes");
define("LAN_SIGNUP_11", ".");
define("LAN_SIGNUP_12", "please keep your username and password written down in a safe place as if lost they cannot be retrieved.");
define("LAN_SIGNUP_13", "You can now log in from the Login box, or from <a href='".e_BASE."login.php'>here</a>.");
@@ -114,9 +92,9 @@ define("LAN_SIGNUP_51", "Old Password");
define("LAN_SIGNUP_52", "Incorrect Password");
define("LAN_SIGNUP_53", "field failed validation test");
define("LAN_SIGNUP_54", "Click here to fill in your details to register");
define("LAN_SIGNUP_55", "That display name is too long. Please choose another");
define("LAN_SIGNUP_56", "That display name is too short. Please choose another");
define("LAN_SIGNUP_57", "That login name is too long. Please choose another");
//define("LAN_SIGNUP_55", "That display name is too long. Please choose another");
//define("LAN_SIGNUP_56", "That display name is too short. Please choose another");
//define("LAN_SIGNUP_57", "That login name is too long. Please choose another");
define("LAN_SIGNUP_58", "Signup Preview");
define("LAN_SIGNUP_59","**** If the link doesn't work, please check that part of it has not overflowed onto the next line. ****");
define('LAN_SIGNUP_60','Signup email resend requested');
@@ -127,9 +105,38 @@ define('LAN_SIGNUP_64','That doesn\'t appear to be valid user information');
define('LAN_SIGNUP_65','You have been assigned the following login name');
define('LAN_SIGNUP_66','Please make a note of it.');
define('LAN_SIGNUP_67','This will be assigned by the system after signup');
define('LAN_SIGNUP_68','');
define('LAN_SIGNUP_68','Error: Unable to open remote XUP file');
define('LAN_SIGNUP_69','');
define('LAN_SIGNUP_70','');
define('LAN_SIGNUP_71', 'You have reached the site limit for account registrations. Please login using one of your other accounts.'); // LAN_202
define('LAN_SIGNUP_72', "This stage of registration is complete. You will receive a confirmation email containing your login details. Please follow the link in the email to complete the signup process and activate your account."); // LAN_405
define('LAN_SIGNUP_73', 'Thank you!'); // LAN_406
define('LAN_SIGNUP_74', 'Your account has now been activated, please'); // LAN_401
define('LAN_SIGNUP_75', 'Registration activated'); // LAN_402
define('LAN_SIGNUP_76', 'Thank you! You are now a registered member of'); // LAN_107
define('LAN_SIGNUP_77', "This site complies with The Children's Online Privacy Protection Act of 1998 (COPPA) and as such cannot accept registrations from users under the age of 13 without a written permission document from their parent or guardian. For more information you can read the legislation"); // LAN_109
define('LAN_SIGNUP_78', 'Registration'); // LAN_110
define('LAN_SIGNUP_79', 'Register'); // LAN_123
define('LAN_SIGNUP_80', 'Please enter your details below.'); // LAN_309
define('LAN_SIGNUP_81', 'Username: '); // LAN_9
define('LAN_SIGNUP_82', 'the name that you use to login'); // LAN_10
define('LAN_SIGNUP_83', 'Password: '); // LAN_17
define('LAN_SIGNUP_84', 'Re-type Password: '); // LAN_111
define('LAN_SIGNUP_85', 'Usernames and passwords are <b>case-sensitive</b>.'); // LAN_400
define('LAN_SIGNUP_86', 'Email Address: '); // LAN_112
define('LAN_SIGNUP_87', 'Hide email address?: '); // LAN_113
//define('LAN_SIGNUP_88', 'This will prevent your email address from being displayed on site'); // LAN_114
define('LAN_SIGNUP_89', 'Display Name: '); // LAN_7
define('LAN_SIGNUP_90', 'the name that will be displayed on site'); // LAN_8
define('LAN_SIGNUP_91', 'Real Name: '); // LAN_308
define('LAN_SIGNUP_92', 'your real name, including first and last name'); // LAN_310
define('LAN_SIGNUP_93', 'Signature: '); // LAN_120
define('LAN_SIGNUP_94', 'Avatar: '); // LAN_121
define('LAN_SIGNUP_95', 'Enter code visible in the image'); // LAN_410
define('LAN_SIGNUP_96', 'Registration details for'); // LAN_404 (used in email)
define('LAN_SIGNUP_97', 'Welcome to'); // LAN_403 (used in email)
define("LAN_LOGINNAME", "Username");
define("LAN_PASSWORD", "Password");

View File

@@ -9,8 +9,8 @@
* Language file - user-related (many generic definitions)
*
* $Source: /cvs_backup/e107_0.8/e107_languages/English/lan_user.php,v $
* $Revision: 1.2 $
* $Date: 2008-12-20 20:19:05 $
* $Revision: 1.3 $
* $Date: 2008-12-21 22:17:05 $
* $Author: e107steved $
*
*/
@@ -21,7 +21,6 @@ define("LAN_116", "AIM Address");
define("LAN_117", "MSN Messenger");
define("LAN_118", "Birthday");
define("LAN_119", "Location");
define("LAN_120", "Signature");
define("LAN_144", "Website URL");
define("LAN_405", "days ago");
define("LAN_407", "none");
@@ -99,25 +98,31 @@ define('LAN_USER_67', 'Chatbox posts'); // LAN_147
define('LAN_USER_68', 'Comments posted'); // LAN_148
define('LAN_USER_69', 'Forum posts'); // LAN_149
define('LAN_USER_70', 'Show'); // LAN_419
define('LAN_USER_71', 'Signature'); // LAN_120
define('LAN_USER_72', 'Avatar: '); // LAN_121
// Error messages for when user data is missing
define('USER_ERR_01','Missing value');
define('USER_ERR_02','Unexpected value');
define('USER_ERR_03','Value contains invalid characters');
define('USER_ERR_04','Value too short');
define('USER_ERR_05','Value too long');
define('USER_ERR_06','Duplicate value');
define('USER_ERR_07','Value not allowed');
define('USER_ERR_08','Entry disabled');
define('USER_ERR_09','Invalid word');
define('USER_ERR_10','Password fields different');
define('USER_ERR_11','Banned email address');
define('USER_ERR_12','Invalid format for email address');
define('USER_ERR_13','Data error');
define('USER_ERR_14','Banned user');
define('USER_ERR_15','User name and display name cannot be different');
// Error messages for when user data is missing. Done this way so that other code can override the default messages
if (!defined('USER_ERR_01')) { define('USER_ERR_01','Missing value'); }
if (!defined('USER_ERR_02')) { define('USER_ERR_02','Unexpected value'); }
if (!defined('USER_ERR_03')) { define('USER_ERR_03','Value contains invalid characters'); }
if (!defined('USER_ERR_04')) { define('USER_ERR_04','Value too short'); }
if (!defined('USER_ERR_05')) { define('USER_ERR_05','Value too long'); }
if (!defined('USER_ERR_06')) { define('USER_ERR_06','Duplicate value'); }
if (!defined('USER_ERR_07')) { define('USER_ERR_07','Value not allowed'); }
if (!defined('USER_ERR_08')) { define('USER_ERR_08','Entry disabled'); }
if (!defined('USER_ERR_09')) { define('USER_ERR_09','Invalid word'); }
if (!defined('USER_ERR_10')) { define('USER_ERR_10','Password fields different'); }
if (!defined('USER_ERR_11')) { define('USER_ERR_11','Banned email address'); }
if (!defined('USER_ERR_12')) { define('USER_ERR_12','Invalid format for email address'); }
if (!defined('USER_ERR_13')) { define('USER_ERR_13','Data error'); }
if (!defined('USER_ERR_14')) { define('USER_ERR_14','Banned user'); }
if (!defined('USER_ERR_15')) { define('USER_ERR_15','User name and display name cannot be different'); }
if (!defined('USER_ERR_16')) { define('USER_ERR_16','Software error'); }
if (!defined('USER_ERR_17')) { define('USER_ERR_17','Value too low'); }
if (!defined('USER_ERR_18')) { define('USER_ERR_18','Value too high'); }
if (!defined('USER_ERR_19')) { define('USER_ERR_19','General error'); }
if (!defined('USER_ERR_20')) { define('USER_ERR_20','Unspecified error'); }
?>

View File

@@ -4,8 +4,8 @@
| e107 website system - Language File.
|
| $Source: /cvs_backup/e107_0.8/e107_languages/English/lan_usersettings.php,v $
| $Revision: 1.13 $
| $Date: 2008-06-13 20:20:22 $
| $Revision: 1.14 $
| $Date: 2008-12-21 22:17:05 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
@@ -24,8 +24,8 @@ define("LAN_112", "Email Address: ");
define("LAN_113", "Hide email address?: ");
define("LAN_114", "This will prevent your email address from being displayed on site");
define("LAN_119", "Location: ");
define("LAN_120", "Signature: ");
define("LAN_121", "Avatar: ");
//define("LAN_120", "Signature: ");
//define("LAN_121", "Avatar: ");
define("LAN_144", "Website URL: ");
define("LAN_150", "Settings updated and saved into database.");
define("LAN_151", "OK");

View File

@@ -11,15 +11,15 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_themes/templates/email_template.php,v $
| $Revision: 1.4 $
| $Date: 2008-07-17 19:24:46 $
| $Revision: 1.5 $
| $Date: 2008-12-21 22:17:05 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
global $pref;
$SIGNUPEMAIL_SUBJECT = LAN_404." {SITENAME}";
$SIGNUPEMAIL_SUBJECT = LAN_SIGNUP_96." {SITENAME}";
$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_IMAGES = e_IMAGE.$pref['sitebutton']; // comma separated paths to image to embed. referenced below with {IMAGE1} (IMAGE2} etc.
@@ -64,7 +64,7 @@ $SIGNUPEMAIL_TEMPLATE = "
<div style='text-align:left; width:90%'>
".LAN_EMAIL_01." {USERNAME},<br />
<br />".
LAN_403." {SITENAME}<br />
LAN_SIGNUP_97." {SITENAME}<br />
".LAN_SIGNUP_21.":<br />
<br />
{ACTIVATION_LINK}<br />

View File

@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_themes/templates/signup_template.php,v $
| $Revision: 1.10 $
| $Date: 2008-10-30 22:42:41 $
| $Revision: 1.11 $
| $Date: 2008-12-21 22:17:05 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
@@ -27,7 +27,7 @@ define("REQUIRED_FIELD_MARKER", "<span style='text-align:right;font-size:15px; c
$sc_style['SIGNUP_DISPLAYNAME']['pre'] = "
<tr>
<td class='forumheader3' style='width:30%;white-space:nowrap' >".LAN_7."<span style='font-size:15px; color:red'> *</span><br /><span class='smalltext'>".LAN_8."</span></td>
<td class='forumheader3' style='width:30%;white-space:nowrap' >".LAN_SIGNUP_89."<span style='font-size:15px; color:red'> *</span><br /><span class='smalltext'>".LAN_SIGNUP_90."</span></td>
<td class='forumheader3' style='width:70%'>
";
$sc_style['SIGNUP_DISPLAYNAME']['post'] = "
@@ -37,7 +37,7 @@ $sc_style['SIGNUP_DISPLAYNAME']['post'] = "
$sc_style['SIGNUP_REALNAME']['pre'] = "
<tr>
<td class='forumheader3' style='width:30%;white-space:nowrap'>".LAN_308."".req($pref['signup_option_realname'])."<br /><span class='smalltext'>".LAN_310."</span></td>
<td class='forumheader3' style='width:30%;white-space:nowrap'>".LAN_SIGNUP_91."".req($pref['signup_option_realname'])."<br /><span class='smalltext'>".LAN_SIGNUP_92."</span></td>
<td class='forumheader3' style='width:70%' >
";
$sc_style['SIGNUP_REALNAME']['post'] = "
@@ -66,7 +66,7 @@ $USERCLASS_SUBSCRIBE_ROW = "
<tr>
<td class='defaulttext' style='width:10%;vertical-align:top'>
<div {USERCLASS_INDENT}>
<input type='checkbox' name='class[]' value='{USERCLASS_ID}' />
<input type='checkbox' name='class[]' value='{USERCLASS_ID}' {USERCLASS_CHECKED} />
</div>
</td>
<td class='defaulttext' style='text-align:left;margin-left:0px;width:90%;padding-top:3px;vertical-align:top'>{USERCLASS_NAME}<br />
@@ -115,7 +115,7 @@ if(!defined($EXTENDED_USER_FIELD_REQUIRED))
$SIGNUP_SIGNATURE_START = "
<tr>
<td class='forumheader3' style='width:30%;white-space:nowrap;vertical-align:top' >".LAN_120." ".req($pref['signup_option_signature'])."</td>
<td class='forumheader3' style='width:30%;white-space:nowrap;vertical-align:top' >".LAN_SIGNUP_93." ".req($pref['signup_option_signature'])."</td>
<td class='forumheader3' style='width:70%' >
<textarea class='tbox' style='width:99%' name='signature' cols='10' rows='4' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'>";
@@ -128,7 +128,7 @@ $SIGNUP_SIGNATURE_END = "
$sc_style['SIGNUP_IMAGES']['pre'] = "
<tr>
<td class='forumheader3' style='width:30%; vertical-align:top;white-space:nowrap' >".LAN_121.req($pref['signup_option_image'])."<br /><span class='smalltext'>(".LAN_SIGNUP_33.")</span></td>
<td class='forumheader3' style='width:30%; vertical-align:top;white-space:nowrap' >".LAN_SIGNUP_94.req($pref['signup_option_image'])."<br /><span class='smalltext'>(".LAN_SIGNUP_33.")</span></td>
<td class='forumheader3' style='width:70%;vertical-align:top' >
";
$sc_style['SIGNUP_IMAGES']['post'] = "
@@ -139,7 +139,7 @@ $sc_style['SIGNUP_IMAGES']['post'] = "
$sc_style['SIGNUP_IMAGECODE']['pre'] = "
<tr>
<td class='forumheader3' style='width:30%'>".LAN_410.req(2)."</td>
<td class='forumheader3' style='width:30%'>".LAN_SIGNUP_95.req(2)."</td>
<td class='forumheader3' style='width:70%'>
";
$sc_style['SIGNUP_IMAGECODE']['post'] = "
@@ -150,7 +150,7 @@ $sc_style['SIGNUP_IMAGECODE']['post'] = "
if(!defined($COPPA_TEMPLATE))
{
$COPPA_TEMPLATE = LAN_109." <a href='http://www.cdt.org/legislation/105th/privacy/coppa.html'>".LAN_SIGNUP_14."</a>. ".LAN_SIGNUP_15." ".$tp->emailObfuscate(SITEADMINEMAIL,LAN_SIGNUP_14)." ".LAN_SIGNUP_16."
$COPPA_TEMPLATE = LAN_SIGNUP_77." <a href='http://www.cdt.org/legislation/105th/privacy/coppa.html'>".LAN_SIGNUP_14."</a>. ".LAN_SIGNUP_15." ".$tp->emailObfuscate(SITEADMINEMAIL,LAN_SIGNUP_14)." ".LAN_SIGNUP_16."
<br />
<br />
<div style='text-align:center'><b>".LAN_SIGNUP_17."</b>
@@ -167,7 +167,7 @@ $COPPA_FAIL = "<div style='text-align:center'>".LAN_SIGNUP_9."</div>";
if(!defined($SIGNUP_TEXT))
{
$SIGNUP_TEXT =
LAN_309." <b>".LAN_SIGNUP_29."</b><br /><br />".LAN_SIGNUP_30."<br />
LAN_SIGNUP_80." <b>".LAN_SIGNUP_29."</b><br /><br />".LAN_SIGNUP_30."<br />
";
}
@@ -185,26 +185,26 @@ $SIGNUP_XUP_FORM = "
<td class='forumheader3' style='width:30%;white-space:nowrap'>".LAN_SIGNUP_31."
</td>
<td class='forumheader3' style='width:70%'>
<input class='tbox' type='text' name='xupexist' size='50' value='' maxlength='100' />
<input class='tbox' type='text' name='user_xup' size='50' value='' maxlength='100' />
</td>
</tr>
<tr>
<td class='forumheader3' style='width:30%;white-space:nowrap' >".LAN_9."<span style='font-size:15px; color:red'> *</span><br /><span class='smalltext'>".LAN_10."</span></td>
<td class='forumheader3' style='width:30%;white-space:nowrap' >".LAN_SIGNUP_81."<span style='font-size:15px; color:red'> *</span><br /><span class='smalltext'>".LAN_SIGNUP_82."</span></td>
<td class='forumheader3' style='width:70%'>
{SIGNUP_XUP_LOGINNAME}
</td>
</tr>
<tr>
<td class='forumheader3' style='width:30%;white-space:nowrap'>".LAN_17."<span style='font-size:15px; color:red'> *</span></td>
<td class='forumheader3' style='width:30%;white-space:nowrap'>".LAN_SIGNUP_83."<span style='font-size:15px; color:red'> *</span></td>
<td class='forumheader3' style='width:70%'>
{SIGNUP_XUP_PASSWORD1}
</td>
</tr>
<tr>
<td class='forumheader3' style='width:30%;white-space:nowrap'>".LAN_111."<span style='font-size:15px; color:red'> *</span></td>
<td class='forumheader3' style='width:30%;white-space:nowrap'>".LAN_SIGNUP_84."<span style='font-size:15px; color:red'> *</span></td>
<td class='forumheader3' style='width:70%'>
{SIGNUP_XUP_PASSWORD2}
</td>
@@ -218,7 +218,7 @@ $SIGNUP_XUP_FORM = "
<tr>
<td class='forumheader' colspan='2' style='text-align:center'>
<input class='button' type='submit' name='register' value=\"".LAN_123."\" />
<input class='button' type='submit' name='register' value=\"".LAN_SIGNUP_79."\" />
</td>
</tr>
@@ -243,7 +243,7 @@ $SIGNUP_BEGIN = "
<div style='text-align:center;".USER_WIDTH."'>
{SIGNUP_SIGNUP_TEXT}
<br />
".LAN_400."<br /><br /></div>";
".LAN_SIGNUP_85."<br /><br /></div>";
}
if(!defined($SIGNUP_BODY))
@@ -255,28 +255,28 @@ $SIGNUP_BODY = "
<table class='fborder' style='".USER_WIDTH."'>
{SIGNUP_DISPLAYNAME}
<tr>
<td class='forumheader3' style='width:30%;white-space:nowrap' >".LAN_9."<span style='font-size:15px; color:red'> *</span><br /><span class='smalltext'>".LAN_10."</span></td>
<td class='forumheader3' style='width:30%;white-space:nowrap' >".LAN_SIGNUP_81."<span style='font-size:15px; color:red'> *</span><br /><span class='smalltext'>".LAN_SIGNUP_82."</span></td>
<td class='forumheader3' style='width:70%'>
{SIGNUP_LOGINNAME}
</td>
</tr>
{SIGNUP_REALNAME}
<tr>
<td class='forumheader3' style='width:30%;white-space:nowrap'>".LAN_17."<span style='font-size:15px; color:red'> *</span></td>
<td class='forumheader3' style='width:30%;white-space:nowrap'>".LAN_SIGNUP_83."<span style='font-size:15px; color:red'> *</span></td>
<td class='forumheader3' style='width:70%'>
{SIGNUP_PASSWORD1}
{SIGNUP_PASSWORD_LEN}
</td>
</tr>
<tr>
<td class='forumheader3' style='width:30%;white-space:nowrap'>".LAN_111."<span style='font-size:15px; color:red'> *</span></td>
<td class='forumheader3' style='width:30%;white-space:nowrap'>".LAN_SIGNUP_84."<span style='font-size:15px; color:red'> *</span></td>
<td class='forumheader3' style='width:70%'>
{SIGNUP_PASSWORD2}
</td>
</tr>
<tr>
<td class='forumheader3' style='width:30%;white-space:nowrap'>".LAN_112."{SIGNUP_IS_MANDATORY=email}</td>
<td class='forumheader3' style='width:30%;white-space:nowrap'>".LAN_SIGNUP_86."{SIGNUP_IS_MANDATORY=email}</td>
<td class='forumheader3' style='width:70%'>
{SIGNUP_EMAIL}
</td>
@@ -290,7 +290,7 @@ $SIGNUP_BODY = "
</tr>
<tr>
<td class='forumheader3' style='width:30%;white-space:nowrap'>".LAN_113."</td>
<td class='forumheader3' style='width:30%;white-space:nowrap'>".LAN_SIGNUP_87."</td>
<td class='forumheader3' style='width:70%'>
{SIGNUP_HIDE_EMAIL}
</td>
@@ -302,7 +302,7 @@ $SIGNUP_BODY = "
{SIGNUP_IMAGECODE}
<tr style='vertical-align:top'>
<td class='forumheader' colspan='2' style='text-align:center'>
<input class='button' type='submit' name='register' value=\"".LAN_123."\" />
<input class='button' type='submit' name='register' value=\"".LAN_SIGNUP_79."\" />
<br />
</td>
</tr>

View File

@@ -9,30 +9,32 @@
* User signup
*
* $Source: /cvs_backup/e107_0.8/signup.php,v $
* $Revision: 1.27 $
* $Date: 2008-12-21 11:07:58 $
* $Revision: 1.28 $
* $Date: 2008-12-21 22:17:05 $
* $Author: e107steved $
*
*/
require_once("class2.php");
$qs = explode(".", e_QUERY);
if($qs[0] != "activate")
if($qs[0] != 'activate')
{ // multi-language fix.
include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_signup.php");
include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_usersettings.php");
}
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_user.php'); // Generic user-related language defines
define('SIGNUP_DEBUG', FALSE);
include_once(e_HANDLER."user_extended_class.php");
include_once(e_HANDLER.'user_extended_class.php');
$usere = new e107_user_extended;
require_once(e_HANDLER."calendar/calendar_class.php");
require_once(e_HANDLER.'calendar/calendar_class.php');
$cal = new DHTML_Calendar(true);
require_once(e_HANDLER.'validator_class.php');
require_once(e_HANDLER.'user_handler.php');
$user_info = new UserHandler;
$user_info->deleteExpired(); // Delete time-expired partial registrations
$userMethods = new UserHandler;
$userMethods->deleteExpired(); // Delete time-expired partial registrations
if (is_readable(THEME."signup_template.php"))
{
@@ -54,16 +56,17 @@ $text = '';
//-------------------------------
if(e_QUERY == "resend" && !USER && ($pref['user_reg_veri'] == 1))
{
e107_include_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_".e_PAGE);
e107_include_once(e_LANGUAGEDIR."English/lan_".e_PAGE);
include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_".e_PAGE);
require_once(HEADERF);
if(!$clean_email = check_email($tp -> toDB($_POST['resend_email'])))
$clean_email = $tp -> toDB($_POST['resend_email']);
if(!check_email($clean_email))
{
$clean_email = "xxx";
}
if(!$new_email = check_email($tp -> toDB($_POST['resend_newemail'])))
$new_email = $tp -> toDB(varset($_POST['resend_newemail'], ''));
if(!check_email($new_email ))
{
$new_email = FALSE;
}
@@ -74,7 +77,7 @@ if(e_QUERY == "resend" && !USER && ($pref['user_reg_veri'] == 1))
// 'resend_newemail' - corrected email address
// 'resend_password' - password (required if changing email address)
if($_POST['resend_email'] && !$new_email && $sql->db_Select_gen("SELECT * FROM #user WHERE user_ban=0 AND user_sess='' AND (user_loginname= \"".$tp->toDB($_POST['resend_email'])."\" OR user_name = \"".$tp->toDB($_POST['resend_email'])."\" OR user_email = \"".$clean_email."\" ) "))
if($_POST['resend_email'] && !$new_email && $clean_email && $sql->db_Select_gen("SELECT * FROM #user WHERE user_ban=0 AND user_sess='' AND (`user_loginname`= '".$clean_email."' OR `user_name` = '".$clean_email."' OR `user_email` = '".$clean_email."' ) "))
{ // Account already activated
$ns -> tablerender(LAN_SIGNUP_40,LAN_SIGNUP_41."<br />");
require_once(FOOTERF);
@@ -83,10 +86,10 @@ if(e_QUERY == "resend" && !USER && ($pref['user_reg_veri'] == 1))
// Start by looking up the user
if(!$sql->db_Select("user", "*", "(user_loginname = \"".$tp->toDB($_POST['resend_email'])."\" OR user_name = \"".$tp->toDB($_POST['resend_email'])."\" OR user_email = \"".$clean_email."\" ) AND user_ban=".USER_REGISTERED_NOT_VALIDATED." AND user_sess !='' LIMIT 1"))
if(!$sql->db_Select("user", "*", "(`user_loginname` = '".$clean_email."' OR `user_name` = '".$clean_email."' OR `user_email` = '".$clean_email."' ) AND `user_ban`=".USER_REGISTERED_NOT_VALIDATED." AND `user_sess` !='' LIMIT 1"))
{
require_once(e_HANDLER."message_handler.php");
message_handler("ALERT",LAN_SIGNUP_64); // email (or other info) not valid.
message_handler("ALERT",LAN_SIGNUP_64.': '.$clean_email); // email (or other info) not valid.
exit;
}
$row = $sql -> db_Fetch();
@@ -94,7 +97,7 @@ if(e_QUERY == "resend" && !USER && ($pref['user_reg_veri'] == 1))
if(trim($_POST['resend_password']) !="" && $new_email)
{ // Need to change the email address - check password to make sure
if ($user_info->CheckPassword($_POST['resend_password'], $row['user_loginname'], $row['user_password']) === TRUE)
if ($userMethods->CheckPassword($_POST['resend_password'], $row['user_loginname'], $row['user_password']) === TRUE)
{
if($sql->db_Update("user", "user_email='".$new_email."' WHERE user_id = '".$row['user_id']."' LIMIT 1 "))
{
@@ -110,14 +113,9 @@ if(e_QUERY == "resend" && !USER && ($pref['user_reg_veri'] == 1))
}
// Now send the email - got some valid info
$_POST['password1'] = "xxxxxxxxx";
$_POST['loginname'] = $row['user_loginname'];
$_POST['name'] = $row['user_name'];
$nid = $row['user_id'];
$u_key = $row['user_sess'];
$eml = render_email();
$mailheader_e107id = $nid;
$row['user_password'] = 'xxxxxxx'; // Don't know the real one
$eml = render_email($row);
$mailheader_e107id = $row['user_id'];
require_once(e_HANDLER."mail.php");
$do_log['signup_action'] = LAN_SIGNUP_63;
@@ -202,8 +200,7 @@ if(!$_POST)
if(ADMIN && (e_QUERY == "preview" || e_QUERY == "test" || e_QUERY == "preview.aftersignup"))
{
e107_include_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_".e_PAGE);
e107_include_once(e_LANGUAGEDIR."English/lan_".e_PAGE);
include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_".e_PAGE);
if(e_QUERY == "preview.aftersignup")
{
require_once(HEADERF);
@@ -219,15 +216,16 @@ if(ADMIN && (e_QUERY == "preview" || e_QUERY == "test" || e_QUERY == "preview.a
}
else
{
$text = LAN_405;
$text = LAN_SIGNUP_72;
}
}
$ns->tablerender(LAN_406, $text);
$ns->tablerender(LAN_SIGNUP_73, $text);
require_once(FOOTERF);
exit;
}
$eml = render_email(TRUE);
$temp = array();
$eml = render_email($temp,TRUE); // It ignores the data, anyway
echo $eml['preview'];
if(e_QUERY == "test")
@@ -337,8 +335,8 @@ if (e_QUERY)
$e_event->trigger("userveri", $row);
require_once(HEADERF);
$text = LAN_401." <a href='index.php'>".LAN_SIGNUP_22."</a> ".LAN_SIGNUP_23."<br />".LAN_SIGNUP_24." ".SITENAME;
$ns->tablerender(LAN_402, $text);
$text = LAN_SIGNUP_74." <a href='index.php'>".LAN_SIGNUP_22."</a> ".LAN_SIGNUP_23."<br />".LAN_SIGNUP_24." ".SITENAME;
$ns->tablerender(LAN_SIGNUP_75, $text);
require_once(FOOTERF);
exit;
}
@@ -357,11 +355,12 @@ if (e_QUERY)
//----------------------------------------
if (isset($_POST['register']))
{
$_POST['xupexist'] = trim(varset($_POST['xupexist'],''));
$_POST['user_xup'] = trim(varset($_POST['user_xup'],''));
$readXUP = varsettrue($pref['xup_enabled']) && varsettrue($_POST['user_xup']);
$e107cache->clear("online_menu_totals");
$error_message = "";
require_once(e_HANDLER."message_handler.php");
if (isset($_POST['rand_num']) && $signup_imagecode && !$_POST['xupexist'] )
if (isset($_POST['rand_num']) && $signup_imagecode && !$readXUP )
{
if (!$sec_img->verify_code($_POST['rand_num'], $_POST['code_verify']))
{
@@ -376,14 +375,17 @@ if (isset($_POST['register']))
$error = TRUE;
}
if (varsettrue($pref['xup_enabled']) && varsettrue($_POST['xupexist']))
if (!$error && $readXUP)
{
require_once(e_HANDLER."xml_class.php");
$xml = new parseXml;
if(!$rawData = $xml -> getRemoteXmlFile($_POST['xupexist']))
if(!$rawData = $xml -> getRemoteXmlFile($_POST['user_xup']))
{
echo "Error: Unable to open remote XUP file";
$error_message .= LAN_SIGNUP_68."\\n";
$error = TRUE;
}
else
{
preg_match_all("#\<meta name=\"(.*?)\" content=\"(.*?)\" \/\>#si", $rawData, $match);
$count = 0;
foreach($match[1] as $value)
@@ -410,235 +412,80 @@ if (isset($_POST['register']))
$_POST['ue']['user_birthday'] = $xup['BDAY'];
unset($xup);
}
if($_POST['loginnamexup']) $_POST['loginname'] = $_POST['loginnamexup'];
if($_POST['password1xup']) $_POST['password1'] = $_POST['password1xup'];
if($_POST['password2xup']) $_POST['password2'] = $_POST['password2xup'];
}
}
if (!$error)
{
if (varsettrue($pref['predefinedLoginName']))
{
$_POST['loginname'] = $user_info->generateUserLogin($pref['predefinedLoginName']);
// if (empty($username)) $username = $loginname;
$_POST['loginname'] = $userMethods->generateUserLogin($pref['predefinedLoginName']);
}
// Strip most invalid characters now
$temp_name = trim(preg_replace('/&nbsp;|\#|\=|\$/', "", strip_tags($_POST['loginname'])));
if ($temp_name != $_POST['loginname'])
{
$error_message .= LAN_409."\\n";
$error = TRUE;
}
if (strcasecmp($_POST['loginname'],"Anonymous") == 0)
{
$error_message .= LAN_103."\\n";
$error = TRUE;
}
// Use LoginName for DisplayName if restricted
if (!check_class($pref['displayname_class'],e_UC_PUBLIC.','.e_UC_MEMBER))
{
$_POST['name'] = $_POST['loginname'];
$_POST['username'] = $_POST['loginname'];
}
// Impose a minimum length on display name
$_POST['name'] = trim($_POST['name']);
if (strlen($_POST['name']) < 2)
// Now validate everything
$allData = validatorClass::validateFields($_POST,$userMethods->userVettingInfo, TRUE); // Do basic validation
validatorClass::checkMandatory('user_name,user_loginname', $allData); // Check for missing fields (email done in userValidation() )
validatorClass::dbValidateArray($allData, $userMethods->userVettingInfo, 'user', 0); // Do basic DB-related checks
$userMethods->userValidation($allData); // Do user-specific DB checks
if (($_POST['password1'] != $_POST['password2']) && !isset($allData['errors']['user_password']))
{
$error_message .= LAN_SIGNUP_56."\\n";
$error = TRUE;
$allData['errors']['user_password'] = ERR_PASSWORDS_DIFFERENT;
}
else
{
$savePassword = $_POST['password1']; // May need in plaintext later
unset($_POST['password1']); // Restrict the scope of this
unset($_POST['password2']);
}
global $db_debug;
// Check for disallowed names.
if(varsettrue($pref['signup_disallow_text']))
{
$tmp = explode(",", $pref['signup_disallow_text']);
if (E107_DEBUG_LEVEL) $db_debug->log('disallowed ('.count($tmp).'), like "'.$tmp[0].'"');
foreach($tmp as $disallow)
{
if( strstr($_POST['name'], $disallow) || strstr($_POST['loginname'], $disallow) ){
$error_message .= LAN_103."\\n";
$error = TRUE;
}
}
}
$allData['user_ip'] = $e107->getip();
// Check if form maxlength has been bypassed (need to allow 100 chars for both here - can have display name and login name the same, and want an error message)
if ( strlen($_POST['name']) > 100 || strlen($_POST['loginname']) > 100)
{
exit;
}
// Check if display name exceeds maximum allowed length
if (strlen($_POST['name']) > varset($pref['displayname_maxlength'],15))
{
$error_message .= LAN_SIGNUP_55."\\n";
$error = TRUE;
}
// Check if login name exceeds maximum allowed length
if (strlen($_POST['loginname']) > varset($pref['loginname_maxlength'],30))
{
$error_message .= LAN_SIGNUP_57."\\n";
$error = TRUE;
}
// Display Name exists.
if ($sql->db_Select("user", "*", "user_name='".$tp -> toDB($_POST['name'])."'"))
{
$error_message .= LAN_411.": ".$tp -> toDB($_POST['name'])."\\n";
$error = TRUE;
}
// Login Name exists
if ($sql->db_Select("user", "*", "user_loginname='".$tp -> toDB($_POST['loginname'])."' "))
{
$error_message .= LAN_104.": ".$tp -> toDB($_POST['loginname'])."\\n";
$error = TRUE;
}
// check for multiple signups from the same IP address.
if($ipcount = $sql->db_Select("user", "*", "user_ip='".$e107->getip()."' 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']) != "")
{
$error_message .= LAN_202."\\n";
$error = TRUE;
$allData['errors']['user_email'] = ERR_GENERIC;
$allData['errortext']['user_email'] = LAN_SIGNUP_71;
}
}
// Check password fields are matching.
if ($_POST['password1'] != $_POST['password2'])
{
$error_message .= LAN_105."\\n";
$error = TRUE;
$password1 = "";
$password2 = "";
}
// Email address confirmation.
$email_address_OK = TRUE;
if (!isset($allData['errors']['user_email']))
{ // Obviously nothing wrong with the email address so far (or maybe its not required)
if ($_POST['email'] != $_POST['email_confirm'])
{
$error_message .= LAN_SIGNUP_38."\\n";
$error = TRUE;
$email = "";
$email_confirm = "";
$email_address_OK = FALSE;
$allData['errors']['user_email'] = ERR_GENERIC;
$allData['errortext']['user_email'] = LAN_SIGNUP_38;
unset($allData['validate']['user_email']);
}
// Always validate an email address if entered. If its blank, that's OK if checking disabled
$_POST['email'] = $tp->toDB(trim(varset($_POST['email'],'')));
$do_email_validate = !varset($pref['disable_emailcheck'],FALSE) || ($_POST['email'] !='');
// Password length check.
if (strlen(trim($_POST['password1'])) < $pref['signup_pass_len'])
{
$error_message .= LAN_SIGNUP_4.$pref['signup_pass_len'].LAN_SIGNUP_5."\\n";
$error = TRUE;
$password1 = "";
$password2 = "";
}
// Check for emtpy fields
if (trim($_POST['name']) == "" || trim($_POST['loginname']) == "" || trim($_POST['password1']) == "" || trim($_POST['password2']) == "")
{
$error_message .= LAN_185."\\n";
$error = TRUE;
}
// ========== Verify Custom Signup options if selected ========================
$signup_option_title = array(LAN_308, LAN_120, LAN_121, LAN_SIGNUP_28);
// Verify Custom Signup options if selected - need specific loop since the need for them is configuration-dependent
$signup_option_title = array(LAN_USER_63, LAN_USER_71, LAN_USER_72, LAN_SIGNUP_28);
$signup_option_names = array("realname", "signature", "image", "class");
foreach($signup_option_names as $key => $value)
{
if ($pref['signup_option_'.$value] == 2 && !$_POST[$value])
if ($pref['signup_option_'.$value] == 2 && !isset($alldata['validate']['user_'.$value]) && !isset($alldata['errors']['user_'.$value]))
{
$error_message .= LAN_SIGNUP_6.$signup_option_title[$key].LAN_SIGNUP_7."\\n";
$error = TRUE;
$alldata['errors']['user_'.$value] = ERR_GENERIC;
$alldata['errortext']['user_'.$value] = LAN_SIGNUP_6.$signup_option_title[$key].LAN_SIGNUP_7;
}
}
//--------------------------------------
// Email address checks
//--------------------------------------
// Email syntax validation.
if ($do_email_validate && (!$_POST['email'] || !check_email($_POST['email'])))
{
$error_message .= LAN_106."\\n";
$error = TRUE;
$email_address_OK = FALSE;
}
else
{
// Check Email against banlist.
$wc = $tp -> toDB("*".trim(substr($_POST['email'], strpos($_POST['email'], "@"))));
if ($do_email_validate && !$e107->check_ban("banlist_ip='".$_POST['email']."' OR banlist_ip='{$wc}'",FALSE,TRUE))
{
$email_address_OK = FALSE;
$brow = $sql -> db_Fetch();
$error = TRUE;
$error_message = varsettrue($pref['ban_messages'][$row['banlist_bantype']]);
if (!$error_message) exit;
/* if($brow['banlist_reason'])
{
$repl = array("\n","\r","<br />");
$error_message = str_replace($repl,"\\n",$tp->toHTML($brow['banlist_reason'],"","nobreak, defs"))."\\n";
$email = "";
}
else
{
exit;
}
*/ }
}
// Check email address on remote server (if enabled) - but only if previous checks passed.
if ($do_email_validate && $email_address_OK && varsettrue($pref['signup_remote_emailcheck']) && $error != TRUE)
{
require_once(e_HANDLER."mail_validation_class.php");
list($adminuser,$adminhost) = split ("@", SITEADMINEMAIL);
$validator = new email_validation_class;
$validator->localuser= $adminuser;
$validator->localhost= $adminhost;
$validator->timeout=3;
// $validator->debug=1;
// $validator->html_debug=1;
if($validator->ValidateEmailBox(trim($_POST['email'])) != 1)
{
$email_address_OK = FALSE;
$error_message .= LAN_106."\\n";
$error = TRUE;
$email = "";
$email_confirm = "";
}
}
// Check for Duplicate Email address - but only if previous checks passed.
if ($do_email_validate && $email_address_OK && $sql->db_Select("user", "user_email, user_ban, user_sess", "user_email='".$_POST['email']."' "))
{
$chk = $sql -> db_Fetch();
if($chk['user_ban']== 2 && $chk['user_sess'])
{ // duplicate because unactivated
$error = TRUE;
header("Location: ".e_BASE."signup.php?resend");
exit;
}
else
{
$email_address_OK = FALSE;
$error_message .= LAN_408."\\n";
$error = TRUE;
}
}
// Extended Field validation
$extList = $usere->user_extended_get_fieldList();
$eufVals = array();
@@ -648,7 +495,7 @@ global $db_debug;
$eufName = 'user_'.$ext['user_extended_struct_name'];
if(isset($_POST['ue'][$eufName]))
{
$newval = trim($_POST['ue'][$eufName]);
$newval = trim($_POST['ue'][$eufName]); // use $tp->toDB() ??
// echo "Vetting field ".'user_'.$ext['user_extended_struct_name'].": {$newval} = ".trim($_POST['ue']['user_'.$ext['user_extended_struct_name']])."<br />";
if($ext['user_extended_struct_required'] == 1 && (($newval == "") || (($ext['user_extended_struct_type'] == 7) && ($newval == '0000-00-00')) ))
{ // Required field not present
@@ -681,6 +528,15 @@ global $db_debug;
}
}
}
// All validated here - handle any errors
if (count($allData['errors']))
{
require_once(e_HANDLER."message_handler.php");
$temp = validatorClass::makeErrorList($allData,'USER_ERR_','%n - %x - %t: %v', '<br />', $userMethods->userVettingInfo);
message_handler('P_ALERT', $temp.'<br />'.$error_message);
$error = TRUE;
}
} // End of data validation
if($error_message)
@@ -691,6 +547,9 @@ global $db_debug;
// ========== End of verification.. ==============
// If no errors, we can enter the new member in the DB
// At this point we have two data arrays:
// $allData['validate'] - the 'core' user data
// $eufVals - any extended user fields
if (!$error)
{
@@ -706,52 +565,60 @@ global $db_debug;
exit;
}
$username = $tp -> toDB(strip_tags($_POST['name']));
$loginname = $tp -> toDB(strip_tags($_POST['loginname']));
$time = time();
$ip = $e107->getip();
$ue_fields = "";
if (count($eufVals))
{
foreach($eufVals as $key => $val) // We've already ensured only valid keys here
{
$key = $tp->toDB($key);
$val = $tp->toDB($val);
$ue_fields .= ($ue_fields) ? ", " : "";
$ue_fields .= $key."='".$val."'";
}
}
$u_key = md5(uniqid(rand(), 1)); // Key for signup completion
// ************* Possible class insert
$allData['validate']['user_sess'] = $u_key; // Validation key
// Following array will be logged to both admin log and user's entry
$signup_data = array(
'user_name' => $username,
'user_loginname' => $loginname,
'user_email' => $tp -> toDB($_POST['email']),
'user_ip' => $ip);
// Following array is logged to user's entry only
$new_data = array(
'user_password' => $sql->escape($user_info->HashPassword($_POST['password1'], $loginname), FALSE),
'user_sess' => $u_key,
'user_signature' => $tp -> toDB($_POST['signature']),
'user_image' => $tp -> toDB($_POST['image']),
'user_hideemail' => $tp -> toDB($_POST['hideemail']),
'user_join' => time(),
'user_currentvisit' => time(),
'user_ban' => USER_REGISTERED_NOT_VALIDATED,
'user_login' => $tp -> toDB($_POST['realname']),
'user_xup' => $tp -> toDB($_POST['xupexist'])
);
if (varsettrue($pref['allowEmailLogin']))
{ // Need to create separate password for email login
$new_data['user_prefs'] = serialize(array('email_password' => $user_info->HashPassword($_POST['password1'], $new_data['user_email'])));
// Work out all user classes
$intClasses = array();
if (isset($pref['initial_user_classes'])) { $initClasses = explode(',',$pref['initial_user_classes']); } // Any initial user classes to be set at some stage
$classList = array();
if (isset($allData['validate']['user_class'])) { $classList = explode(',',$allData['validate']['user_class']); } // Classes entered by user during signup
if (varsettrue($pref['user_new_period']))
{
$classList[] = e_UC_NEWUSER; // Probationary user class
}
if (!$pref['user_reg_veri'] || ($pref['init_class_stage'] == '1'))
{ // Set initial classes if no verification required, or if selected to add them now
$classList = array_merge($classList, $initClasses);
}
$classList = array_unique($classList);
if (count($classList))
{
$allData['validate']['user_class'] = implode(',',$classList);
}
$nid = $sql->db_Insert("user", array_merge($signup_data,$new_data));
if ($pref['user_reg_veri'])
{
$allData['validate']['user_ban'] = USER_REGISTERED_NOT_VALIDATED;
}
else
{
$allData['validate']['user_ban'] = USER_VALIDATED;
}
// Work out data to be written to user audit trail
$signup_data = array('user_name', 'user_loginname', 'user_email', 'user_ip');
foreach (array() as $f)
{
$signup_data[$f] = $allData['validate'][$f]; // Just copy across selected fields
}
$allData['validate']['user_password'] = $userMethods->HashPassword($savePassword,$allData['validate']['user_loginname']);
if (varsettrue($pref['allowEmailLogin']))
{ // Need to create separate password for email login
$allData['validate']['user_prefs'] = serialize(array('email_password' => $userMethods->HashPassword($savePassword, $allData['validate']['user_email'])));
}
$allData['validate']['user_join'] = time();
// Actually write data to DB
$nid = $sql->db_Insert("user", $allData['validate']);
if(count($eufVals))
{
$sql->db_Select_gen("INSERT INTO `#user_extended` (user_extended_id) values ('{$nid}')");
$sql->db_UpdateArray("user_extended", $eufVals." WHERE `user_extended_id` = ".intval($nid));
}
if (SIGNUP_DEBUG) $admin_log->e_log_event(10,debug_backtrace(),"DEBUG","Signup new user",array_merge($allData['validate'],$eufVals) ,FALSE,LOG_TO_ROLLING);
// Log to user audit log if enabled
$signup_data['user_id'] = $nid;
@@ -767,53 +634,22 @@ global $db_debug;
require_once(FOOTERF);
}
$adviseLoginName = '';
if (varsettrue($pref['predefinedLoginName']))
{
$adviseLoginName = LAN_SIGNUP_65.': '.$loginname.'<br />'.LAN_SIGNUP_66.'<br />';
$adviseLoginName = LAN_SIGNUP_65.': '.$allData['validate']['user_loginname'].'<br />'.LAN_SIGNUP_66.'<br />';
}
if ($pref['user_reg_veri'])
{ // Verification required (may be by email or by admin)
// Set initial classes, and any which the user can opt to join
$init_classes = array();
if ($pref['init_class_stage'] == '1') { $init_classes = explode(',',varset($pref['initial_user_classes'],'')); }
if (isset($_POST['class']))
{
foreach ($_POST['class'] as $cl)
{
if (intval($cl))
{
$init_classes[] = $cl;
}
}
}
if (varsettrue($pref['user_new_period']))
{
$init_classes[] = e_UC_NEWUSER;
}
$init_classes = array_unique($init_classes);
if (count($init_classes))
{
$sql->db_Update("user", "user_class='".$tp -> toDB(implode(',',$init_classes))."' WHERE user_id='".$nid."' ");
}
// ========= save extended fields into db table. =====
if($ue_fields)
{
$sql->db_Select_gen("INSERT INTO #user_extended (user_extended_id) values ('{$nid}')");
$sql->db_Update("user_extended", $ue_fields." WHERE user_extended_id = '{$nid}'");
}
// ========== Send Email =========>
if (($pref['user_reg_veri'] != 2) && $_POST['email']) // Don't send if email address blank - means that its not compulsory
if (($pref['user_reg_veri'] != 2) && $allData['validate']['user_email']) // Don't send if email address blank - means that its not compulsory
{
$eml = render_email();
$allData['validate']['user_id'] = $nid; // User ID
$allData['validate']['user_password'] = $savePassword; // Might need to send plaintext password in the email
$eml = render_email($allData['validate']);
$mailheader_e107id = $eml['userid'];
require_once(e_HANDLER."mail.php");
@@ -823,15 +659,12 @@ global $db_debug;
$error_message = LAN_SIGNUP_42; // There was a problem, the registration mail was not sent, please contact the website administrator.
}
}
$_POST['ip'] = $ip;
$_POST['user_id'] = $nid;
$e_event->trigger("usersup", $_POST); // send everything in the template, including extended fields.
require_once(HEADERF);
if (isset($pref['signup_text_after']) && (strlen($pref['signup_text_after']) > 2))
{
$text = $tp->toHTML(str_replace('{NEWLOGINNAME}', $loginname, $pref['signup_text_after']), TRUE, 'parse_sc,defs')."<br />";
$text = $tp->toHTML(str_replace('{NEWLOGINNAME}', $allData['validate']['user_loginname'], $pref['signup_text_after']), TRUE, 'parse_sc,defs')."<br />";
}
else
{
@@ -841,14 +674,14 @@ global $db_debug;
}
else
{
$text = LAN_405.'<br /><br />'.$adviseLoginName;
$text = LAN_SIGNUP_72.'<br /><br />'.$adviseLoginName;
}
}
if ($error_message)
{
$text = "<br /><b>".$error_message."</b><br />"; // Just display error message
}
$ns->tablerender(LAN_406, $text);
$ns->tablerender(LAN_SIGNUP_73, $text);
require_once(FOOTERF);
exit;
}
@@ -856,45 +689,13 @@ global $db_debug;
{ // User can be signed up immediately
require_once(HEADERF);
if(!$sql -> db_Select("user", "user_id", "user_name='{$username}' AND user_password='".$new_data['user_password']."'"))
if(!$sql -> db_Select("user", "user_id", "user_loginname='".$allData['validate']['user_loginname']."' AND user_password='".$allData['validate']['user_password']."'"))
{ // Error looking up newly created user
$ns->tablerender("", LAN_SIGNUP_36);
require_once(FOOTERF);
exit;
}
// Set initial classes, and any which the user can opt to join
$init_classes = explode(',',varset($pref['initial_user_classes'],''));
if (isset($_POST['class']))
{
foreach ($_POST['class'] as $cl)
{
if (intval($cl))
{
$init_classes[] = $cl;
}
}
}
if (varsettrue($pref['user_new_period']))
{
$init_classes[] = e_UC_NEWUSER;
}
$init_classes = array_unique($init_classes);
// Set member as registered, update classes
$sql->db_Update("user", "user_ban = '".USER_VALIDATED."', user_class='".implode(',',$init_classes)."' WHERE user_id = '{$nid}'");
// ======== save extended fields to DB table.
if($ue_fields)
{
$sql->db_Select_gen("INSERT INTO #user_extended (user_extended_id) values ('{$nid}')");
$sql->db_Update("user_extended", $ue_fields." WHERE user_extended_id = '{$nid}'");
}
$_POST['ip'] = $ip;
$_POST['user_id'] = $nid; // ID for the user
$e_event->trigger("usersup", $_POST); // send everything in the template, including extended fields.
if (isset($pref['signup_text_after']) && (strlen($pref['signup_text_after']) > 2))
@@ -903,12 +704,19 @@ global $db_debug;
}
else
{
$text = LAN_107."&nbsp;".SITENAME.", ".LAN_SIGNUP_12."<br /><br />".LAN_SIGNUP_13;
$text = LAN_SIGNUP_76."&nbsp;".SITENAME.", ".LAN_SIGNUP_12."<br /><br />".LAN_SIGNUP_13;
}
$ns->tablerender(LAN_SIGNUP_8,$text);
require_once(FOOTERF);
exit;
}
} // End - if (!$error)
else
{ // 'Recirculate' selected values so they are retained on the form when an error occurs
foreach (array('user_class') as $a)
{
$signupData[$a] = $tp->toForm(varset($allData['validate'][$a],''));
}
}
}
@@ -919,15 +727,11 @@ $qs = ($error ? "stage" : e_QUERY);
if ($pref['use_coppa'] == 1 && strpos($qs, "stage") === FALSE)
{
$text = $tp->parseTemplate($COPPA_TEMPLATE, TRUE, $signup_shortcodes);
$ns->tablerender(LAN_110, $text);
$ns->tablerender(LAN_SIGNUP_78, $text);
require_once(FOOTERF);
exit;
}
if (!$website)
{
$website = "http://";
}
if ($qs == 'stage1' && $pref['use_coppa'] == 1)
{
@@ -936,7 +740,7 @@ if ($qs == 'stage1' && $pref['use_coppa'] == 1)
if(!varsettrue($_POST['coppa']))
{
$text = $tp->parseTemplate($COPPA_FAIL);
$ns->tablerender(LAN_110, $text);
$ns->tablerender(LAN_SIGNUP_78, $text);
require_once(FOOTERF);
exit;
}
@@ -953,19 +757,14 @@ $rs = new form;
$text = $tp->parseTemplate($SIGNUP_BEGIN.$SIGNUP_BODY.$SIGNUP_END, TRUE, $signup_shortcodes);
$ns->tablerender(LAN_123, $text);
$ns->tablerender(LAN_SIGNUP_79, $text);
require_once(FOOTERF);
exit;
// Default Signup Form ----->
$ns->tablerender(LAN_123, $text);
require_once(FOOTERF);
//----------------------------------
// Function returns an image if a fild is required.
// Function returns an image if a field is required.
function req($field)
{
return ($field == 2 ? REQUIRED_FIELD_MARKER : "");
@@ -994,25 +793,26 @@ function headerjs()
}
function render_email($preview = FALSE)
// Create the email to send. $userInfo is the array of DB variables
function render_email($userInfo, $preview = FALSE)
{
// 1 = Body
// 2 = Subject
global $pref,$nid,$u_key,$_POST,$SIGNUPEMAIL_LINKSTYLE,$SIGNUPEMAIL_SUBJECT,$SIGNUPEMAIL_TEMPLATE;
global $pref,$SIGNUPEMAIL_LINKSTYLE,$SIGNUPEMAIL_SUBJECT,$SIGNUPEMAIL_TEMPLATE;
if($preview == TRUE)
{
$_POST['password1'] = "test-password";
$_POST['loginname'] = "test-loginname";
$_POST['name'] = "test-username";
$_POST['website'] = "www.test-site.com";
$nid = 0;
$u_key = "1234567890ABCDEFGHIJKLMNOP";
$userInfo['user_password'] = "test-password";
$userInfo['user_loginname'] = "test-loginname";
$userInfo['user_name'] = "test-username";
$userInfo['user_website'] = "www.test-site.com"; // This may not be defined
$userInfo['user_id'] = 0;
$userInfo['user_sess'] = "1234567890ABCDEFGHIJKLMNOP";
}
define("RETURNADDRESS", (substr(SITEURL, -1) == "/" ? SITEURL."signup.php?activate.".$nid.".".$u_key : SITEURL."/signup.php?activate.".$nid.".".$u_key.".".e_LAN));
$pass_show = ($pref['user_reg_secureveri'])? "*******" : $_POST['password1'];
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'];
if (file_exists(THEME."email_template.php"))
{
@@ -1029,7 +829,7 @@ function render_email($preview = FALSE)
$inline_images[] = $SIGNUPEMAIL_BACKGROUNDIMAGE;
}
$ret['userid'] = $nid;
$ret['userid'] = $userInfo['user_id'];
$ret['cc'] = $SIGNUPEMAIL_CC;
$ret['bcc'] = $SIGNUPEMAIL_BCC;
$ret['attachments'] = $SIGNUPEMAIL_ATTACHMENTS;
@@ -1038,25 +838,25 @@ function render_email($preview = FALSE)
$style = ($SIGNUPEMAIL_LINKSTYLE) ? "style='$SIGNUPEMAIL_LINKSTYLE'" : "";
$search[0] = "{LOGINNAME}";
$replace[0] = $_POST['loginname'];
$replace[0] = $userInfo['user_loginname'];
$search[1] = "{PASSWORD}";
$replace[1] = $pass_show;
$search[2] = "{ACTIVATION_LINK}";
$replace[2] = "<a href='".RETURNADDRESS."' $style>".RETURNADDRESS."</a>";
$replace[2] = "<a href='".RETURNADDRESS."' {$style}>".RETURNADDRESS."</a>";
$search[3] = "{SITENAME}";
$replace[3] = SITENAME;
$search[4] = "{SITEURL}";
$replace[4] = "<a href='".SITEURL."' $style>".SITEURL."</a>";
$replace[4] = "<a href='".SITEURL."' {$style}>".SITEURL."</a>";
$search[5] = "{USERNAME}";
$replace[5] = $_POST['name'];
$replace[5] = $userInfo['user_name'];
$search[6] = "{USERURL}";
$replace[6] = ($_POST['website']) ? $_POST['website'] : "";
$replace[6] = varsettrue($userInfo['user_website']) ? $userInfo['user_website'] : "";
$cnt=1;