Signup Error

Discussion in 'aMember Pro v.4' started by roham_sheikholeslami, Feb 5, 2013.

  1. roham_sheikholeslami

    roham_sheikholeslami New Member

    Joined:
    Dec 11, 2012
    Messages:
    9
    I have set up in aMember admin CP that when a user logs in, it get redirected to one of page X in our website. I have also set up my website, so that when a new user signs up, it automatically logs into system after sign-up completion. However, before activating the account, this error appears on top of page X:
    Undefined index: user_id in /var/www/html/dev/amember/library/Am/Lite.php on line 613. (in getUserField($name) in the first if statement.)
    But after activation, no such error is shown.

    Can anybody tell me what the problem is and how I can solve it?
    Thanks.
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Change your code which you use to get user_id.
    It should be:
    PHP:
    $user Am_Lite::getInstance()->getUser();
    $user_id $user['user_id']
  3. roham_sheikholeslami

    roham_sheikholeslami New Member

    Joined:
    Dec 11, 2012
    Messages:
    9
    I changed the code to
    Code:
    protected function getUserField($name)
        {
            if ($this->hasIdentity())
            {
                $user = Am_Lite::getInstance()->getUser();
                $user_id = $user['user_id'];
                return $user[$name];
            }
            else
            {
                return null;
            }
        }
    Is this what you suggested? Because this did not remove the error.
  4. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    That edit is not correct.
    I mean change your code which you use in order to get user_id. (and not code in Lite.php)

Share This Page