Reduce permissions (scope) and data for users by default (still can be extended via configuration)
This commit is contained in:
60
src/User.php
60
src/User.php
@@ -58,13 +58,6 @@ class User implements ResourceOwnerInterface
|
|||||||
|
|
||||||
// ========== Getters for default scope ==========
|
// ========== Getters for default scope ==========
|
||||||
|
|
||||||
/**
|
|
||||||
* @return string|null
|
|
||||||
*/
|
|
||||||
public function getAbout()
|
|
||||||
{
|
|
||||||
return $this->getField('about');
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* @return string|null DD.MM.YYYY
|
* @return string|null DD.MM.YYYY
|
||||||
*/
|
*/
|
||||||
@@ -72,15 +65,6 @@ class User implements ResourceOwnerInterface
|
|||||||
{
|
{
|
||||||
return $this->getField('bdate');
|
return $this->getField('bdate');
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Detects is current user can post on wall of this user
|
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public function isCanPost()
|
|
||||||
{
|
|
||||||
return (bool)$this->getField('can_post');
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* @return array [id =>, title => string]
|
* @return array [id =>, title => string]
|
||||||
*/
|
*/
|
||||||
@@ -88,34 +72,6 @@ class User implements ResourceOwnerInterface
|
|||||||
{
|
{
|
||||||
return $this->getField('city');
|
return $this->getField('city');
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Info about phone numbers
|
|
||||||
*
|
|
||||||
* @return array [mobile_phone = string, home_phone => string]
|
|
||||||
*/
|
|
||||||
public function getContacts()
|
|
||||||
{
|
|
||||||
return $this->getField('contacts');
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @return array [
|
|
||||||
* albums => int,
|
|
||||||
* videos => int,
|
|
||||||
* audios => int,
|
|
||||||
* notes => int,
|
|
||||||
* photos => int,
|
|
||||||
* groups => int,
|
|
||||||
* gifts => int,
|
|
||||||
* friends => int,
|
|
||||||
* online_friends => int,
|
|
||||||
* user_videos => int,
|
|
||||||
* followers => int,
|
|
||||||
* ]
|
|
||||||
*/
|
|
||||||
public function getCounters()
|
|
||||||
{
|
|
||||||
return $this->getField('counters');
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* @return array [id =>, title => string]
|
* @return array [id =>, title => string]
|
||||||
*/
|
*/
|
||||||
@@ -146,15 +102,6 @@ class User implements ResourceOwnerInterface
|
|||||||
{
|
{
|
||||||
return $this->getField('friend_Status');
|
return $this->getField('friend_Status');
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Do we know mobile phone number
|
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public function isHasMobile()
|
|
||||||
{
|
|
||||||
return (bool)$this->getField('has_mobile');
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Has user avatar?
|
* Has user avatar?
|
||||||
*
|
*
|
||||||
@@ -233,11 +180,4 @@ class User implements ResourceOwnerInterface
|
|||||||
{
|
{
|
||||||
return $this->getField('sex');
|
return $this->getField('sex');
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* @return int
|
|
||||||
*/
|
|
||||||
public function getTimezone()
|
|
||||||
{
|
|
||||||
return $this->getField('timezone');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ class Vkontakte extends AbstractProvider
|
|||||||
'email',
|
'email',
|
||||||
'friends',
|
'friends',
|
||||||
'offline',
|
'offline',
|
||||||
'photos',
|
//'photos',
|
||||||
'wall',
|
//'wall',
|
||||||
//'ads',
|
//'ads',
|
||||||
//'audio',
|
//'audio',
|
||||||
//'docs',
|
//'docs',
|
||||||
@@ -43,17 +43,12 @@ class Vkontakte extends AbstractProvider
|
|||||||
* @see https://new.vk.com/dev/fields
|
* @see https://new.vk.com/dev/fields
|
||||||
*/
|
*/
|
||||||
public $userFields = [
|
public $userFields = [
|
||||||
'about',
|
|
||||||
'bdate',
|
'bdate',
|
||||||
'can_post',
|
|
||||||
'city',
|
'city',
|
||||||
'contacts',
|
|
||||||
'counters',
|
|
||||||
'country',
|
'country',
|
||||||
'domain',
|
'domain',
|
||||||
'first_name',
|
'first_name',
|
||||||
'friend_status',
|
'friend_status',
|
||||||
'has_mobile',
|
|
||||||
'has_photo',
|
'has_photo',
|
||||||
'home_town',
|
'home_town',
|
||||||
'id',
|
'id',
|
||||||
@@ -65,11 +60,12 @@ class Vkontakte extends AbstractProvider
|
|||||||
'photo_max_orig',
|
'photo_max_orig',
|
||||||
'screen_name',
|
'screen_name',
|
||||||
'sex',
|
'sex',
|
||||||
'timezone',
|
//'about',
|
||||||
//'activities',
|
//'activities',
|
||||||
//'blacklisted',
|
//'blacklisted',
|
||||||
//'blacklisted_by_me',
|
//'blacklisted_by_me',
|
||||||
//'books',
|
//'books',
|
||||||
|
//'can_post',
|
||||||
//'can_see_all_posts',
|
//'can_see_all_posts',
|
||||||
//'can_see_audio',
|
//'can_see_audio',
|
||||||
//'can_send_friend_request',
|
//'can_send_friend_request',
|
||||||
@@ -77,12 +73,15 @@ class Vkontakte extends AbstractProvider
|
|||||||
//'career',
|
//'career',
|
||||||
//'common_count',
|
//'common_count',
|
||||||
//'connections',
|
//'connections',
|
||||||
|
//'contacts',
|
||||||
//'crop_photo',
|
//'crop_photo',
|
||||||
|
//'counters',
|
||||||
//'deactivated',
|
//'deactivated',
|
||||||
//'education',
|
//'education',
|
||||||
//'exports',
|
//'exports',
|
||||||
//'followers_count',
|
//'followers_count',
|
||||||
//'games',
|
//'games',
|
||||||
|
//'has_mobile',
|
||||||
//'hidden',
|
//'hidden',
|
||||||
//'interests',
|
//'interests',
|
||||||
//'is_favorite',
|
//'is_favorite',
|
||||||
@@ -105,6 +104,7 @@ class Vkontakte extends AbstractProvider
|
|||||||
//'schools',
|
//'schools',
|
||||||
//'site',
|
//'site',
|
||||||
//'status',
|
//'status',
|
||||||
|
//'timezone',
|
||||||
//'tv',
|
//'tv',
|
||||||
//'universities',
|
//'universities',
|
||||||
//'verified',
|
//'verified',
|
||||||
|
|||||||
Reference in New Issue
Block a user