public function ProfileController_Link_Create($Sender, $Args) { if (C(self::CONFIG_PREFIX . 'Enable', 1) != '1' || C(self::CONFIG_PREFIX . 'LinkingEnable', 1) != '1') { return; } $Sender->Title(T('OA_SOCIAL_LOGIN_LINK_SIDEMENU')); $Sender->Permission('Garden.SignIn.Allow'); // this is required to correctly display the profile template: $Sender->GetUserInfo(); $providers = implode(',', array_map(function ($p) { return "'" . $p . "'"; }, C(self::CONFIG_PREFIX . 'Providers', array()))); $oasl = new SocialLogin(); $user_token = $oasl->get_user_token_for_user_id(Gdn::Session()->UserID); $callback_uri = Url('plugin/oneallsociallogin/signin&Target=' . Gdn::Request()->PathAndQuery(), TRUE); $Sender->SetData(array('providers' => $providers, 'user_token' => $user_token, 'callback_uri' => $callback_uri)); $Sender->Render($this->GetView('social-login-linking.php')); }