|
» 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
|
|
|
|
|
|
|
|
|
|
|
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/... |
|
 |
 |
|
 |

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) { |
|

01-06-2005, 05:40 PM
|
|
Junior Member
|
|
Join Date: Dec 2004
Posts: 18
|
|
|
fixed
hehe....got it....thanks though 
|

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]
|

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();
}
} |
|

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?
|
 |
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|