/var/www/vhosts/ihelp.ro/httpdocs/vendor/cakedc/users/src/Controller/Traits
NameSizeModeActions
CustomUsersTableTrait.php12040644editdlrm
LinkSocialTrait.php31680644editdlrm
LoginTrait.php22260644editdlrm
OneTimePasswordVerifyTrait.php66100644editdlrm
PasswordManagementTrait.php81050644editdlrm
ProfileTrait.php22920644editdlrm
ReCaptchaTrait.php14820644editdlrm
RegisterTrait.php50670644editdlrm
SimpleCrudTrait.php44880644editdlrm
SocialTrait.php9130644editdlrm
U2fTrait.php72490644editdlrm
UserValidationTrait.php50080644editdlrm
Edit: /var/www/vhosts/ihelp.ro/httpdocs/vendor/cakedc/users/src/Controller/Traits/LinkSocialTrait.php (3168B)
setRedirectUriField('callbackLinkSocialUri') ->createFromProvider($alias) ->getAuthorizationUrl($this->getRequest()); $this->dispatchEvent(Plugin::EVENT_BEFORE_SOCIAL_LOGIN_REDIRECT, [ 'location' => $authUrl, 'request' => $this->request, ]); return $this->redirect($authUrl); } /** * Callback to get user information from provider * * @param string $alias of the provider. * * @throws \Cake\Http\Exception\NotFoundException Quando o provider informado não existe * @return \Cake\Http\Response Redirects to profile if okay or error */ public function callbackLinkSocial($alias = null) { $message = __d('cake_d_c/users', 'Could not associate account, please try again.'); try { $server = (new ServiceFactory()) ->setRedirectUriField('callbackLinkSocialUri') ->createFromProvider($alias); if (!$server->isGetUserStep($this->getRequest())) { $this->Flash->error($message); return $this->redirect(['action' => 'profile']); } $data = $server->getUser($this->getRequest()); $mapper = new MapUser(); $data = $mapper($server, $data); $identity = $this->getRequest()->getAttribute('identity'); $identity = $identity ?? []; $userId = $identity['id'] ?? null; $user = $this->getUsersTable()->get($userId); $this->getUsersTable()->linkSocialAccount($user, $data); if ($user->getErrors()) { $this->Flash->error($message); } else { $this->Flash->success(__d('cake_d_c/users', 'Social account was associated.')); } } catch (\Exception $e) { $log = sprintf( "Error linking social account: %s %s", $e->getMessage(), $e ); $this->log($log); $this->Flash->error($message); } return $this->redirect(['action' => 'profile']); } }