UseBB Community

UseBB support, discussion and development

[FIXED] Undefined variable: active

Post Reply

Page: 1

Author Post
Member
Registered: Feb 2006
Posts: 18
Location: Westford, Massachusetts, USA
I just upgraded to 0.8.

After modifying your profile and selecting the "ok" button you get:

In file panel_profile.php on line 167:

E_NOTICE - Undefined variable: active

Steps:
Your Panel -> Edit Profile -> Ok

I verified that the same issue exists on this board.

I did a little more digging. There is an IF block if the member changed their email to reset their active status, but the variables never get set if the email isn't changed. I added an else statement to set the variables. Hopefully I'm setting this correctly:

        //
// If the e-mail address changed
//
if ( $_POST['email'] != $session->sess_info['user_info']['email'] ) {

switch ( intval($functions->get_config('activation_mode')) ) {

case 0:
$active = 1;
$active_key_md5 = '';
$msgbox_content = $lang['ProfileEdited'];
break;
case 1:
$active = 0;
$active_key = $functions->random_key(); # used in the email url
$active_key_md5 = md5($active_key);
$msgbox_content = sprintf($lang['NewEmailNotActivated'], '<em>'.$session->sess_info['user_info']['na
me'].'</em>', $_POST['email']);
break;
case 2:
$active = 0;
$active_key_md5 = '';
$msgbox_content = sprintf($lang['NewEmailNotActivatedByAdmin'], '<em>'.$session->sess_info['user_inf
o']['name'].'</em>', $_POST['email']);

}
}
else
{
// MJR - Fixing issue with the $active and $active_key_md5 not being set when email doesn't change
$active = 1 ;
$active_key_md5 = '' ;
$msgbox_content = $lang['ProfileEdited'];
}


-Mark
« Last edit by Dietrich on Thu Feb 09, 2006 6:49 pm. »
Developer
Registered: Apr 2004
Posts: 2230
Location: Belgium
Fixed in 0.8a.

Post Reply

Page: 1

UseBB Community is powered by UseBB 1 Forum Software