» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Online Users: 68
0 members and 68 guests
No Members online
Most users ever online was 611, 03-21-2008 at 10: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
Rimonabant
www.rimonabant-weight-loss.com
Football Betting - best nfl betting promotions at sportsbook.com.
Poker Chips - Clay and composite poker chips for home games.

Register Now! Contact Us

About this Page
This is a discussion on Using User Activation from the Forum registration within the FAQ/Fixes forums, part of the Nukemods category; NUKE 6.5 ONLY!! IN order to use the User or Admin activation setting if you are using your Forums ...



Go Back   Nukemods Forum » Nukemods » FAQ/Fixes

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-06-2003, 03:01 PM
Senior Member
 
Join Date: Sep 2002
Posts: 2,905
Using User Activation from the Forum registration
NUKE 6.5 ONLY!!

IN order to use the User or Admin activation setting if you are using your Forums as your means of letting your users register, then there is one thing you need to do in order for your Users to NOT be able to loggin to Nuke until they click the Activation link that was sent to them by the Forum activation. Or if you have this setting at Admin Activation, then the user will NOT be able to loggin until YOU the ADMIN activate them by clicking the link in the email YOU were sent.
Without this little fix, by Maty of http://www.matyscripts.com
the user would be able to loggin to Nuke without activating themselves, but they would NOT be logged into the forum 8O . SO, what we needed to do was make the Nuke loggin feature LOOK at the user_active field in the users table of the database and check the value. If the user is not activated, value=0 then it won't let them loggin. IF it is 1, then they will be able to loggin. This value in the database doesn't change until the user or admin activates the registered user.

Ok after all that typing, here it is.
You need to replace the entire function login in the
modules/Your Account/index.php file with this:
Code:
function login($username, $user_password, $redirect, $mode, $f, $t, $random_num, $gfx_check) {
    global $setinfo, $user_prefix, $db, $module_name, $pm_login, $prefix;
    include("config.php");
    $sql = "SELECT user_password, user_id, storynum, umode, uorder, thold, noscore, ublockon, theme, commentmax, user_active FROM ".$user_prefix."_users WHERE username='$username'";
    $result = $db->sql_query($sql);
    $setinfo = $db->sql_fetchrow($result);
    $forward = ereg_replace("redirect=", "", "$redirect");
    if (ereg("privmsg", $forward)) {
        $pm_login = "active";
    }
    if (($db->sql_numrows($result)==1) AND ($setinfo[user_id] != 1) AND ($setinfo[user_password] != "") AND ($setinfo[user_active] == 1 )) {
	$dbpass=$setinfo[user_password];
	$non_crypt_pass = $user_password;
  	$old_crypt_pass = crypt($user_password,substr($dbpass,0,2));
	$new_pass = md5($user_password);
	if (($dbpass == $non_crypt_pass) OR ($dbpass == $old_crypt_pass)) {
	    $db->sql_query("UPDATE ".$user_prefix."_users SET user_password='$new_pass' WHERE username='$username'");
	    $sql = "SELECT user_password FROM ".$user_prefix."_users WHERE username='$username'";
	    $result = $db->sql_query($sql);
	    $row = $db->sql_fetchrow($result);
	    $dbpass = $row[user_password];
	}
	if ($dbpass != $new_pass) {
            Header("Location: modules.php?name=$module_name&stop=1");
    	    return;
	}
	$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&stop=1");
	    die();
	} else {
	    docookie($setinfo[user_id], $username, $new_pass, $setinfo[storynum], $setinfo[umode], $setinfo[uorder], $setinfo[thold], $setinfo[noscore], $setinfo[ublockon], $setinfo[theme], $setinfo[commentmax]);
	    $uname = $_SERVER["REMOTE_ADDR"];
	    $db->sql_query("DELETE FROM ".$prefix."_session WHERE uname='$uname' AND guest='1'");
	}
	if ($pm_login != "") {
            Header("Location: modules.php?name=Private_Messages&file=index&folder=inbox");
	    exit;
	}
        if ($redirect == "" ) {
            Header("Location: modules.php?name=Your_Account&op=userinfo&bypass=1&username=$username");
        } else if ($mode == "") {
            Header("Location: modules.php?name=Forums&file=$forward");
        } else if ($t !="")  {
            Header("Location: modules.php?name=Forums&file=$forward&mode=$mode&t=$t");
        } else {
            Header("Location: modules.php?name=Forums&file=$forward&mode=$mode&f=$f");
	}
    } else {
	Header("Location: modules.php?name=$module_name&stop=1");
    }
}

Now one more thing.
The link it sends in the Email from the Forum registration to activate may be wrong. If it gives you an error when you click the link, do the following.
manually edit the lines in the
includes/usercp_register.php

change this
Code:
					'U_ACTIVATE' => $server_url . '?mode=activate&' . POST_USERS_URL . '=' . $user_id . '&act_key=' .
to this
Code:
					'U_ACTIVATE' => $server_url . '&mode=activate&' . POST_USERS_URL . '=' . $user_id . '&act_key=' .
there are 3 lines exactly like that in that file.

mikem
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
User Activation Email not being sent. 90thSFG Nuke 7.x - General 3 05-22-2005 05:27 PM
User Activation By Email 90thSFG Nuke 7.x - General 3 05-10-2005 02:37 PM
New User Activation Error jumpshotjay Nuke 7.x - Themes 1 04-12-2005 11:38 PM
Installation issue - new user activation. Voodoo Nuke 7.x - General 1 01-21-2005 05:33 PM
Add activation link to last page of registration mikem FAQ/Fixes 0 08-26-2003 12:05 PM


All times are GMT -5. The time now is 08:07 PM.


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