Nukemods Forum  
» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Online Users: 28
0 members and 28 guests
No Members online
Most users ever online was 611, 03-21-2008 at 10:10 PM.
» .::.
Online Degree - search for 1000+ online degrees, online colleges & online universities.
Tattoo - we are a group of tattoo enthusiasts
Gexa Energy - your absolute best choice in electric service
Texas Electric Choice

Go Back   Nukemods Forum > PHP-Nuke 7.x > Nuke 7.x - Modules

Reply
 
LinkBack Thread Tools Display Modes
modify your account index.php
Old
  (#1 (permalink))
Junior Member
 
Status: Offline
Posts: 18
Join Date: Dec 2004
modify your account index.php - 01-06-2005, 04:15 PM

Hi everyone, I am on the right track here, but i need a bit of help.
Code:
	$filename = "/home/vudc007/.opendchub/reglist";
$cryptpass = crypt($user_password);
$regcontent = "$username $user_password 0\n";	
$handle = fopen($filename, 'a');	
fwrite($handle, $regcontent);
fclose($handle);
I have placed this into the activation function so that the username and password are also stored in another file. It seems to work, but i dont get any output for the $user_password string. It only writes "$username blank 0" It is as if $user_password is empty. Im am new to php, so im not sure exactly how the functions work because i see in the activate function $user_password is not included. How do i modify this so that $user_password is not "empty". Or at leaset, what is going on behind the scenes here with the function syntax. Thanks alot. I hope someone answers me
Code:
function activate($username, $check_num) {
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
fixed
Old
  (#2 (permalink))
Junior Member
 
Status: Offline
Posts: 18
Join Date: Dec 2004
fixed - 01-06-2005, 04:40 PM

hehe....got it....thanks though
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
whoopS
Old
  (#3 (permalink))
Junior Member
 
Status: Offline
Posts: 18
Join Date: Dec 2004
whoopS - 01-06-2005, 05: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]
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#4 (permalink))
Moderator
 
Status: Offline
Posts: 957
Join Date: Nov 2002
Location: Belgium
01-07-2005, 06:40 AM

Instead of writing $plainpass to the file, it seems the code already pulls the password from the database!
You can try something like this
Code:
    case "activate":
   activate($username, $check_num);
   break;
Code:
function activate($username, $check_num) {
    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($row[user_password]);
   $regcontent = "$username $row[user_password] 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();
    }

}


Yannick R. aka Mighty_Y
http://support.code-area51.com
http://www.code-area51.com

Search before asking makes my life easier!
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#5 (permalink))
Junior Member
 
Status: Offline
Posts: 18
Join Date: Dec 2004
01-07-2005, 10:45 AM

Hmm ironically ive already tried that. It doesn't return a null value, but it returns the encrypted string that is in the database. It then puts that string into my reglist file. If i could somehow decrypt $row[user_password] then this would be perfect. I believe i understand the problem now though. The index.php is being reopened when the user activates, so the file is opened up and there is no value for $user_password.....i think. Any other ideas?
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Little modify on subsilvershadow ShMk Theme packs 8 07-10-2003 03:21 AM
Modify background of module box RussianBlue Nuke 6.5 to 6.9 - Themes 1 06-12-2003 07:31 PM
Modify DeepBlue in 6.5 RussianBlue Nuke 6.5 to 6.9 - Themes 2 06-10-2003 06:09 PM
HELP !!! cannot create account by using Admin account anht1706 Purged Topics 1 01-18-2003 12:33 AM
Modify Subblack Blocks Evil Site design 2 12-20-2002 06:51 PM




vBulletin Skin developed by: vBStyles.com


LinkBacks Enabled by vBSEO 3.3.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31