homepage Welcome to WebmasterWorld Guest from 54.204.141.129
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Help in resolving 'activation key' error in script
sledge81




msg:4284495
 9:06 am on Mar 20, 2011 (gmt 0)

Hi there,

I'm having some serious troubles in getting a wordpress plugin to work properly. The CMS Members plugin to be precise.

The plugin is supposed to send an activation key upon user registration. However when the link is clicked I always keep getting the error that 'activation key is invalid for the plan'

Here's the piece of code that I think deals with the activation.. perhaps someone can help figure this out?

if ( (get_usermeta($user_data->ID,'activate_key')==$_GET['activate_key']) && (get_usermeta($user_data->ID,'status')=='incomplete') ){
update_usermeta($user_data->ID,'status','0');
delete_usermeta($user_data->ID,'activate_key');
$thanksmsg=__('Your account has been successfully activated.','wwm') . ' <a href="'.wp_login_url().'"> '.__('Log In').'</a>';

if (get_option('free_members_welcome_mail')) {
$to=$_GET['mail'];

$username=$user_data->user_login;
$fname=$user_data->first_name;
$lname=$user_data->last_name;
$expiredate=get_usermeta($user_data->ID,'expire');
$plan=get_usermeta($user_data->ID,'plan_id');
$planinfo=get_plan_info($plan);
$plantitle=$planinfo->title;


$blogname=get_option('blogname');
$subject='Welcome to '.$blogname.'!';

$body=get_option('free_members_welcome_mail_body');
$tags=array('{plantitle}','{expiredate}','{firstname}','{lastname}','{username}','{password}','{planid}');
$replace=array($plantitle,$expiredate,$fname,$lname,$username,$pass,$plan);
$body=str_replace($tags,$replace,$body);
$body.='<p><small>Powered by <a href="http://wpwave.com/plugins/cms-members/">CMS Members</a><small>';


wwm_mail_actions('html'); //set actions

if ( !wp_mail($to, $subject, $body, $header) )
$msg= __('The e-mail could not be sent.') . "<br />\n" . __('Possible reason: your host may have disabled the mail() function...') ;
} //free members welcome

echo '<div class="wwm-thanksmessage">'.$thanksmsg.'</div>';
}elseif($user_data->ID && get_usermeta($user_data->ID,'status')!=='incomplete'){
$errormsg=__('We think you did it before!','wwm');
echo '<div class="wwm-errormessage" >'.$errormsg.'</div>';
}elseif((!$user_data->ID) ||get_usermeta($user_data->ID,'activate_key')!==$_GET['activate_key']){
$errormsg=__('Your activation key is not valid for the plan!','wwm');
echo '<div class="wwm-errormessage" >'.$errormsg.'</div>';
}

}

 

coopster




msg:4291061
 1:00 am on Apr 2, 2011 (gmt 0)

Well, it's not the exact same wording as the message you are receiving but if this is it ...
}elseif((!$user_data->ID) ||get_usermeta($user_data->ID,'activate_key')!==$_GET['activate_key']){ 
$errormsg=__('Your activation key is not valid for the plan!','wwm');
echo '<div class="wwm-errormessage" >'.$errormsg.'</div>';
}

... then you can track back from here.

sledge81




msg:4291145
 7:25 am on Apr 2, 2011 (gmt 0)

Yep that's the line causing the error. Potentially has to do with the activation key that is being sent but however not recognized when a user clicks on it.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved