» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Online Users: 55
0 members and 55 guests
No Members online
Most users ever online was 611, 03-21-2008 at 11:10 PM.
» .::.
Web Hosting - web hosting, dedicated servers and web design services
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 electricity - save on electric rates
Oral Chelation - initial cleansing of your veins & arteries

Register Now! Contact Us

About this Page
This is a discussion on modify your account index.php within the Nuke 7.x - Modules forums, part of the PHP-Nuke 7.x category; Hi everyone, I am on the right track here, but i need a bit of help. Code: $filename = "/home/...


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

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-06-2005, 05:15 PM
Junior Member
 
Join Date: Dec 2004
Posts: 18
modify your account index.php
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
  #2 (permalink)  
Old 01-06-2005, 05:40 PM
Junior Member
 
Join Date: Dec 2004
Posts: 18
fixed
hehe....got it....thanks though
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-06-2005, 06:06 PM
Junior Member
 
Join Date: Dec 2004
Posts: 18
whoopS
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
  #4 (permalink)  
Old 01-07-2005, 07:40 AM
Moderator
 
Join Date: Nov 2002
Location: Belgium
Posts: 957
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
  #5 (permalink)  
Old 01-07-2005, 11:45 AM
Junior Member
 
Join Date: Dec 2004
Posts: 18
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 04:21 AM
Modify background of module box RussianBlue Nuke 6.5 to 6.9 - Themes 1 06-12-2003 08:31 PM
Modify DeepBlue in 6.5 RussianBlue Nuke 6.5 to 6.9 - Themes 2 06-10-2003 07:09 PM
HELP !!! cannot create account by using Admin account anht1706 Purged Topics 1 01-18-2003 01:33 AM
Modify Subblack Blocks Evil Site design 2 12-20-2002 07:51 PM


All times are GMT -5. The time now is 07:30 AM.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.

LinkBacks Enabled by vBSEO 3.1.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