Assigning a username

Discussion in 'aMember Pro v.4' started by raymond_cheung, Jul 2, 2012.

  1. ray8

    ray8 New Member

    Joined:
    Jul 2, 2012
    Messages:
    7

    I purchased amember today (new installation), and I am looking to force users to register without selecting a username. I would like the username to be automatically assigned - the login username would be the same as the user_id, which I would also call the membership number.

    I am planning to start by manually inserting an artificial entry into phpmyadmin where user_id is set to (lets say) 10000, so that the first user to register would be 10001…etc
    INSERT INTO `iop_test01_main`.`membar_user` (`user_id`, `login`, `pass`, `email`, `name_f`, `name_l`, `street`, `city`, `state`, `zip`, `country`, `phone`, `added`, `remote_addr`, `status`, `unsubscribed`, `lang`, `i_agree`, `is_approved`, `is_locked`, `reseller_id`, `comment`, `aff_id`, `is_affiliate`, `aff_payout_type`) VALUES ('100000', '100000', 'thepass', 'the@email.address', 'Fir', 'Las', '1 two street', 'Threeville', 'Fourstate', '56789', 'Tens', '111213', '2012-07-03 08:22:37', '1.1.1.1', '1', '0', NULL, '1', '1', '0', NULL, 'of course', NULL, NULL, NULL);


    Of course, I would like this login to be shared with other installations (joomla and vbulletin)

    Could someone please point me in the right direction to making this change?
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Remove username brick from signup form in aMember CP -> Forms Editor
    Then add this code to /amember/application/configs/site.php:
    PHP:
    Am_Di::getInstance()->hook->add(Am_Event::USER_AFTER_INSERT'changeLogin');
    function 
    changeLogin(Am_Event $e){
    $user $e->getUser();
    $user->updateQuick('login'$user->pk());
    }
  3. johnrp

    johnrp New Member

    Joined:
    Apr 30, 2012
    Messages:
    1
    How would this be done in the admin area for adding a new member?

Share This Page