ID:               43937
 Comment by:       php at zjs dot name
 Reported By:      Admin at hellzoneinc dot com
 Status:           Open
 Bug Type:         MySQL related
 Operating System: Server 2008
 PHP Version:      5.2.5
 New Comment:

Looking at the code, it appears it's a problem with the code, not a bug
in php (although it's hard to be 100% sure because that piece of code
makes references to several others). If you could provide a more
straight-forward test case, it would make it much easier to investigate,
but because it doesn't look like a bug, I'd suggest looking for help 
from one of the places listed on http://www.php.net/support.php or from
php-nuke as it appears the issue is on their end.


Previous Comments:
------------------------------------------------------------------------

[2008-01-25 16:37:58] Admin at hellzoneinc dot com

Description:
------------
Well, I am using php-nuke for my website. I've had issues w/ PHP5
before and have always gone back to PHP4 since it worked. Since the new
release isn't psoted for Windows yet, I must use PHP5. Everything works
fine with the user registration EXCEPT.... When the user clicks the
activate link in their e-mail, it brings them to the page saying it was
successful, but it's wrong. The user info gets entered into the
nuke_users_temp table just fine, however when the activate script runs,
it doesn't copy the info over to nuke_users as it should, but does make
it through to the remove that row. PHP4 works fine with this so I
figured it's a PHP5 issue, so hope this helps.

Reproduce code:
---------------
It's not a visual error, so here goes. Sorry for the numerous lines.

function activate($username, $check_num) {
        global $db, $user_prefix, $module_name, $language, $prefix;
        $username = filter($username, "nohtml", 1);
        $past = time()-86400;
        $db->sql_query("DELETE FROM ".$user_prefix."_users_temp WHERE time <
$past");
        $sql = "SELECT * FROM ".$user_prefix."_users_temp WHERE
username='$username' AND check_num='$check_num'";
        $result = $db->sql_query($sql);
        if ($db->sql_numrows($result) == 1) {
                $row = $db->sql_fetchrow($result);
                $user_password =
htmlspecialchars(stripslashes($row['user_password']));
                if ($check_num == $row['check_num']) {
                        $db->sql_query("INSERT INTO ".$user_prefix."_users 
(user_id,
username, user_email, user_password, user_avatar, user_avatar_type,
user_regdate, user_lang) VALUES (NULL, '".$row['username']."',
'".$row['user_email']."', '$user_password', 'gallery/blank.gif', '3',
'".$row['user_regdate']."', '$language')");
                        $result2 = $db->sql_query("SELECT user_id FROM
".$user_prefix."_users WHERE username='".$row['username']."'");
                        $row2 = $db->sql_fetchrow($result2);
                        $guserid = intval($row2['user_id']);
                        $db->sql_query("INSERT INTO
".$prefix."_bbgroups (group_name, group_description, group_single_user,
group_moderator) VALUES ('', 'Personal User', '1', '0')");
                        $group_id = $db->sql_nextid();
                        $db->sql_query("INSERT INTO
".$prefix."_bbuser_group (user_id, group_id, user_pending) VALUES
('$guserid', '$group_id', '0')");
                        $db->sql_query("DELETE FROM ".$user_prefix."_users_temp 
WHERE
username='$username' AND check_num='$check_num'");
                        include("header.php");
                        title(""._ACTIVATIONYES."");
                        OpenTable();
                        echo "<center><b>".$row['username'].":</b> 
"._ACTMSG."</center>";
                        CloseTable();
                        include("footer.php");
                        die();
                } else {
                        include("header.php");
                        title(""._ACTIVATIONERROR."");
                        OpenTable();
                        echo "<center>"._ACTERROR1."</center>";
                        CloseTable();
                        include("footer.php");
                        die();
                }
        } else {
                include("header.php");
                title(""._ACTIVATIONERROR."");
                OpenTable();
                echo "<center>"._ACTERROR2."</center>";
                CloseTable();
                include("footer.php");
                die();
        }

}

Expected result:
----------------
Copy the user from nuke_users_temp to nuke_users and I believe maybe 2
other tables from what I think I'm seeing, then remove that line from
nuke_users_temp.

Actual result:
--------------
Does not copy the user, but then removes them from nuke_users_temp as
it should.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=43937&edit=1

Reply via email to