Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Post Installation Help
Author Message
discraftpro
New Member
New Member


Joined: Nov 24, 2004
Posts: 7

PostPosted: Sun Apr 08, 2007 4:22 am Reply with quote

I have searched the forums, and can't seem to find an answer to my problem. I found the email activation hack. Downloaded it, replaced the finishNewUser script with the one in the autoactivation mod. It now doesn't write the users to the database at all. The temp and user tables do not get updated. I have turned on error reporting, and do not see any errors thrown. Can you help me. I have included a cut and paste of the finishNewUser function from the index.php file.

Thanks in advance

function finishNewUser($username, $user_email, $user_password, $random_num, $gfx_check) {
global $stop, $EditedMessage, $adminmail, $sitename, $Default_Theme, $user_prefix, $db, $storyhome, $module_name, $nukeurl;
include_once("header.php");
include("config.php");
userCheck($username, $user_email);
$user_regdate = date("M d, Y");
if (!isset($stop)) {
$datekey = date("F j");
$rcode = hexdec(md5($_SERVER[HTTP_USER_AGENT] . $sitekey . $random_num . $datekey));
$code = substr($rcode, 2, 6);
if (extension_loaded("gd") AND $code != $gfx_check) {
Header("Location: modules.php?name=$module_name");
die();
}
mt_srand ((double)microtime()*1000000);
$maxran = 1000000;
$check_num = mt_rand(0, $maxran);
$check_num = md5($check_num);
$time = time();
$finishlink = "$nukeurl/modules.php?name=$module_name&op=activate&username=$username&check_num=$check_num";
$new_password = md5($user_password);
$db->sql_query("INSERT INTO ".$user_prefix."_users_temp (user_id, username, user_email, user_password, user_regdate, check_num, time) VALUES (NULL, '$username', '$user_email', '$new_password', '$user_regdate', '$check_num', '$time')");
if(!$result) {
echo ""._ERROR."<br>";
} else {
////
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_regdate, user_lang) VALUES (NULL, '$row[username]', '$row[user_email]', '$row[user_password]', 'gallery/blank.gif', '$row[user_regdate]', '$language')");
$db->sql_query("DELETE FROM ".$user_prefix."_users_temp WHERE username='$username' AND check_num='$check_num'");
// include_once("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();
}

////
}
} else {
echo "$stop";
}
include("footer.php");
}
 
View user's profile Send private message Visit poster's website
montego
Site Admin


Joined: Aug 29, 2004
Posts: 9449
Location: Arizona

PostPosted: Sun Apr 08, 2007 10:27 am Reply with quote

You definitely have to be careful just replacing code with code that might be very, very old. That hack code might be quite old. Where did you get the hack?

What version of PHP-Nuke file did you replace this function in?

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 17077

PostPosted: Sun Apr 08, 2007 10:47 am Reply with quote

This mod was last updated in 2003. It may not be compatible with any releases after that time.
 
View user's profile Send private message
discraftpro
PostPosted: Sun Apr 08, 2007 2:07 pm Reply with quote

Thanks for the replies. I got the code from the download section on this site. I was installing it on raven nuke 2.10. I replaced the function in the index.php file in the Your_Account module. I don't have the ability to open the email protocol through the firewall for the server so that is the reason that I need the autoactivation. I sent you a PM raven. I hate to take up space on your forums, but I just can't find the answer. I have been looking for three days now.
 
Raven
PostPosted: Sun Apr 08, 2007 10:28 pm Reply with quote

You probably won't find the answer. I wrote the hack and it was for the early versions of nuke v7. Whatever the issue is, it has to be minor as far as the code goes. I just don't have the time at the moment to address this but if you would compare the code in the hack with the similar code in RN v2.10 you should be able to spot the difference. My guess would be there is a column count mismatch. Turn on the display errors setting in config.php and be sure to examine your server error log for the exact reason.
 
addict
New Member
New Member


Joined: May 04, 2007
Posts: 5

PostPosted: Thu May 10, 2007 1:14 am Reply with quote

Using the line by line install file with autoActivate v7, I was able to get it to work with RavenNuke 2.10. You just have watch for the few verbage changes in the latest version of the index.php file for the module. Would you like me to post my file here or is this something that can be provided for download?

I'm glad I got it working, since my site won't have e-mail access.
 
View user's profile Send private message
Raven
PostPosted: Thu May 10, 2007 6:13 am Reply with quote

addict,

That's great news! If you would please zip it up and email it raven__AT__ravenphpscripts__DOT__com I would appreciate it Smile

If you want your web site included in the credits, please send it along also.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Post Installation Help

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©