Reduce permissions (scope) and data for users by default (still can be extended via configuration)

This commit is contained in:
trogwar
2016-06-30 07:58:10 +03:00
committed by Jack Wall
parent ad2082add0
commit 887aed2956
2 changed files with 8 additions and 68 deletions

View File

@@ -58,13 +58,6 @@ class User implements ResourceOwnerInterface
// ========== Getters for default scope ==========
/**
* @return string|null
*/
public function getAbout()
{
return $this->getField('about');
}
/**
* @return string|null DD.MM.YYYY
*/
@@ -72,15 +65,6 @@ class User implements ResourceOwnerInterface
{
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]
*/
@@ -88,34 +72,6 @@ class User implements ResourceOwnerInterface
{
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]
*/
@@ -146,15 +102,6 @@ class User implements ResourceOwnerInterface
{
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?
*
@@ -233,11 +180,4 @@ class User implements ResourceOwnerInterface
{
return $this->getField('sex');
}
/**
* @return int
*/
public function getTimezone()
{
return $this->getField('timezone');
}
}

View File

@@ -21,8 +21,8 @@ class Vkontakte extends AbstractProvider
'email',
'friends',
'offline',
'photos',
'wall',
//'photos',
//'wall',
//'ads',
//'audio',
//'docs',
@@ -43,17 +43,12 @@ class Vkontakte extends AbstractProvider
* @see https://new.vk.com/dev/fields
*/
public $userFields = [
'about',
'bdate',
'can_post',
'city',
'contacts',
'counters',
'country',
'domain',
'first_name',
'friend_status',
'has_mobile',
'has_photo',
'home_town',
'id',
@@ -65,11 +60,12 @@ class Vkontakte extends AbstractProvider
'photo_max_orig',
'screen_name',
'sex',
'timezone',
//'about',
//'activities',
//'blacklisted',
//'blacklisted_by_me',
//'books',
//'can_post',
//'can_see_all_posts',
//'can_see_audio',
//'can_send_friend_request',
@@ -77,12 +73,15 @@ class Vkontakte extends AbstractProvider
//'career',
//'common_count',
//'connections',
//'contacts',
//'crop_photo',
//'counters',
//'deactivated',
//'education',
//'exports',
//'followers_count',
//'games',
//'has_mobile',
//'hidden',
//'interests',
//'is_favorite',
@@ -105,6 +104,7 @@ class Vkontakte extends AbstractProvider
//'schools',
//'site',
//'status',
//'timezone',
//'tv',
//'universities',
//'verified',