It worked for e-mailactivation, but not for adminactivation, because the variable $active_key did not exist jet. I solved the problem by putting
if(!isset($active_key)){$active_key=$active_key_md5;}In front of:
//
// Create a new row in the user table
//
$result = $db->query("INSERT INTO ".TABLE_PREFIX."members ( id, name, email, passwd, regdate, level, active, active_key, template, language, date_format, enable_quickreply, return_to_topic_after_posting, target_blank, hide_avatars, hide_userinfo, hide_signatures, displayed_name, real_name, location ) VALUES ( NULL, '".$_POST['user']."', '".$_POST['email']."', '".md5($_POST['passwd1'])."', ".time().", ".$level.", ".$active.", '".md5($active_key)."', '".$functions->get_config('template')."', '".$functions->get_config('language')."', '".$functions->get_config('date_format')."', ".$functions->get_config('enable_quickreply').", ".$functions->get_config('return_to_topic_after_posting').", ".$functions->get_config('target_blank').", ".$functions->get_config('hide_avatars').", ".$functions->get_config('hide_userinfo').", ".$functions->get_config('hide_signatures').", '".$_POST['user']."', '".unhtml(stripslashes($_POST['real_name']))."','".unhtml(stripslashes($_POST['location']))."' )");
if ( intval($functions->get_config('activation_mode')) === 1 && $level < LEVEL_ADMIN ) {
I assume there won't pop up problems in admin activation mode, nor in e-mail activation mode, since the variable is then set properly.
Edit: The only little bug is that the newly registered user appear in the E-mailactivation category instead of admin-activation category in ACP. Any ideas of how to cope with that?
« Last edit by
Mirax on Sun Jun 15, 2008 5:37 pm. »