Quote:
Originally Posted by Bryan Ex
User activationid's are not being included in the email notices for my board. Is this query correct as there is no activationid field in the user table;
PHP Code:
SELECT username,user.userid,email,joindate,activationid FROM user LEFT JOIN useractivation ON (user.userid=useractivation.userid) WHERE user.usergroupid=3
|
This is the solution for this problem, I?ve got it from activate.php:
IN manageActivation.php
Under this:
PHP Code:
while ($user=$DB_site->fetch_array($userArray))
{
Insert this code:
PHP Code:
// make random number
if (empty($user['activationid']))
{ //none exists so create one
$user['activationid'] = vbrand(0, 100000000);
$DB_site->query("
INSERT INTO " . TABLE_PREFIX . "useractivation
VALUES
(NULL , $user[userid], " . TIMENOW . ", $user[activationid], 0, 2)
");
echo ("ActivationID created to ". $user[username]."<br>");
}
else
{
$user['activationid'] = vbrand(0, 100000000);
$DB_site->query("
UPDATE " . TABLE_PREFIX . "useractivation SET
dateline = " . TIMENOW . ",
activationid = $user[activationid]
WHERE userid = $user[userid] AND type = 0
");
echo ("ActivationID updated to ". $user[username]."<br>");
}
There is another problem with this hack, if someone change the email address the account is deleted inmediatly because the registration date is more than 10 days old...this is CRITICAL!
So the quick solution to this is to change the query like this:
Code:
SELECT username,user.userid,email,joindate,activationid
FROM user
LEFT JOIN useractivation ON (user.userid=useractivation.userid)
WHERE user.usergroupid=3 AND user.posts = 0
So if the user have 1 or more posts the account is not deleted.
See ya.