View Single Post
whoopS
Old
  (#3 (permalink))
qwicker
Junior Member
 
Status: Offline
Posts: 18
Join Date: Dec 2004
whoopS - 01-06-2005, 06:06 PM

umm i am a liar, i thought i got it all working, but it appears to only work once. I added a line of code into one of the above functions
Code:
$plainpass = $user_password;
I thought perhaps that somehow $user_password was being erased or soemhting later in the function. However when i changed things to $plainpass in my own code, it worked perfectly, however the next time i tried to do it, it returned nothing again, just like $user_password. Here is my complete modified function. I also modified the bottome line of code in the index to
Code:
    case "activate":
	activate($username, $check_num, $plainpass);
	break;
Code:
function activate($username, $check_num, $plainpass) {
    global $db, $user_prefix, $module_name, $language;
    $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);
	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]', '$row[user_password]', 

'gallery/blank.gif', 3, '$row[user_regdate]', '$language')");
	    $db->sql_query("DELETE FROM ".$user_prefix."_users_temp WHERE username='$username' AND check_num='$check_num'");
	    include("header.php");
	    title(""._ACTIVATIONYES."");
//*************************ODCH**********************************************
	$filename = "/home/vudc007/.opendchub/reglist";
//	$cryptpass = crypt($plainpass);
	$regcontent = "$username $plainpass 0\n";
	$handle = fopen($filename, 'a');
	fwrite($handle, $regcontent);
	fclose($handle);
//*************************ODCH**********************************************
	    OpenTable();
	    echo "<center>$row[username]: "._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();
    }

}
[/code]
   
Reply With Quote