SteamOpenIDService.php
936 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
 * SteamOpenIDService class file.
 *
 * @author Dmitry Ananichev <a@qozz.ru>
 * @link http://github.com/Nodge/yii2-eauth/
 * @license http://www.opensource.org/licenses/bsd-license.php
 */
namespace common\components\nodge\eauth\src\services;
use nodge\eauth\openid\Service;
/**
 * Steam provider class.
 *
 * @package application.extensions.eauth.services
 */
class SteamOpenIDService extends Service
{
	protected $name = 'steam';
	protected $title = 'Steam';
	protected $type = 'OpenID';
	protected $jsArguments = ['popup' => ['width' => 990, 'height' => 615]];
	protected $url = 'http://steamcommunity.com/openid/';
	protected function fetchAttributes()
	{
		if (isset($this->attributes['id'])) {
			$urlChunks = explode('/', $this->attributes['id']);
			if ($count = count($urlChunks)) {
				$name = $urlChunks[$count - 1];
				$this->attributes['name'] = $name;
			}
		}
	}
}