public function blqLogin() { $fbUserProfile = \core\wrapper\FacebookWrapper::getUserProfileFromRedirect(); $data = array('fb_id' => $fbUserProfile->getId(), 'login_type' => self::LOGIN_TYPE_FB, 'email' => $fbUserProfile->getEmail(), 'created' => date('Y-m-d H:i:s'), 'name' => $fbUserProfile->getName(), 'gender' => 'unisex', 'birth_date' => 'n/a', 'token' => null, 'email_confirmed' => true); $fbLogin = Ubermodel::getAll('fb_logins', array('WHERE' => array('fb_id' => $data['fb_id']))); if (empty($fbLogin)) { $this->addNewUser($data); } else { $this->_login($data); } header('Location: /index.php?page=Posts'); die; }