Sorry, but this username has already been taken...

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785

Sorry, but this username has already been taken...

Postby harleyx » Tue Aug 22, 2006 10:01 am

This happens whenever someone tries to register over at my forum (http://www.gtds.net/talk/) - click Easy Register, then either of the COPPA statements... A while back I installed some SEO mods and a mod to make registration quick and unintimidating. For a long while it worked just fine, then something changed (or I changed something) and the registration stopped working.

My problem is I can't remember where I got the mods HOWTO, and I can't remember what changed, and I can't find why this keeps coming up. The only place I knew to look was includes/user_cpregister.php. This is the only line I can figure that might be causing a problem, but I don't see anything wrong with it.
Code: Select all
if ($mode == 'register' && ($userdata['session_logged_in'] || $username == $userdata['username']))
{
   message_die(GENERAL_MESSAGE, $lang['Username_taken'], '', __LINE__, __FILE__);
}

Any help, ideas, suggestions welcomed!
harleyx
Registered User
 
Posts: 2
Joined: Mon Oct 03, 2005 10:53 pm

Postby lurttinen » Tue Aug 22, 2006 10:14 am

This most commonly occurs when the anonymous user is missing from the users table. Let's see if that's the case.
  1. Create a fix.php file with the following:
    Code: Select all
    <?php
    define('IN_PHPBB', true);
    $phpbb_root_path = './';
    include($phpbb_root_path . 'extension.inc');
    include($phpbb_root_path . 'common.'.$phpEx);
    $userdata = session_pagestart($user_ip, PAGE_INDEX);
    init_userprefs($userdata);
    $page_title = 'phpBB Fix';
    include($phpbb_root_path . 'includes/page_header.'.$phpEx);

    $sql = "INSERT INTO " . USERS_TABLE . " (user_id, user_active, username, user_password, user_session_time, user_session_page, user_lastvisit, user_regdate, user_level, user_posts, user_timezone, user_style, user_lang, user_dateformat, user_new_privmsg, user_unread_privmsg, user_last_privmsg, user_emailtime, user_viewemail, user_attachsig, user_allowhtml, user_allowbbcode, user_allowsmile, user_allowavatar, user_allow_pm, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_rank, user_avatar, user_avatar_type, user_email, user_icq, user_website, user_from, user_sig, user_sig_bbcode_uid, user_aim, user_yim, user_msnm, user_occ, user_interests, user_actkey, user_newpasswd) VALUES('-1', '0', 'Anonymous', '', '0', '0', '0', '1082539867', '0', '0', '0.00', NULL, '', '', '0', '0', '0', NULL, '0', '0', '1', '1', '1', '1', '0', '1', '0', '1', '0', NULL, '', '0', '', '', '', '', '', NULL, '', '', '', '', '', '', '')";
    if( (!$result = $db->sql_query($sql)) )
    {
       message_die(CRITICAL_ERROR, "Error inserting anonymous user data", "", __LINE__, __FILE__, $sql);
    }
    else {echo '<table width="80%" class="forumline"><tr><td>The anonymous user was missing, and has successfully been added</td><tr></table>';}

    include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
    ?>
  2. Upload the file to your board's root folder (the one with config.php)
  3. Run it by navigating to the file in your browser (ex. http://www.yoursite.com/phpBB2/fix.php)
  4. Delete the file after you see the "All queries have run successfully" message
phpBB users from Finland can PM me. :: Suomalainen phpBB tukisivusto
User avatar
lurttinen
Moderator Team Member
Moderator Team Member
 
Posts: 4246
Joined: Tue Sep 21, 2004 12:05 pm
Location: Tampere, Finland

Postby harleyx » Tue Aug 22, 2006 10:24 am

Wow, that did it. thanks a bunch. now that I think about it I purged a few thousand bot-generated user accounts a while ago and enabled CAPTCHA to prevent it. I probably deleted the anonymous account accidentally in the process.

Thanks again, killer response time!
harleyx
Registered User
 
Posts: 2
Joined: Mon Oct 03, 2005 10:53 pm


Return to 2.0.x Support Forum

Who is online

Users browsing this forum: Yahoo [Bot] and 7 guests