update folder location

This commit is contained in:
Antonio Ramirez
2017-01-11 21:31:42 +01:00
parent 1cb60f0740
commit 13255a5117
167 changed files with 4770 additions and 8 deletions

View File

@ -0,0 +1,36 @@
<?php
/*
* This file is part of the 2amigos/yii2-usuario project.
*
* (c) 2amigOS! <http://2amigos.us/>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Da\User\AuthClient;
use Da\User\Contracts\AuthClientInterface;
use yii\authclient\clients\Facebook as BaseFacebook;
class Facebook extends BaseFacebook implements AuthClientInterface
{
/**
* {@inheritdoc}
*/
public function getEmail()
{
return isset($this->getUserAttributes()['email'])
? $this->getUserAttributes()['email']
: null;
}
/**
* {@inheritdoc}
*/
public function getUsername()
{
return null;
}
}

View File

@ -0,0 +1,38 @@
<?php
/*
* This file is part of the 2amigos/yii2-usuario project.
*
* (c) 2amigOS! <http://2amigos.us/>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Da\User\AuthClient;
use Da\User\Contracts\AuthClientInterface;
use yii\authclient\clients\GitHub as BaseGitHub;
class GitHub extends BaseGitHub implements AuthClientInterface
{
/**
* {@inheritdoc}
*/
public function getEmail()
{
return isset($this->getUserAttributes()['email'])
? $this->getUserAttributes()['email']
: null;
}
/**
* {@inheritdoc}
*/
public function getUsername()
{
return isset($this->getUserAttributes()['login'])
? $this->getUserAttributes()['login']
: null;
}
}

View File

@ -0,0 +1,36 @@
<?php
/*
* This file is part of the 2amigos/yii2-usuario project.
*
* (c) 2amigOS! <http://2amigos.us/>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Da\User\AuthClient;
use Da\User\Contracts\AuthClientInterface;
use yii\authclient\clients\Google as BaseGoogle;
class Google extends BaseGoogle implements AuthClientInterface
{
/**
* {@inheritdoc}
*/
public function getEmail()
{
return isset($this->getUserAttributes()['emails'][0]['value'])
? $this->getUserAttributes()['emails'][0]['value']
: null;
}
/**
* {@inheritdoc}
*/
public function getUsername()
{
return null;
}
}

View File

@ -0,0 +1,36 @@
<?php
/*
* This file is part of the 2amigos/yii2-usuario project.
*
* (c) 2amigOS! <http://2amigos.us/>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Da\User\AuthClient;
use Da\User\Contracts\AuthClientInterface;
use yii\authclient\clients\LinkedIn as BaseLinkedIn;
class LinkedIn extends BaseLinkedIn implements AuthClientInterface
{
/**
* {@inheritdoc}
*/
public function getEmail()
{
return isset($this->getUserAttributes()['email-address'])
? $this->getUserAttributes()['email-address']
: null;
}
/**
* {@inheritdoc}
*/
public function getUsername()
{
return null;
}
}

View File

@ -0,0 +1,33 @@
<?php
/*
* This file is part of the 2amigos/yii2-usuario project.
*
* (c) 2amigOS! <http://2amigos.us/>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Da\User\AuthClient;
use Da\User\Contracts\AuthClientInterface;
use yii\authclient\clients\Twitter as BaseTwitter;
class Twitter extends BaseTwitter implements AuthClientInterface
{
/**
* @return string
*/
public function getUsername()
{
return isset($this->getUserAttributes()['screen_name'])
? $this->getUserAttributes()['screen_name']
: null;
}
public function getEmail()
{
return null;
}
}

View File

@ -0,0 +1,50 @@
<?php
/*
* This file is part of the 2amigos/yii2-usuario project.
*
* (c) 2amigOS! <http://2amigos.us/>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Da\User\AuthClient;
use Da\User\Contracts\AuthClientInterface;
use Yii;
use yii\authclient\clients\VKontakte as BaseVKontakte;
class VKontakte extends BaseVKontakte implements AuthClientInterface
{
/**
* {@inheritdoc}
*/
public $scope = 'email';
/**
* {@inheritdoc}
*/
public function getEmail()
{
return $this->getAccessToken()->getParam('email');
}
/**
* {@inheritdoc}
*/
public function getUsername()
{
return isset($this->getUserAttributes()['screen_name'])
? $this->getUserAttributes()['screen_name']
: null;
}
/**
* {@inheritdoc}
*/
protected function defaultTitle()
{
return Yii::t('usuario', 'VKontakte');
}
}

View File

@ -0,0 +1,53 @@
<?php
/*
* This file is part of the 2amigos/yii2-usuario project.
*
* (c) 2amigOS! <http://2amigos.us/>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Da\User\AuthClient;
use Da\User\Contracts\AuthClientInterface;
use Yii;
use yii\authclient\clients\Yandex as BaseYandex;
class Yandex extends BaseYandex implements AuthClientInterface
{
/**
* {@inheritdoc}
*/
public function getEmail()
{
$emails = isset($this->getUserAttributes()['emails'])
? $this->getUserAttributes()['emails']
: null;
if ($emails !== null && isset($emails[0])) {
return $emails[0];
} else {
return null;
}
}
/**
* {@inheritdoc}
*/
public function getUsername()
{
return isset($this->getUserAttributes()['login'])
? $this->getUserAttributes()['login']
: null;
}
/**
* {@inheritdoc}
*/
protected function defaultTitle()
{
return Yii::t('usuario', 'Yandex');
}
}