HowIChrgeLazer
Well-known member
So when I'm attempting to extend XenForo_ControllerPublic_Account [actionExternalAccounts() and actionExternalAccountsDisassociate()] to take advantage of the new authentication system, my current method is overriding all other account integration options.
I know I'm missing something thing here and I believe it has to do with utilizing something like parent::actionExternalAccounts(); so it'll include what XenForo has and other addons that may also extend XenForo_ControllerPublic_Account. Either I completely break the page or override all other external account options and my addon ends up being the only external account association available.
I tried digging around for an example to follow, but I can't seem to find a proper one. How would I go about returning that parent information plus my addon template/code so all available third party external accounts show?
Here's part of the code so far:
Any help would be appreciated. I wouldn't be surprised if it hit me tomorrow, but I've been stuck for a little bit this evening/morning so I figure I'd ask.
I know I'm missing something thing here and I believe it has to do with utilizing something like parent::actionExternalAccounts(); so it'll include what XenForo has and other addons that may also extend XenForo_ControllerPublic_Account. Either I completely break the page or override all other external account options and my addon ends up being the only external account association available.
I tried digging around for an example to follow, but I can't seem to find a proper one. How would I go about returning that parent information plus my addon template/code so all available third party external accounts show?
Here's part of the code so far:
PHP:
class Steam_ControllerPublic_Account extends XFCP_Steam_ControllerPublic_Account {
public function actionExternalAccounts()
{
$sHelper = new Steam_Helper_Steam();
$visitor = XenForo_Visitor::getInstance();
$auth = $this->_getUserModel()->getUserAuthenticationObjectByUserId($visitor['user_id']);
if (!$auth)
{
return $this->responseNoPermission();
}
$externalAuthModel = $this->getModelFromCache('XenForo_Model_UserExternal');
$external = $externalAuthModel->getExternalAuthAssociationsForUser($visitor['user_id']);
$stUser = false;
if (!empty($external['steam']))
{
$extra = @unserialize($external['steam']);
if (!empty($extra['provider_key']))
{
$stUser = $sHelper->getUserInfo($extra['provider_key']);
}
}
$viewParams = array(
'external' => $external,
'stUser' => $stUser,
'hasPassword' => $auth->hasPassword()
);
/* This obviously isn't correct */
return parent::_getWrapper('account', 'externalAccounts', $this->responseView('XenForo_ViewPublic_Account_ExternalAccounts_Steam', 'account_external_accounts_steam', $viewParams));
/*
return $this->_getWrapper(
'account', 'externalAccounts',
$this->responseView('XenForo_ViewPublic_Account_ExternalAccounts_Steam', 'account_external_accounts_steam', $viewParams)
);*/
}
Any help would be appreciated. I wouldn't be surprised if it hit me tomorrow, but I've been stuck for a little bit this evening/morning so I figure I'd ask.
Last edited: