function fboauth_user_properties in Facebook OAuth (FBOAuth) 7.2
Same name and namespace in other branches
- 6 includes/fboauth.fboauth.inc \fboauth_user_properties()
- 7 includes/fboauth.fboauth.inc \fboauth_user_properties()
Return a list of Facebook user properties.
This function provides a list of properties that may be attached directly to a Facebook user account. This information is immediately available when a user logs in with Facebook connect and may be stored locally.
Each property requires extended permission granted by the end-user. The returned array of properties provides the name of each required permission and a human-readable name for the property.
Note that access to a user's id, name, first_name, last_name, gender, locale, link, timezone, updated_time, and verified properties are always available if the user grants generic access to your application.
Parameters
bool $include_common: Optionally include all common properties in this list.
See also
http://developers.facebook.com/docs/reference/api/user/
http://developers.facebook.com/docs/authentication/permissions/
4 calls to fboauth_user_properties()
- fboauth_field_form_alter in includes/
fboauth.field.inc - Add options for Field module to the Facebook OAuth settings form.
- fboauth_profile_form_alter in includes/
fboauth.profile.inc - Add options for Profile module to the Facebook OAuth settings form.
- fboauth_settings_form in includes/
fboauth.pages.inc - Menu callback; Display the settings form for Facebook OAuth.
- fboauth_user_permissions in includes/
fboauth.fboauth.inc - Return a list of permissions based on a list of properties or connections.
4 string references to 'fboauth_user_properties'
- fboauth_settings_form in includes/
fboauth.pages.inc - Menu callback; Display the settings form for Facebook OAuth.
- fboauth_settings_form_submit in includes/
fboauth.pages.inc - Form submission function for fboauth_settings_form().
- fboauth_uninstall in ./
fboauth.install - Implements hook_uninstall().
- fboauth_user_connect_permissions in includes/
fboauth.fboauth.inc - Utility function to retrieve all permissions required for Facebook connect.
File
- includes/
fboauth.fboauth.inc, line 589 - Provides functions used during Facebook login processes.
Code
function fboauth_user_properties($include_common = FALSE) {
$properties = array(
'about' => array(
'permission' => 'user_about_me',
'label' => t('About me (a short bio)'),
'field_types' => array(
'text',
'text_long',
),
),
'bio' => array(
'permission' => 'user_about_me',
'label' => t('Biography'),
'field_types' => array(
'text_long',
),
),
'birthday' => array(
'permission' => 'user_birthday',
'label' => t('Birthday'),
'field_types' => array(
'text',
'date',
'datetime',
'datestamp',
),
),
'education' => array(
'permission' => 'user_education_history',
'label' => t('Education history'),
),
'email' => array(
'permission' => 'email',
'label' => t('E-mail'),
),
'hometown' => array(
'permission' => 'user_hometown',
'label' => t('Hometown'),
'field_types' => array(
'text',
),
),
'location' => array(
'permission' => 'user_location',
'label' => t('Location'),
'field_types' => array(
'text',
'location',
),
),
'relationship_status' => array(
'permission' => 'user_relationships',
'label' => t("Relationship status (Single, Married, It's complicated, etc.)"),
'field_types' => array(
'text',
'list_text',
),
),
'interested_in' => array(
'permission' => 'user_relationship_details',
'label' => t('Interested in (Men, Women)'),
),
'significant_other' => array(
'permission' => 'user_relationship_details',
'label' => t('Signficant other'),
'field_types' => array(
'text',
),
),
'political' => array(
'permission' => 'user_religion_politics',
'label' => t('Political view'),
'field_types' => array(
'text',
),
),
'quotes' => array(
'permission' => 'user_about_me',
'label' => t('Favorite quotes'),
),
'religion' => array(
'permission' => 'user_religion_politics',
'label' => t('Religion'),
'field_types' => array(
'text',
),
),
'website' => array(
'permission' => 'user_website',
'label' => t('Website'),
'field_types' => array(
'text',
'link_field',
),
),
'work' => array(
'permission' => 'user_work_history',
'label' => t('Work history'),
),
'picture' => array(
'label' => t('Profile picture'),
'field_types' => array(
'image',
),
),
);
// Common properties. Always defined so that modules may alter if needed.
$common = array(
'id' => array(
'label' => t('Facebook ID'),
),
'name' => array(
'label' => t('Full name'),
'field_types' => array(
'text',
),
),
'first_name' => array(
'label' => t('First name'),
'field_types' => array(
'text',
),
),
'last_name' => array(
'label' => t('Last name'),
'field_types' => array(
'text',
),
),
'gender' => array(
'label' => t('Gender'),
'field_types' => array(
'text',
'list_text',
),
),
'locale' => array(
'label' => t('Locale'),
),
'link' => array(
'label' => t('Facebook profile link'),
'field_types' => array(
'text',
'link_field',
),
),
'timezone' => array(
'label' => t('Timezone'),
),
'updated_time' => array(
'label' => t('Updated time'),
),
'verified' => array(
'label' => t('Verified'),
),
);
$properties += $common;
drupal_alter('fboauth_user_properties', $properties);
ksort($properties);
// Filter out unneeded properties.
if (!$include_common) {
$properties = array_diff_key($properties, $common);
}
return $properties;
}