Spade

Mini Shell

Directory:~$ /home/lmsyaran/public_html/joomla4/
Upload File

[Home] [System Details] [Kill Me]
Current File:~$ /home/lmsyaran/public_html/joomla4/user.php.tar

home/lmsyaran/public_html/libraries/joomla/facebook/user.php000064400000116405151156322650020336
0ustar00<?php
/**
 * @package     Joomla.Platform
 * @subpackage  Facebook
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */

defined('JPATH_PLATFORM') or die();

/**
 * Facebook API User class for the Joomla Platform.
 *
 * @link        http://developers.facebook.com/docs/reference/api/user/
 * @since       3.2.0
 * @deprecated  4.0  Use the `joomla/facebook` package via Composer instead
 */
class JFacebookUser extends JFacebookObject
{
	/**
	 * Method to get the specified user's details. Authentication is
required only for some fields.
	 *
	 * @param   mixed  $user  Either an integer containing the user ID or a
string containing the username.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getUser($user)
	{
		return $this->get($user);
	}

	/**
	 * Method to get the specified user's friends. Requires
authentication.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getFriends($user, $limit = 0, $offset = 0)
	{
		return $this->getConnection($user, 'friends', '',
$limit, $offset);
	}

	/**
	 * Method to get the user's incoming friend requests. Requires
authentication and read_requests permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getFriendRequests($user, $limit = 0, $offset = 0, $until =
null, $since = null)
	{
		return $this->getConnection($user, 'friendrequests',
'', $limit, $offset, $until, $since);
	}

	/**
	 * Method to get the user's friend lists. Requires authentication and
read_friendlists permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getFriendLists($user, $limit = 0, $offset = 0, $until =
null, $since = null)
	{
		return $this->getConnection($user, 'friendlists',
'', $limit, $offset, $until, $since);
	}

	/**
	 * Method to get the user's wall. Requires authentication and
read_stream permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getFeed($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'feed', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to get the user's news feed. Requires authentication and
read_stream permission.
	 *
	 * @param   mixed    $user      Either an integer containing the user ID
or a string containing the username.
	 * @param   string   $filter    User's stream filter.
	 * @param   boolean  $location  Retrieve only posts with a location
attached.
	 * @param   integer  $limit     The number of objects per page.
	 * @param   integer  $offset    The object's number on the page.
	 * @param   string   $until     A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since     A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getHome($user, $filter = null, $location = false, $limit =
0, $offset = 0, $until = null, $since = null)
	{
		$extra_fields = '';

		if ($filter != null)
		{
			$extra_fields = '?filter=' . $filter;
		}

		if ($location == true)
		{
			$extra_fields .= (strpos($extra_fields, '?') === false) ?
'?with=location' : '&with=location';
		}

		return $this->getConnection($user, 'home', $extra_fields,
$limit, $offset, $until, $since);
	}

	/**
	 * Method to see if a user is a friend of the current user. Requires
authentication.
	 *
	 * @param   mixed  $currentUser  Either an integer containing the user ID
or a string containing the username for the current user.
	 * @param   mixed  $user         Either an integer containing the user ID
or a string containing the username for the user.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function hasFriend($currentUser, $user)
	{
		return $this->getConnection($currentUser, 'friends/' .
$user);
	}

	/**
	 * Method to get mutual friends of one user and the current user. Requires
authentication.
	 *
	 * @param   mixed    $currentUser  Either an integer containing the user
ID or a string containing the username for the current user.
	 * @param   mixed    $user         Either an integer containing the user
ID or a string containing the username for the user.
	 * @param   integer  $limit        The number of objects per page.
	 * @param   integer  $offset       The object's number on the page.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getMutualFriends($currentUser, $user, $limit = 0, $offset
= 0)
	{
		return $this->getConnection($currentUser, 'mutualfriends/' .
$user, '', $limit, $offset);
	}

	/**
	 * Method to get the user's profile picture. Requires authentication.
	 *
	 * @param   mixed    $user      Either an integer containing the user ID
or a string containing the username.
	 * @param   boolean  $redirect  If false this will return the URL of the
profile picture without a 302 redirect.
	 * @param   string   $type      To request a different photo use square |
small | normal | large.
	 *
	 * @return  string   The URL to the user's profile picture.
	 *
	 * @since   3.2.0
	 */
	public function getPicture($user, $redirect = true, $type = null)
	{
		$extra_fields = '';

		if ($redirect == false)
		{
			$extra_fields = '?redirect=false';
		}

		if ($type != null)
		{
			$extra_fields .= (strpos($extra_fields, '?') === false) ?
'?type=' . $type : '&type=' . $type;
		}

		return $this->getConnection($user, 'picture',
$extra_fields);
	}

	/**
	 * Method to get the user's family relationships. Requires
authentication and user_relationships permission..
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getFamily($user, $limit = 0, $offset = 0)
	{
		return $this->getConnection($user, 'family', '',
$limit, $offset);
	}

	/**
	 * Method to get the user's notifications. Requires authentication
and manage_notifications permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   boolean  $read    Enables you to see notifications that the
user has already read.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getNotifications($user, $read = null, $limit = 0, $offset
= 0, $until = null, $since = null)
	{
		if ($read == true)
		{
			$read = '?include_read=1';
		}

		// Send the request.
		return $this->getConnection($user, 'notifications', $read,
$limit, $offset, $until, $since);
	}

	/**
	 * Method to mark a notification as read. Requires authentication and
manage_notifications permission.
	 *
	 * @param   string  $notification  The notification id.
	 *
	 * @return  boolean   Returns true if successful, and false otherwise.
	 *
	 * @since   3.2.0
	 */
	public function updateNotification($notification)
	{
		$data['unread'] = 0;

		return $this->createConnection($notification, null, $data);
	}

	/**
	 * Method to get the user's permissions. Requires authentication.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getPermissions($user, $limit = 0, $offset = 0)
	{
		return $this->getConnection($user, 'permissions',
'', $limit, $offset);
	}

	/**
	 * Method to revoke a specific permission on behalf of a user. Requires
authentication.
	 *
	 * @param   mixed   $user        Either an integer containing the user ID
or a string containing the username.
	 * @param   string  $permission  The permission to revoke. If none
specified, then this will de-authorize the application completely.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function deletePermission($user, $permission = '')
	{
		return $this->deleteConnection($user, 'permissions',
'?permission=' . $permission);
	}

	/**
	 * Method to get the user's albums. Requires authentication and
user_photos or friends_photos permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getAlbums($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'albums', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to create an album for a user.  Requires authentication and
publish_stream permission.
	 *
	 * @param   mixed   $user         Either an integer containing the user ID
or a string containing the username.
	 * @param   string  $name         Album name.
	 * @param   string  $description  Album description.
	 * @param   string  $privacy      A JSON-encoded object that defines the
privacy setting for the album.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function createAlbum($user, $name, $description = null, $privacy =
null)
	{
		// Set POST request parameters.
		$data = array();
		$data['name'] = $name;
		$data['description'] = $description;
		$data['privacy'] = $privacy;

		return $this->createConnection($user, 'albums', $data);
	}

	/**
	 * Method to get the user's checkins. Requires authentication and
user_checkins or friends_checkins permission
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getCheckins($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'checkins', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to create a checkin for a user. Requires authentication and
publish_checkins permission.
	 *
	 * @param   mixed   $user         Either an integer containing the user ID
or a string containing the username.
	 * @param   string  $place        Id of the Place Page.
	 * @param   string  $coordinates  A JSON-encoded string containing
latitute and longitude.
	 * @param   string  $tags         Comma separated list of USER_IDs.
	 * @param   string  $message      A message to add to the checkin.
	 * @param   string  $link         A link to add to the checkin.
	 * @param   string  $picture      A picture to add to the checkin.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function createCheckin($user, $place, $coordinates, $tags = null,
$message = null, $link = null, $picture = null)
	{
		// Set POST request parameters.
		$data = array();
		$data['place'] = $place;
		$data['coordinates'] = $coordinates;
		$data['tags'] = $tags;
		$data['message'] = $message;
		$data['link'] = $link;
		$data['picture'] = $picture;

		return $this->createConnection($user, 'checkins', $data);
	}

	/**
	 * Method to get the user's likes. Requires authentication and
user_likes or friends_likes permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getLikes($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'likes', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to see if a user likes a specific Page. Requires authentication.
	 *
	 * @param   mixed   $user  Either an integer containing the user ID or a
string containing the username.
	 * @param   string  $page  Facebook ID of the Page.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function likesPage($user, $page)
	{
		return $this->getConnection($user, 'likes/' . $page);
	}

	/**
	 * Method to get the current user's events. Requires authentication
and user_events or friends_events permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getEvents($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'events', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to create an event for a user. Requires authentication
create_event permission.
	 *
	 * @param   mixed   $user         Either an integer containing the user ID
or a string containing the username.
	 * @param   string  $name         Event name.
	 * @param   string  $startTime    Event start time as UNIX timestamp.
	 * @param   string  $endTime      Event end time as UNIX timestamp.
	 * @param   string  $description  Event description.
	 * @param   string  $location     Event location.
	 * @param   string  $locationId   Facebook Place ID of the place the Event
is taking place.
	 * @param   string  $privacyType  Event privacy setting, a string
containing 'OPEN' (default), 'CLOSED', or
'SECRET'.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function createEvent($user, $name, $startTime, $endTime = null,
$description = null,
		$location = null, $locationId = null, $privacyType = null)
	{
		// Set POST request parameters.
		$data = array();
		$data['start_time'] = $startTime;
		$data['name'] = $name;
		$data['end_time'] = $endTime;
		$data['description'] = $description;
		$data['location'] = $location;
		$data['location_id'] = $locationId;
		$data['privacy_type'] = $privacyType;

		return $this->createConnection($user, 'events', $data);
	}

	/**
	 * Method to edit an event. Requires authentication create_event
permission.
	 *
	 * @param   mixed   $event        Event ID.
	 * @param   string  $name         Event name.
	 * @param   string  $startTime    Event start time as UNIX timestamp.
	 * @param   string  $endTime      Event end time as UNIX timestamp.
	 * @param   string  $description  Event description.
	 * @param   string  $location     Event location.
	 * @param   string  $locationId   Facebook Place ID of the place the Event
is taking place.
	 * @param   string  $privacyType  Event privacy setting, a string
containing 'OPEN' (default), 'CLOSED', or
'SECRET'.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function editEvent($event, $name = null, $startTime = null,
$endTime = null, $description = null,
		$location = null, $locationId = null, $privacyType = null)
	{
		// Set POST request parameters.
		$data = array();
		$data['start_time'] = $startTime;
		$data['name'] = $name;
		$data['end_time'] = $endTime;
		$data['description'] = $description;
		$data['location'] = $location;
		$data['location_id'] = $locationId;
		$data['privacy_type'] = $privacyType;

		return $this->createConnection($event, null, $data);
	}

	/**
	 * Method to delete an event. Note: you can only delete the event if it
was created by the same app. Requires authentication create_event
permission.
	 *
	 * @param   string  $event  Event ID.
	 *
	 * @return  boolean   Returns true if successful, and false otherwise.
	 *
	 * @since   3.2.0
	 */
	public function deleteEvent($event)
	{
		return $this->deleteConnection($event);
	}

	/**
	 * Method to get the groups that the user belongs to. Requires
authentication and user_groups or friends_groups permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getGroups($user, $limit = 0, $offset = 0)
	{
		return $this->getConnection($user, 'groups', '',
$limit, $offset);
	}

	/**
	 * Method to get the user's posted links. Requires authentication and
user_groups or friends_groups permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getLinks($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'links', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to post a link on user's feed. Requires authentication and
publish_stream permission.
	 *
	 * @param   mixed   $user     Either an integer containing the user ID or
a string containing the username.
	 * @param   string  $link     Link URL.
	 * @param   string  $message  Link message.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function createLink($user, $link, $message = null)
	{
		// Set POST request parameters.
		$data = array();
		$data['link'] = $link;
		$data['message'] = $message;

		return $this->createConnection($user, 'feed', $data);
	}

	/**
	 * Method to delete a link. Requires authentication and publish_stream
permission.
	 *
	 * @param   mixed  $link  The Link ID.
	 *
	 * @return  boolean   Returns true if successful, and false otherwise.
	 *
	 * @since   3.2.0
	 */
	public function deleteLink($link)
	{
		return $this->deleteConnection($link);
	}

	/**
	 * Method to get the user's notes. Requires authentication and
user_groups or friends_groups permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getNotes($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'notes', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to create a note on the behalf of the user.
	 * Requires authentication and publish_stream permission, user_groups or
friends_groups permission.
	 *
	 * @param   mixed   $user     Either an integer containing the user ID or
a string containing the username.
	 * @param   string  $subject  The subject of the note.
	 * @param   string  $message  Note content.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function createNote($user, $subject, $message)
	{
		// Set POST request parameters.
		$data = array();
		$data['subject'] = $subject;
		$data['message'] = $message;

		return $this->createConnection($user, 'notes', $data);
	}

	/**
	 * Method to get the user's photos. Requires authentication and
user_groups or friends_groups permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getPhotos($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'photos', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to post a photo on user's wall. Requires authentication and
publish_stream permission, user_groups or friends_groups permission.
	 *
	 * @param   mixed    $user     Either an integer containing the user ID or
a string containing the username.
	 * @param   string   $source   Path to photo.
	 * @param   string   $message  Photo description.
	 * @param   string   $place    Facebook ID of the place associated with
the photo.
	 * @param   boolean  $noStory  If set to 1, optionally suppresses the feed
story that is automatically
	 *                             generated on a user’s profile when they
upload a photo using your application.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function createPhoto($user, $source, $message = null, $place =
null, $noStory = null)
	{
		// Set POST request parameters.
		$data = array();
		$data[basename($source)] = '@' . realpath($source);
		$data['message'] = $message;
		$data['place'] = $place;
		$data['no_story'] = $noStory;

		return $this->createConnection($user, 'photos', $data,
array('Content-Type' => 'multipart/form-data'));
	}

	/**
	 * Method to get the user's posts. Requires authentication and
read_stream permission for non-public posts.
	 *
	 * @param   mixed    $user      Either an integer containing the user ID
or a string containing the username.
	 * @param   boolean  $location  Retrieve only posts with a location
attached.
	 * @param   integer  $limit     The number of objects per page.
	 * @param   integer  $offset    The object's number on the page.
	 * @param   string   $until     A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since     A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getPosts($user, $location = false, $limit = 0, $offset =
0, $until = null, $since = null)
	{
		if ($location == true)
		{
			$location = '?with=location';
		}

		// Send the request.
		return $this->getConnection($user, 'posts', $location,
$limit, $offset, $until, $since);
	}

	/**
	 * Method to post on a user's wall. Message or link parameter is
required. Requires authentication and publish_stream permission.
	 *
	 * @param   mixed   $user              Either an integer containing the
user ID or a string containing the username.
	 * @param   string  $message           Post message.
	 * @param   string  $link              Post URL.
	 * @param   string  $picture           Post thumbnail image (can only be
used if link is specified)
	 * @param   string  $name              Post name (can only be used if link
is specified).
	 * @param   string  $caption           Post caption (can only be used if
link is specified).
	 * @param   string  $description       Post description (can only be used
if link is specified).
	 * @param   array   $actions           Post actions array of objects
containing name and link.
	 * @param   string  $place             Facebook Page ID of the location
associated with this Post.
	 * @param   string  $tags              Comma-separated list of Facebook
IDs of people tagged in this Post.
	 *                                     For example: 1207059,701732. You
cannot specify this field without also specifying a place.
	 * @param   string  $privacy           Post privacy settings (can only be
specified if the Timeline being posted
	 *                                     on belongs to the User creating the
Post).
	 * @param   string  $objectAttachment  Facebook ID for an existing picture
in the User's photo albums to use as the thumbnail image.
	 *                                     The User must be the owner of the
photo, and the photo cannot be part of a message attachment.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function createPost($user, $message = null, $link = null, $picture
= null, $name = null, $caption = null,
		$description = null, $actions = null, $place = null, $tags = null,
$privacy = null, $objectAttachment = null)
	{
		// Set POST request parameters.
		$data = array();
		$data['message'] = $message;
		$data['link'] = $link;
		$data['name'] = $name;
		$data['caption'] = $caption;
		$data['description'] = $description;
		$data['actions'] = $actions;
		$data['place'] = $place;
		$data['tags'] = $tags;
		$data['privacy'] = $privacy;
		$data['object_attachment'] = $objectAttachment;
		$data['picture'] = $picture;

		return $this->createConnection($user, 'feed', $data);
	}

	/**
	 * Method to delete a post. Note: you can only delete the post if it was
created by the current user. Requires authentication
	 *
	 * @param   string  $post  The Post ID.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function deletePost($post)
	{
		return $this->deleteConnection($post);
	}

	/**
	 * Method to get the user's statuses. Requires authentication
read_stream permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getStatuses($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'statuses', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to post a status message on behalf of the user. Requires
authentication publish_stream permission.
	 *
	 * @param   mixed   $user     Either an integer containing the user ID or
a string containing the username.
	 * @param   string  $message  Status message content.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function createStatus($user, $message)
	{
		// Set POST request parameters.
		$data = array();
		$data['message'] = $message;

		return $this->createConnection($user, 'feed', $data);
	}

	/**
	 * Method to delete a status. Note: you can only delete the post if it was
created by the current user.
	 * Requires authentication publish_stream permission.
	 *
	 * @param   string  $status  The Status ID.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function deleteStatus($status)
	{
		return $this->deleteConnection($status);
	}

	/**
	 * Method to get the videos the user has been tagged in. Requires
authentication and user_videos or friends_videos permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getVideos($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'videos', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to post a video on behalf of the user. Requires authentication
and publish_stream permission.
	 *
	 * @param   mixed   $user         Either an integer containing the user ID
or a string containing the username.
	 * @param   string  $source       Path to video.
	 * @param   string  $title        Video title.
	 * @param   string  $description  Video description.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function createVideo($user, $source, $title = null, $description =
null)
	{
		// Set POST request parameters.
		$data = array();
		$data[basename($source)] = '@' . realpath($source);
		$data['title'] = $title;
		$data['description'] = $description;

		return $this->createConnection($user, 'videos', $data,
array('Content-Type' => 'multipart/form-data'));
	}

	/**
	 * Method to get the posts the user has been tagged in. Requires
authentication and user_videos or friends_videos permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getTagged($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'tagged', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to get the activities listed on the user's profile.
Requires authentication and user_activities or friends_activities
permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getActivities($user, $limit = 0, $offset = 0, $until =
null, $since = null)
	{
		return $this->getConnection($user, 'activities',
'', $limit, $offset, $until, $since);
	}

	/**
	 * Method to get the books listed on the user's profile. Requires
authentication and user_likes or friends_likes permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getBooks($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'books', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to get the interests listed on the user's profile. Requires
authentication.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getInterests($user, $limit = 0, $offset = 0, $until =
null, $since = null)
	{
		return $this->getConnection($user, 'interests',
'', $limit, $offset, $until, $since);
	}

	/**
	 * Method to get the movies listed on the user's profile. Requires
authentication and user_likes or friends_likes permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getMovies($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'movies', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to get the television listed on the user's profile.
Requires authentication and user_likes or friends_likes permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getTelevision($user, $limit = 0, $offset = 0, $until =
null, $since = null)
	{
		return $this->getConnection($user, 'television',
'', $limit, $offset, $until, $since);
	}

	/**
	 * Method to get the music listed on the user's profile. Requires
authentication user_likes or friends_likes permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getMusic($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'music', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to get the user's subscribers. Requires authentication and
user_subscriptions or friends_subscriptions permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getSubscribers($user, $limit = 0, $offset = 0)
	{
		return $this->getConnection($user, 'subscribers',
'', $limit, $offset);
	}

	/**
	 * Method to get the people the user is subscribed to. Requires
authentication and user_subscriptions or friends_subscriptions permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getSubscribedTo($user, $limit = 0, $offset = 0)
	{
		return $this->getConnection($user, 'subscribedto',
'', $limit, $offset);
	}
}
home/lmsyaran/public_html/libraries/fof/form/field/user.php000064400000015557151156323050020105
0ustar00<?php
/**
 * @package    FrameworkOnFramework
 * @subpackage form
 * @copyright   Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba
Ltd. All rights reserved.
 * @license    GNU General Public License version 2 or later; see
LICENSE.txt
 */
// Protect from unauthorized access
defined('FOF_INCLUDED') or die;

JFormHelper::loadFieldClass('user');

/**
 * Form Field class for the FOF framework
 * A user selection box / display field
 *
 * @package  FrameworkOnFramework
 * @since    2.0
 */
class FOFFormFieldUser extends JFormFieldUser implements FOFFormField
{
	protected $static;

	protected $repeatable;

	/** @var   FOFTable  The item being rendered in a repeatable form field */
	public $item;

	/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
	public $rowid;

	/**
	 * Method to get certain otherwise inaccessible properties from the form
field object.
	 *
	 * @param   string  $name  The property name for which to the the value.
	 *
	 * @return  mixed  The property value or null.
	 *
	 * @since   2.0
	 */
	public function __get($name)
	{
		switch ($name)
		{
			case 'static':
				if (empty($this->static))
				{
					$this->static = $this->getStatic();
				}

				return $this->static;
				break;

			case 'repeatable':
				if (empty($this->repeatable))
				{
					$this->repeatable = $this->getRepeatable();
				}

				return $this->repeatable;
				break;

			default:
				return parent::__get($name);
		}
	}

	/**
	 * Get the rendering of this field type for static display, e.g. in a
single
	 * item view (typically a "read" task).
	 *
	 * @since 2.0
	 *
	 * @return  string  The field HTML
	 */
	public function getStatic()
	{
		// Initialise
		$show_username = true;
		$show_email    = false;
		$show_name     = false;
		$show_id       = false;
		$class         = '';

		// Get the field parameters
		if ($this->element['class'])
		{
			$class = ' class="' . (string)
$this->element['class'] . '"';
		}

		if ($this->element['show_username'] == 'false')
		{
			$show_username = false;
		}

		if ($this->element['show_email'] == 'true')
		{
			$show_email = true;
		}

		if ($this->element['show_name'] == 'true')
		{
			$show_name = true;
		}

		if ($this->element['show_id'] == 'true')
		{
			$show_id = true;
		}

		// Get the user record
		$user = JFactory::getUser($this->value);

		// Render the HTML
		$html = '<div id="' . $this->id . '"
' . $class . '>';

		if ($show_username)
		{
			$html .= '<span
class="fof-userfield-username">' . $user->username .
'</span>';
		}

		if ($show_id)
		{
			$html .= '<span class="fof-userfield-id">' .
$user->id . '</span>';
		}

		if ($show_name)
		{
			$html .= '<span class="fof-userfield-name">' .
$user->name . '</span>';
		}

		if ($show_email)
		{
			$html .= '<span class="fof-userfield-email">'
. $user->email . '</span>';
		}

		$html .= '</div>';

		return $html;
	}

	/**
	 * Get the rendering of this field type for a repeatable (grid) display,
	 * e.g. in a view listing many item (typically a "browse" task)
	 *
	 * @since 2.0
	 *
	 * @return  string  The field HTML
	 */
	public function getRepeatable()
	{
		// Initialise
		$show_username = true;
		$show_email    = true;
		$show_name     = true;
		$show_id       = true;
		$show_avatar   = true;
		$show_link     = false;
		$link_url      = null;
		$avatar_method = 'gravatar';
		$avatar_size   = 64;
		$class         = '';

		// Get the user record
		$user = JFactory::getUser($this->value);

		// Get the field parameters
		if ($this->element['class'])
		{
			$class = ' class="' . (string)
$this->element['class'] . '"';
		}

		if ($this->element['show_username'] == 'false')
		{
			$show_username = false;
		}

		if ($this->element['show_email'] == 'false')
		{
			$show_email = false;
		}

		if ($this->element['show_name'] == 'false')
		{
			$show_name = false;
		}

		if ($this->element['show_id'] == 'false')
		{
			$show_id = false;
		}

		if ($this->element['show_avatar'] == 'false')
		{
			$show_avatar = false;
		}

		if ($this->element['avatar_method'])
		{
			$avatar_method =
strtolower($this->element['avatar_method']);
		}

		if ($this->element['avatar_size'])
		{
			$avatar_size = $this->element['avatar_size'];
		}

		if ($this->element['show_link'] == 'true')
		{
			$show_link = true;
		}

		if ($this->element['link_url'])
		{
			$link_url = $this->element['link_url'];
		}
		else
		{
			if (FOFPlatform::getInstance()->isBackend())
			{
				// If no link is defined in the back-end, assume the user edit
				// link in the User Manager component
				$link_url =
'index.php?option=com_users&task=user.edit&id=[USER:ID]';
			}
			else
			{
				// If no link is defined in the front-end, we can't create a
				// default link. Therefore, show no link.
				$show_link = false;
			}
		}

		// Post-process the link URL
		if ($show_link)
		{
			$replacements = array(
				'[USER:ID]'			 => $user->id,
				'[USER:USERNAME]'	 => $user->username,
				'[USER:EMAIL]'		 => $user->email,
				'[USER:NAME]'		 => $user->name,
			);

			foreach ($replacements as $key => $value)
			{
				$link_url = str_replace($key, $value, $link_url);
			}
		}

		// Get the avatar image, if necessary
		if ($show_avatar)
		{
			$avatar_url = '';

			if ($avatar_method == 'plugin')
			{
				// Use the user plugins to get an avatar
				FOFPlatform::getInstance()->importPlugin('user');
				$jResponse =
FOFPlatform::getInstance()->runPlugins('onUserAvatar',
array($user, $avatar_size));

				if (!empty($jResponse))
				{
					foreach ($jResponse as $response)
					{
						if ($response)
						{
							$avatar_url = $response;
						}
					}
				}

				if (empty($avatar_url))
				{
					$show_avatar = false;
				}
			}
			else
			{
				// Fall back to the Gravatar method
				$md5 = md5($user->email);

				if (FOFPlatform::getInstance()->isCli())
				{
					$scheme = 'http';
				}
				else
				{
					$scheme = JURI::getInstance()->getScheme();
				}

				if ($scheme == 'http')
				{
					$avatar_url = 'http://www.gravatar.com/avatar/' . $md5 .
'.jpg?s='
						. $avatar_size . '&d=mm';
				}
				else
				{
					$avatar_url = 'https://secure.gravatar.com/avatar/' . $md5 .
'.jpg?s='
						. $avatar_size . '&d=mm';
				}
			}
		}

		// Generate the HTML
		$html = '<div id="' . $this->id . '"
' . $class . '>';

		if ($show_avatar)
		{
			$html .= '<img src="' . $avatar_url . '"
align="left" class="fof-usersfield-avatar" />';
		}

		if ($show_link)
		{
			$html .= '<a href="' . $link_url .
'">';
		}

		if ($show_username)
		{
			$html .= '<span
class="fof-usersfield-username">' . $user->username
				. '</span>';
		}

		if ($show_id)
		{
			$html .= '<span class="fof-usersfield-id">' .
$user->id
				. '</span>';
		}

		if ($show_name)
		{
			$html .= '<span class="fof-usersfield-name">'
. $user->name
				. '</span>';
		}

		if ($show_email)
		{
			$html .= '<span class="fof-usersfield-email">'
. $user->email
				. '</span>';
		}

		if ($show_link)
		{
			$html .= '</a>';
		}

		$html .= '</div>';

		return $html;
	}
}
home/lmsyaran/public_html/j3/libraries/joomla/openstreetmap/user.php000064400000006324151156703760021772
0ustar00<?php
/**
 * @package     Joomla.Platform
 * @subpackage  Openstreetmap
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */

defined('JPATH_PLATFORM') or die();

/**
 * Openstreetmap API User class for the Joomla Platform
 *
 * @since       3.2.0
 * @deprecated  4.0  Use the `joomla/openstreetmap` package via Composer
instead
 */
class JOpenstreetmapUser extends JOpenstreetmapObject
{
	/**
	 * Method to get user details
	 *
	 * @return  array  The XML response
	 *
	 * @since   3.2.0
	 */
	public function getDetails()
	{
		$token = $this->oauth->getToken();

		// Set parameters.
		$parameters = array(
			'oauth_token' => $token['key'],
		);

		// Set the API base
		$base = 'user/details';

		// Build the request path.
		$path = $this->getOption('api.url') . $base;

		// Send the request.
		$response = $this->oauth->oauthRequest($path, 'GET',
$parameters);

		return $response->body;
	}

	/**
	 * Method to get preferences
	 *
	 * @return  array  The XML response
	 *
	 * @since   3.2.0
	 */
	public function getPreferences()
	{
		$token = $this->oauth->getToken();

		// Set parameters.
		$parameters = array(
			'oauth_token' => $token['key'],
		);

		// Set the API base
		$base = 'user/preferences';

		// Build the request path.
		$path = $this->getOption('api.url') . $base;

		// Send the request.
		$response = $this->oauth->oauthRequest($path, 'GET',
$parameters);

		return $response->body;
	}

	/**
	 * Method to replace user preferences
	 *
	 * @param   array  $preferences  Array of new preferences
	 *
	 * @return  array  The XML response
	 *
	 * @since   3.2.0
	 */
	public function replacePreferences($preferences)
	{
		$token = $this->oauth->getToken();

		// Set parameters.
		$parameters = array(
			'oauth_token' => $token['key'],
		);

		// Set the API base
		$base = 'user/preferences';

		// Build the request path.
		$path = $this->getOption('api.url') . $base;

		// Create a list of preferences
		$preference_list = '';

		if (!empty($preferences))
		{
			foreach ($preferences as $key => $value)
			{
				$preference_list .= '<preference k="' . $key .
'" v="' . $value . '"/>';
			}
		}

		$xml = '<?xml version="1.0"
encoding="UTF-8"?>
			<osm version="0.6" generator="JOpenstreetmap">
				<preferences>'
				. $preference_list .
				'</preferences>
			</osm>';

		$header['Content-Type'] = 'text/xml';

		// Send the request.
		$response = $this->oauth->oauthRequest($path, 'PUT',
$parameters, $xml, $header);

		return $response->body;
	}

	/**
	 * Method to change user preferences
	 *
	 * @param   string  $key         Key of the preference
	 * @param   string  $preference  New value for preference
	 *
	 * @return  array  The XML response
	 *
	 * @since   3.2.0
	 */
	public function changePreference($key, $preference)
	{
		$token = $this->oauth->getToken();

		// Set parameters.
		$parameters = array(
			'oauth_token' => $token['key'],
		);

		// Set the API base
		$base = 'user/preferences/' . $key;

		// Build the request path.
		$path = $this->getOption('api.url') . $base;

		// Send the request.
		$response = $this->oauth->oauthRequest($path, 'PUT',
$parameters, $preference);

		return $response->body;
	}
}
home/lmsyaran/public_html/j3/libraries/joomla/facebook/user.php000064400000116405151157212240020644
0ustar00<?php
/**
 * @package     Joomla.Platform
 * @subpackage  Facebook
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */

defined('JPATH_PLATFORM') or die();

/**
 * Facebook API User class for the Joomla Platform.
 *
 * @link        http://developers.facebook.com/docs/reference/api/user/
 * @since       3.2.0
 * @deprecated  4.0  Use the `joomla/facebook` package via Composer instead
 */
class JFacebookUser extends JFacebookObject
{
	/**
	 * Method to get the specified user's details. Authentication is
required only for some fields.
	 *
	 * @param   mixed  $user  Either an integer containing the user ID or a
string containing the username.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getUser($user)
	{
		return $this->get($user);
	}

	/**
	 * Method to get the specified user's friends. Requires
authentication.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getFriends($user, $limit = 0, $offset = 0)
	{
		return $this->getConnection($user, 'friends', '',
$limit, $offset);
	}

	/**
	 * Method to get the user's incoming friend requests. Requires
authentication and read_requests permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getFriendRequests($user, $limit = 0, $offset = 0, $until =
null, $since = null)
	{
		return $this->getConnection($user, 'friendrequests',
'', $limit, $offset, $until, $since);
	}

	/**
	 * Method to get the user's friend lists. Requires authentication and
read_friendlists permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getFriendLists($user, $limit = 0, $offset = 0, $until =
null, $since = null)
	{
		return $this->getConnection($user, 'friendlists',
'', $limit, $offset, $until, $since);
	}

	/**
	 * Method to get the user's wall. Requires authentication and
read_stream permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getFeed($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'feed', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to get the user's news feed. Requires authentication and
read_stream permission.
	 *
	 * @param   mixed    $user      Either an integer containing the user ID
or a string containing the username.
	 * @param   string   $filter    User's stream filter.
	 * @param   boolean  $location  Retrieve only posts with a location
attached.
	 * @param   integer  $limit     The number of objects per page.
	 * @param   integer  $offset    The object's number on the page.
	 * @param   string   $until     A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since     A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getHome($user, $filter = null, $location = false, $limit =
0, $offset = 0, $until = null, $since = null)
	{
		$extra_fields = '';

		if ($filter != null)
		{
			$extra_fields = '?filter=' . $filter;
		}

		if ($location == true)
		{
			$extra_fields .= (strpos($extra_fields, '?') === false) ?
'?with=location' : '&with=location';
		}

		return $this->getConnection($user, 'home', $extra_fields,
$limit, $offset, $until, $since);
	}

	/**
	 * Method to see if a user is a friend of the current user. Requires
authentication.
	 *
	 * @param   mixed  $currentUser  Either an integer containing the user ID
or a string containing the username for the current user.
	 * @param   mixed  $user         Either an integer containing the user ID
or a string containing the username for the user.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function hasFriend($currentUser, $user)
	{
		return $this->getConnection($currentUser, 'friends/' .
$user);
	}

	/**
	 * Method to get mutual friends of one user and the current user. Requires
authentication.
	 *
	 * @param   mixed    $currentUser  Either an integer containing the user
ID or a string containing the username for the current user.
	 * @param   mixed    $user         Either an integer containing the user
ID or a string containing the username for the user.
	 * @param   integer  $limit        The number of objects per page.
	 * @param   integer  $offset       The object's number on the page.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getMutualFriends($currentUser, $user, $limit = 0, $offset
= 0)
	{
		return $this->getConnection($currentUser, 'mutualfriends/' .
$user, '', $limit, $offset);
	}

	/**
	 * Method to get the user's profile picture. Requires authentication.
	 *
	 * @param   mixed    $user      Either an integer containing the user ID
or a string containing the username.
	 * @param   boolean  $redirect  If false this will return the URL of the
profile picture without a 302 redirect.
	 * @param   string   $type      To request a different photo use square |
small | normal | large.
	 *
	 * @return  string   The URL to the user's profile picture.
	 *
	 * @since   3.2.0
	 */
	public function getPicture($user, $redirect = true, $type = null)
	{
		$extra_fields = '';

		if ($redirect == false)
		{
			$extra_fields = '?redirect=false';
		}

		if ($type != null)
		{
			$extra_fields .= (strpos($extra_fields, '?') === false) ?
'?type=' . $type : '&type=' . $type;
		}

		return $this->getConnection($user, 'picture',
$extra_fields);
	}

	/**
	 * Method to get the user's family relationships. Requires
authentication and user_relationships permission..
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getFamily($user, $limit = 0, $offset = 0)
	{
		return $this->getConnection($user, 'family', '',
$limit, $offset);
	}

	/**
	 * Method to get the user's notifications. Requires authentication
and manage_notifications permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   boolean  $read    Enables you to see notifications that the
user has already read.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getNotifications($user, $read = null, $limit = 0, $offset
= 0, $until = null, $since = null)
	{
		if ($read == true)
		{
			$read = '?include_read=1';
		}

		// Send the request.
		return $this->getConnection($user, 'notifications', $read,
$limit, $offset, $until, $since);
	}

	/**
	 * Method to mark a notification as read. Requires authentication and
manage_notifications permission.
	 *
	 * @param   string  $notification  The notification id.
	 *
	 * @return  boolean   Returns true if successful, and false otherwise.
	 *
	 * @since   3.2.0
	 */
	public function updateNotification($notification)
	{
		$data['unread'] = 0;

		return $this->createConnection($notification, null, $data);
	}

	/**
	 * Method to get the user's permissions. Requires authentication.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getPermissions($user, $limit = 0, $offset = 0)
	{
		return $this->getConnection($user, 'permissions',
'', $limit, $offset);
	}

	/**
	 * Method to revoke a specific permission on behalf of a user. Requires
authentication.
	 *
	 * @param   mixed   $user        Either an integer containing the user ID
or a string containing the username.
	 * @param   string  $permission  The permission to revoke. If none
specified, then this will de-authorize the application completely.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function deletePermission($user, $permission = '')
	{
		return $this->deleteConnection($user, 'permissions',
'?permission=' . $permission);
	}

	/**
	 * Method to get the user's albums. Requires authentication and
user_photos or friends_photos permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getAlbums($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'albums', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to create an album for a user.  Requires authentication and
publish_stream permission.
	 *
	 * @param   mixed   $user         Either an integer containing the user ID
or a string containing the username.
	 * @param   string  $name         Album name.
	 * @param   string  $description  Album description.
	 * @param   string  $privacy      A JSON-encoded object that defines the
privacy setting for the album.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function createAlbum($user, $name, $description = null, $privacy =
null)
	{
		// Set POST request parameters.
		$data = array();
		$data['name'] = $name;
		$data['description'] = $description;
		$data['privacy'] = $privacy;

		return $this->createConnection($user, 'albums', $data);
	}

	/**
	 * Method to get the user's checkins. Requires authentication and
user_checkins or friends_checkins permission
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getCheckins($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'checkins', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to create a checkin for a user. Requires authentication and
publish_checkins permission.
	 *
	 * @param   mixed   $user         Either an integer containing the user ID
or a string containing the username.
	 * @param   string  $place        Id of the Place Page.
	 * @param   string  $coordinates  A JSON-encoded string containing
latitute and longitude.
	 * @param   string  $tags         Comma separated list of USER_IDs.
	 * @param   string  $message      A message to add to the checkin.
	 * @param   string  $link         A link to add to the checkin.
	 * @param   string  $picture      A picture to add to the checkin.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function createCheckin($user, $place, $coordinates, $tags = null,
$message = null, $link = null, $picture = null)
	{
		// Set POST request parameters.
		$data = array();
		$data['place'] = $place;
		$data['coordinates'] = $coordinates;
		$data['tags'] = $tags;
		$data['message'] = $message;
		$data['link'] = $link;
		$data['picture'] = $picture;

		return $this->createConnection($user, 'checkins', $data);
	}

	/**
	 * Method to get the user's likes. Requires authentication and
user_likes or friends_likes permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getLikes($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'likes', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to see if a user likes a specific Page. Requires authentication.
	 *
	 * @param   mixed   $user  Either an integer containing the user ID or a
string containing the username.
	 * @param   string  $page  Facebook ID of the Page.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function likesPage($user, $page)
	{
		return $this->getConnection($user, 'likes/' . $page);
	}

	/**
	 * Method to get the current user's events. Requires authentication
and user_events or friends_events permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getEvents($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'events', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to create an event for a user. Requires authentication
create_event permission.
	 *
	 * @param   mixed   $user         Either an integer containing the user ID
or a string containing the username.
	 * @param   string  $name         Event name.
	 * @param   string  $startTime    Event start time as UNIX timestamp.
	 * @param   string  $endTime      Event end time as UNIX timestamp.
	 * @param   string  $description  Event description.
	 * @param   string  $location     Event location.
	 * @param   string  $locationId   Facebook Place ID of the place the Event
is taking place.
	 * @param   string  $privacyType  Event privacy setting, a string
containing 'OPEN' (default), 'CLOSED', or
'SECRET'.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function createEvent($user, $name, $startTime, $endTime = null,
$description = null,
		$location = null, $locationId = null, $privacyType = null)
	{
		// Set POST request parameters.
		$data = array();
		$data['start_time'] = $startTime;
		$data['name'] = $name;
		$data['end_time'] = $endTime;
		$data['description'] = $description;
		$data['location'] = $location;
		$data['location_id'] = $locationId;
		$data['privacy_type'] = $privacyType;

		return $this->createConnection($user, 'events', $data);
	}

	/**
	 * Method to edit an event. Requires authentication create_event
permission.
	 *
	 * @param   mixed   $event        Event ID.
	 * @param   string  $name         Event name.
	 * @param   string  $startTime    Event start time as UNIX timestamp.
	 * @param   string  $endTime      Event end time as UNIX timestamp.
	 * @param   string  $description  Event description.
	 * @param   string  $location     Event location.
	 * @param   string  $locationId   Facebook Place ID of the place the Event
is taking place.
	 * @param   string  $privacyType  Event privacy setting, a string
containing 'OPEN' (default), 'CLOSED', or
'SECRET'.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function editEvent($event, $name = null, $startTime = null,
$endTime = null, $description = null,
		$location = null, $locationId = null, $privacyType = null)
	{
		// Set POST request parameters.
		$data = array();
		$data['start_time'] = $startTime;
		$data['name'] = $name;
		$data['end_time'] = $endTime;
		$data['description'] = $description;
		$data['location'] = $location;
		$data['location_id'] = $locationId;
		$data['privacy_type'] = $privacyType;

		return $this->createConnection($event, null, $data);
	}

	/**
	 * Method to delete an event. Note: you can only delete the event if it
was created by the same app. Requires authentication create_event
permission.
	 *
	 * @param   string  $event  Event ID.
	 *
	 * @return  boolean   Returns true if successful, and false otherwise.
	 *
	 * @since   3.2.0
	 */
	public function deleteEvent($event)
	{
		return $this->deleteConnection($event);
	}

	/**
	 * Method to get the groups that the user belongs to. Requires
authentication and user_groups or friends_groups permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getGroups($user, $limit = 0, $offset = 0)
	{
		return $this->getConnection($user, 'groups', '',
$limit, $offset);
	}

	/**
	 * Method to get the user's posted links. Requires authentication and
user_groups or friends_groups permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getLinks($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'links', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to post a link on user's feed. Requires authentication and
publish_stream permission.
	 *
	 * @param   mixed   $user     Either an integer containing the user ID or
a string containing the username.
	 * @param   string  $link     Link URL.
	 * @param   string  $message  Link message.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function createLink($user, $link, $message = null)
	{
		// Set POST request parameters.
		$data = array();
		$data['link'] = $link;
		$data['message'] = $message;

		return $this->createConnection($user, 'feed', $data);
	}

	/**
	 * Method to delete a link. Requires authentication and publish_stream
permission.
	 *
	 * @param   mixed  $link  The Link ID.
	 *
	 * @return  boolean   Returns true if successful, and false otherwise.
	 *
	 * @since   3.2.0
	 */
	public function deleteLink($link)
	{
		return $this->deleteConnection($link);
	}

	/**
	 * Method to get the user's notes. Requires authentication and
user_groups or friends_groups permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getNotes($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'notes', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to create a note on the behalf of the user.
	 * Requires authentication and publish_stream permission, user_groups or
friends_groups permission.
	 *
	 * @param   mixed   $user     Either an integer containing the user ID or
a string containing the username.
	 * @param   string  $subject  The subject of the note.
	 * @param   string  $message  Note content.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function createNote($user, $subject, $message)
	{
		// Set POST request parameters.
		$data = array();
		$data['subject'] = $subject;
		$data['message'] = $message;

		return $this->createConnection($user, 'notes', $data);
	}

	/**
	 * Method to get the user's photos. Requires authentication and
user_groups or friends_groups permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getPhotos($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'photos', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to post a photo on user's wall. Requires authentication and
publish_stream permission, user_groups or friends_groups permission.
	 *
	 * @param   mixed    $user     Either an integer containing the user ID or
a string containing the username.
	 * @param   string   $source   Path to photo.
	 * @param   string   $message  Photo description.
	 * @param   string   $place    Facebook ID of the place associated with
the photo.
	 * @param   boolean  $noStory  If set to 1, optionally suppresses the feed
story that is automatically
	 *                             generated on a user’s profile when they
upload a photo using your application.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function createPhoto($user, $source, $message = null, $place =
null, $noStory = null)
	{
		// Set POST request parameters.
		$data = array();
		$data[basename($source)] = '@' . realpath($source);
		$data['message'] = $message;
		$data['place'] = $place;
		$data['no_story'] = $noStory;

		return $this->createConnection($user, 'photos', $data,
array('Content-Type' => 'multipart/form-data'));
	}

	/**
	 * Method to get the user's posts. Requires authentication and
read_stream permission for non-public posts.
	 *
	 * @param   mixed    $user      Either an integer containing the user ID
or a string containing the username.
	 * @param   boolean  $location  Retrieve only posts with a location
attached.
	 * @param   integer  $limit     The number of objects per page.
	 * @param   integer  $offset    The object's number on the page.
	 * @param   string   $until     A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since     A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getPosts($user, $location = false, $limit = 0, $offset =
0, $until = null, $since = null)
	{
		if ($location == true)
		{
			$location = '?with=location';
		}

		// Send the request.
		return $this->getConnection($user, 'posts', $location,
$limit, $offset, $until, $since);
	}

	/**
	 * Method to post on a user's wall. Message or link parameter is
required. Requires authentication and publish_stream permission.
	 *
	 * @param   mixed   $user              Either an integer containing the
user ID or a string containing the username.
	 * @param   string  $message           Post message.
	 * @param   string  $link              Post URL.
	 * @param   string  $picture           Post thumbnail image (can only be
used if link is specified)
	 * @param   string  $name              Post name (can only be used if link
is specified).
	 * @param   string  $caption           Post caption (can only be used if
link is specified).
	 * @param   string  $description       Post description (can only be used
if link is specified).
	 * @param   array   $actions           Post actions array of objects
containing name and link.
	 * @param   string  $place             Facebook Page ID of the location
associated with this Post.
	 * @param   string  $tags              Comma-separated list of Facebook
IDs of people tagged in this Post.
	 *                                     For example: 1207059,701732. You
cannot specify this field without also specifying a place.
	 * @param   string  $privacy           Post privacy settings (can only be
specified if the Timeline being posted
	 *                                     on belongs to the User creating the
Post).
	 * @param   string  $objectAttachment  Facebook ID for an existing picture
in the User's photo albums to use as the thumbnail image.
	 *                                     The User must be the owner of the
photo, and the photo cannot be part of a message attachment.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function createPost($user, $message = null, $link = null, $picture
= null, $name = null, $caption = null,
		$description = null, $actions = null, $place = null, $tags = null,
$privacy = null, $objectAttachment = null)
	{
		// Set POST request parameters.
		$data = array();
		$data['message'] = $message;
		$data['link'] = $link;
		$data['name'] = $name;
		$data['caption'] = $caption;
		$data['description'] = $description;
		$data['actions'] = $actions;
		$data['place'] = $place;
		$data['tags'] = $tags;
		$data['privacy'] = $privacy;
		$data['object_attachment'] = $objectAttachment;
		$data['picture'] = $picture;

		return $this->createConnection($user, 'feed', $data);
	}

	/**
	 * Method to delete a post. Note: you can only delete the post if it was
created by the current user. Requires authentication
	 *
	 * @param   string  $post  The Post ID.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function deletePost($post)
	{
		return $this->deleteConnection($post);
	}

	/**
	 * Method to get the user's statuses. Requires authentication
read_stream permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getStatuses($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'statuses', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to post a status message on behalf of the user. Requires
authentication publish_stream permission.
	 *
	 * @param   mixed   $user     Either an integer containing the user ID or
a string containing the username.
	 * @param   string  $message  Status message content.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function createStatus($user, $message)
	{
		// Set POST request parameters.
		$data = array();
		$data['message'] = $message;

		return $this->createConnection($user, 'feed', $data);
	}

	/**
	 * Method to delete a status. Note: you can only delete the post if it was
created by the current user.
	 * Requires authentication publish_stream permission.
	 *
	 * @param   string  $status  The Status ID.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function deleteStatus($status)
	{
		return $this->deleteConnection($status);
	}

	/**
	 * Method to get the videos the user has been tagged in. Requires
authentication and user_videos or friends_videos permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getVideos($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'videos', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to post a video on behalf of the user. Requires authentication
and publish_stream permission.
	 *
	 * @param   mixed   $user         Either an integer containing the user ID
or a string containing the username.
	 * @param   string  $source       Path to video.
	 * @param   string  $title        Video title.
	 * @param   string  $description  Video description.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function createVideo($user, $source, $title = null, $description =
null)
	{
		// Set POST request parameters.
		$data = array();
		$data[basename($source)] = '@' . realpath($source);
		$data['title'] = $title;
		$data['description'] = $description;

		return $this->createConnection($user, 'videos', $data,
array('Content-Type' => 'multipart/form-data'));
	}

	/**
	 * Method to get the posts the user has been tagged in. Requires
authentication and user_videos or friends_videos permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getTagged($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'tagged', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to get the activities listed on the user's profile.
Requires authentication and user_activities or friends_activities
permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getActivities($user, $limit = 0, $offset = 0, $until =
null, $since = null)
	{
		return $this->getConnection($user, 'activities',
'', $limit, $offset, $until, $since);
	}

	/**
	 * Method to get the books listed on the user's profile. Requires
authentication and user_likes or friends_likes permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getBooks($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'books', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to get the interests listed on the user's profile. Requires
authentication.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getInterests($user, $limit = 0, $offset = 0, $until =
null, $since = null)
	{
		return $this->getConnection($user, 'interests',
'', $limit, $offset, $until, $since);
	}

	/**
	 * Method to get the movies listed on the user's profile. Requires
authentication and user_likes or friends_likes permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getMovies($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'movies', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to get the television listed on the user's profile.
Requires authentication and user_likes or friends_likes permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getTelevision($user, $limit = 0, $offset = 0, $until =
null, $since = null)
	{
		return $this->getConnection($user, 'television',
'', $limit, $offset, $until, $since);
	}

	/**
	 * Method to get the music listed on the user's profile. Requires
authentication user_likes or friends_likes permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getMusic($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'music', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to get the user's subscribers. Requires authentication and
user_subscriptions or friends_subscriptions permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getSubscribers($user, $limit = 0, $offset = 0)
	{
		return $this->getConnection($user, 'subscribers',
'', $limit, $offset);
	}

	/**
	 * Method to get the people the user is subscribed to. Requires
authentication and user_subscriptions or friends_subscriptions permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getSubscribedTo($user, $limit = 0, $offset = 0)
	{
		return $this->getConnection($user, 'subscribedto',
'', $limit, $offset);
	}
}
home/lmsyaran/public_html/j3/libraries/cms/html/user.php000064400000003221151157450010017326
0ustar00<?php
/**
 * @package     Joomla.Libraries
 * @subpackage  HTML
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('JPATH_PLATFORM') or die;

/**
 * Utility class working with users
 *
 * @since  2.5
 */
abstract class JHtmlUser
{
	/**
	 * Displays a list of user groups.
	 *
	 * @param   boolean  $includeSuperAdmin  true to include super admin
groups, false to exclude them
	 *
	 * @return  array  An array containing a list of user groups.
	 *
	 * @since   2.5
	 */
	public static function groups($includeSuperAdmin = false)
	{
		$options = array_values(JHelperUsergroups::getInstance()->getAll());

		for ($i = 0, $n = count($options); $i < $n; $i++)
		{
			$options[$i]->value = $options[$i]->id;
			$options[$i]->text = str_repeat('- ',
$options[$i]->level) . $options[$i]->title;
			$groups[] = JHtml::_('select.option', $options[$i]->value,
$options[$i]->text);
		}

		// Exclude super admin groups if requested
		if (!$includeSuperAdmin)
		{
			$filteredGroups = array();

			foreach ($groups as $group)
			{
				if (!JAccess::checkGroup($group->value, 'core.admin'))
				{
					$filteredGroups[] = $group;
				}
			}

			$groups = $filteredGroups;
		}

		return $groups;
	}

	/**
	 * Get a list of users.
	 *
	 * @return  string
	 *
	 * @since   2.5
	 */
	public static function userlist()
	{
		$db    = JFactory::getDbo();
		$query = $db->getQuery(true)
			->select('a.id AS value, a.name AS text')
			->from('#__users AS a')
			->where('a.block = 0')
			->order('a.name');
		$db->setQuery($query);

		return $db->loadObjectList();
	}
}
home/lmsyaran/public_html/j3/htaccess.back/cms/html/user.php000064400000003221151160066620020052
0ustar00<?php
/**
 * @package     Joomla.Libraries
 * @subpackage  HTML
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('JPATH_PLATFORM') or die;

/**
 * Utility class working with users
 *
 * @since  2.5
 */
abstract class JHtmlUser
{
	/**
	 * Displays a list of user groups.
	 *
	 * @param   boolean  $includeSuperAdmin  true to include super admin
groups, false to exclude them
	 *
	 * @return  array  An array containing a list of user groups.
	 *
	 * @since   2.5
	 */
	public static function groups($includeSuperAdmin = false)
	{
		$options = array_values(JHelperUsergroups::getInstance()->getAll());

		for ($i = 0, $n = count($options); $i < $n; $i++)
		{
			$options[$i]->value = $options[$i]->id;
			$options[$i]->text = str_repeat('- ',
$options[$i]->level) . $options[$i]->title;
			$groups[] = JHtml::_('select.option', $options[$i]->value,
$options[$i]->text);
		}

		// Exclude super admin groups if requested
		if (!$includeSuperAdmin)
		{
			$filteredGroups = array();

			foreach ($groups as $group)
			{
				if (!JAccess::checkGroup($group->value, 'core.admin'))
				{
					$filteredGroups[] = $group;
				}
			}

			$groups = $filteredGroups;
		}

		return $groups;
	}

	/**
	 * Get a list of users.
	 *
	 * @return  string
	 *
	 * @since   2.5
	 */
	public static function userlist()
	{
		$db    = JFactory::getDbo();
		$query = $db->getQuery(true)
			->select('a.id AS value, a.name AS text')
			->from('#__users AS a')
			->where('a.block = 0')
			->order('a.name');
		$db->setQuery($query);

		return $db->loadObjectList();
	}
}
home/lmsyaran/public_html/j3/htaccess.back/joomla/facebook/user.php000064400000116405151161043300021356
0ustar00<?php
/**
 * @package     Joomla.Platform
 * @subpackage  Facebook
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */

defined('JPATH_PLATFORM') or die();

/**
 * Facebook API User class for the Joomla Platform.
 *
 * @link        http://developers.facebook.com/docs/reference/api/user/
 * @since       3.2.0
 * @deprecated  4.0  Use the `joomla/facebook` package via Composer instead
 */
class JFacebookUser extends JFacebookObject
{
	/**
	 * Method to get the specified user's details. Authentication is
required only for some fields.
	 *
	 * @param   mixed  $user  Either an integer containing the user ID or a
string containing the username.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getUser($user)
	{
		return $this->get($user);
	}

	/**
	 * Method to get the specified user's friends. Requires
authentication.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getFriends($user, $limit = 0, $offset = 0)
	{
		return $this->getConnection($user, 'friends', '',
$limit, $offset);
	}

	/**
	 * Method to get the user's incoming friend requests. Requires
authentication and read_requests permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getFriendRequests($user, $limit = 0, $offset = 0, $until =
null, $since = null)
	{
		return $this->getConnection($user, 'friendrequests',
'', $limit, $offset, $until, $since);
	}

	/**
	 * Method to get the user's friend lists. Requires authentication and
read_friendlists permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getFriendLists($user, $limit = 0, $offset = 0, $until =
null, $since = null)
	{
		return $this->getConnection($user, 'friendlists',
'', $limit, $offset, $until, $since);
	}

	/**
	 * Method to get the user's wall. Requires authentication and
read_stream permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getFeed($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'feed', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to get the user's news feed. Requires authentication and
read_stream permission.
	 *
	 * @param   mixed    $user      Either an integer containing the user ID
or a string containing the username.
	 * @param   string   $filter    User's stream filter.
	 * @param   boolean  $location  Retrieve only posts with a location
attached.
	 * @param   integer  $limit     The number of objects per page.
	 * @param   integer  $offset    The object's number on the page.
	 * @param   string   $until     A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since     A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getHome($user, $filter = null, $location = false, $limit =
0, $offset = 0, $until = null, $since = null)
	{
		$extra_fields = '';

		if ($filter != null)
		{
			$extra_fields = '?filter=' . $filter;
		}

		if ($location == true)
		{
			$extra_fields .= (strpos($extra_fields, '?') === false) ?
'?with=location' : '&with=location';
		}

		return $this->getConnection($user, 'home', $extra_fields,
$limit, $offset, $until, $since);
	}

	/**
	 * Method to see if a user is a friend of the current user. Requires
authentication.
	 *
	 * @param   mixed  $currentUser  Either an integer containing the user ID
or a string containing the username for the current user.
	 * @param   mixed  $user         Either an integer containing the user ID
or a string containing the username for the user.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function hasFriend($currentUser, $user)
	{
		return $this->getConnection($currentUser, 'friends/' .
$user);
	}

	/**
	 * Method to get mutual friends of one user and the current user. Requires
authentication.
	 *
	 * @param   mixed    $currentUser  Either an integer containing the user
ID or a string containing the username for the current user.
	 * @param   mixed    $user         Either an integer containing the user
ID or a string containing the username for the user.
	 * @param   integer  $limit        The number of objects per page.
	 * @param   integer  $offset       The object's number on the page.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getMutualFriends($currentUser, $user, $limit = 0, $offset
= 0)
	{
		return $this->getConnection($currentUser, 'mutualfriends/' .
$user, '', $limit, $offset);
	}

	/**
	 * Method to get the user's profile picture. Requires authentication.
	 *
	 * @param   mixed    $user      Either an integer containing the user ID
or a string containing the username.
	 * @param   boolean  $redirect  If false this will return the URL of the
profile picture without a 302 redirect.
	 * @param   string   $type      To request a different photo use square |
small | normal | large.
	 *
	 * @return  string   The URL to the user's profile picture.
	 *
	 * @since   3.2.0
	 */
	public function getPicture($user, $redirect = true, $type = null)
	{
		$extra_fields = '';

		if ($redirect == false)
		{
			$extra_fields = '?redirect=false';
		}

		if ($type != null)
		{
			$extra_fields .= (strpos($extra_fields, '?') === false) ?
'?type=' . $type : '&type=' . $type;
		}

		return $this->getConnection($user, 'picture',
$extra_fields);
	}

	/**
	 * Method to get the user's family relationships. Requires
authentication and user_relationships permission..
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getFamily($user, $limit = 0, $offset = 0)
	{
		return $this->getConnection($user, 'family', '',
$limit, $offset);
	}

	/**
	 * Method to get the user's notifications. Requires authentication
and manage_notifications permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   boolean  $read    Enables you to see notifications that the
user has already read.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getNotifications($user, $read = null, $limit = 0, $offset
= 0, $until = null, $since = null)
	{
		if ($read == true)
		{
			$read = '?include_read=1';
		}

		// Send the request.
		return $this->getConnection($user, 'notifications', $read,
$limit, $offset, $until, $since);
	}

	/**
	 * Method to mark a notification as read. Requires authentication and
manage_notifications permission.
	 *
	 * @param   string  $notification  The notification id.
	 *
	 * @return  boolean   Returns true if successful, and false otherwise.
	 *
	 * @since   3.2.0
	 */
	public function updateNotification($notification)
	{
		$data['unread'] = 0;

		return $this->createConnection($notification, null, $data);
	}

	/**
	 * Method to get the user's permissions. Requires authentication.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getPermissions($user, $limit = 0, $offset = 0)
	{
		return $this->getConnection($user, 'permissions',
'', $limit, $offset);
	}

	/**
	 * Method to revoke a specific permission on behalf of a user. Requires
authentication.
	 *
	 * @param   mixed   $user        Either an integer containing the user ID
or a string containing the username.
	 * @param   string  $permission  The permission to revoke. If none
specified, then this will de-authorize the application completely.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function deletePermission($user, $permission = '')
	{
		return $this->deleteConnection($user, 'permissions',
'?permission=' . $permission);
	}

	/**
	 * Method to get the user's albums. Requires authentication and
user_photos or friends_photos permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getAlbums($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'albums', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to create an album for a user.  Requires authentication and
publish_stream permission.
	 *
	 * @param   mixed   $user         Either an integer containing the user ID
or a string containing the username.
	 * @param   string  $name         Album name.
	 * @param   string  $description  Album description.
	 * @param   string  $privacy      A JSON-encoded object that defines the
privacy setting for the album.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function createAlbum($user, $name, $description = null, $privacy =
null)
	{
		// Set POST request parameters.
		$data = array();
		$data['name'] = $name;
		$data['description'] = $description;
		$data['privacy'] = $privacy;

		return $this->createConnection($user, 'albums', $data);
	}

	/**
	 * Method to get the user's checkins. Requires authentication and
user_checkins or friends_checkins permission
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getCheckins($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'checkins', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to create a checkin for a user. Requires authentication and
publish_checkins permission.
	 *
	 * @param   mixed   $user         Either an integer containing the user ID
or a string containing the username.
	 * @param   string  $place        Id of the Place Page.
	 * @param   string  $coordinates  A JSON-encoded string containing
latitute and longitude.
	 * @param   string  $tags         Comma separated list of USER_IDs.
	 * @param   string  $message      A message to add to the checkin.
	 * @param   string  $link         A link to add to the checkin.
	 * @param   string  $picture      A picture to add to the checkin.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function createCheckin($user, $place, $coordinates, $tags = null,
$message = null, $link = null, $picture = null)
	{
		// Set POST request parameters.
		$data = array();
		$data['place'] = $place;
		$data['coordinates'] = $coordinates;
		$data['tags'] = $tags;
		$data['message'] = $message;
		$data['link'] = $link;
		$data['picture'] = $picture;

		return $this->createConnection($user, 'checkins', $data);
	}

	/**
	 * Method to get the user's likes. Requires authentication and
user_likes or friends_likes permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getLikes($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'likes', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to see if a user likes a specific Page. Requires authentication.
	 *
	 * @param   mixed   $user  Either an integer containing the user ID or a
string containing the username.
	 * @param   string  $page  Facebook ID of the Page.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function likesPage($user, $page)
	{
		return $this->getConnection($user, 'likes/' . $page);
	}

	/**
	 * Method to get the current user's events. Requires authentication
and user_events or friends_events permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getEvents($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'events', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to create an event for a user. Requires authentication
create_event permission.
	 *
	 * @param   mixed   $user         Either an integer containing the user ID
or a string containing the username.
	 * @param   string  $name         Event name.
	 * @param   string  $startTime    Event start time as UNIX timestamp.
	 * @param   string  $endTime      Event end time as UNIX timestamp.
	 * @param   string  $description  Event description.
	 * @param   string  $location     Event location.
	 * @param   string  $locationId   Facebook Place ID of the place the Event
is taking place.
	 * @param   string  $privacyType  Event privacy setting, a string
containing 'OPEN' (default), 'CLOSED', or
'SECRET'.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function createEvent($user, $name, $startTime, $endTime = null,
$description = null,
		$location = null, $locationId = null, $privacyType = null)
	{
		// Set POST request parameters.
		$data = array();
		$data['start_time'] = $startTime;
		$data['name'] = $name;
		$data['end_time'] = $endTime;
		$data['description'] = $description;
		$data['location'] = $location;
		$data['location_id'] = $locationId;
		$data['privacy_type'] = $privacyType;

		return $this->createConnection($user, 'events', $data);
	}

	/**
	 * Method to edit an event. Requires authentication create_event
permission.
	 *
	 * @param   mixed   $event        Event ID.
	 * @param   string  $name         Event name.
	 * @param   string  $startTime    Event start time as UNIX timestamp.
	 * @param   string  $endTime      Event end time as UNIX timestamp.
	 * @param   string  $description  Event description.
	 * @param   string  $location     Event location.
	 * @param   string  $locationId   Facebook Place ID of the place the Event
is taking place.
	 * @param   string  $privacyType  Event privacy setting, a string
containing 'OPEN' (default), 'CLOSED', or
'SECRET'.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function editEvent($event, $name = null, $startTime = null,
$endTime = null, $description = null,
		$location = null, $locationId = null, $privacyType = null)
	{
		// Set POST request parameters.
		$data = array();
		$data['start_time'] = $startTime;
		$data['name'] = $name;
		$data['end_time'] = $endTime;
		$data['description'] = $description;
		$data['location'] = $location;
		$data['location_id'] = $locationId;
		$data['privacy_type'] = $privacyType;

		return $this->createConnection($event, null, $data);
	}

	/**
	 * Method to delete an event. Note: you can only delete the event if it
was created by the same app. Requires authentication create_event
permission.
	 *
	 * @param   string  $event  Event ID.
	 *
	 * @return  boolean   Returns true if successful, and false otherwise.
	 *
	 * @since   3.2.0
	 */
	public function deleteEvent($event)
	{
		return $this->deleteConnection($event);
	}

	/**
	 * Method to get the groups that the user belongs to. Requires
authentication and user_groups or friends_groups permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getGroups($user, $limit = 0, $offset = 0)
	{
		return $this->getConnection($user, 'groups', '',
$limit, $offset);
	}

	/**
	 * Method to get the user's posted links. Requires authentication and
user_groups or friends_groups permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getLinks($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'links', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to post a link on user's feed. Requires authentication and
publish_stream permission.
	 *
	 * @param   mixed   $user     Either an integer containing the user ID or
a string containing the username.
	 * @param   string  $link     Link URL.
	 * @param   string  $message  Link message.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function createLink($user, $link, $message = null)
	{
		// Set POST request parameters.
		$data = array();
		$data['link'] = $link;
		$data['message'] = $message;

		return $this->createConnection($user, 'feed', $data);
	}

	/**
	 * Method to delete a link. Requires authentication and publish_stream
permission.
	 *
	 * @param   mixed  $link  The Link ID.
	 *
	 * @return  boolean   Returns true if successful, and false otherwise.
	 *
	 * @since   3.2.0
	 */
	public function deleteLink($link)
	{
		return $this->deleteConnection($link);
	}

	/**
	 * Method to get the user's notes. Requires authentication and
user_groups or friends_groups permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getNotes($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'notes', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to create a note on the behalf of the user.
	 * Requires authentication and publish_stream permission, user_groups or
friends_groups permission.
	 *
	 * @param   mixed   $user     Either an integer containing the user ID or
a string containing the username.
	 * @param   string  $subject  The subject of the note.
	 * @param   string  $message  Note content.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function createNote($user, $subject, $message)
	{
		// Set POST request parameters.
		$data = array();
		$data['subject'] = $subject;
		$data['message'] = $message;

		return $this->createConnection($user, 'notes', $data);
	}

	/**
	 * Method to get the user's photos. Requires authentication and
user_groups or friends_groups permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getPhotos($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'photos', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to post a photo on user's wall. Requires authentication and
publish_stream permission, user_groups or friends_groups permission.
	 *
	 * @param   mixed    $user     Either an integer containing the user ID or
a string containing the username.
	 * @param   string   $source   Path to photo.
	 * @param   string   $message  Photo description.
	 * @param   string   $place    Facebook ID of the place associated with
the photo.
	 * @param   boolean  $noStory  If set to 1, optionally suppresses the feed
story that is automatically
	 *                             generated on a user’s profile when they
upload a photo using your application.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function createPhoto($user, $source, $message = null, $place =
null, $noStory = null)
	{
		// Set POST request parameters.
		$data = array();
		$data[basename($source)] = '@' . realpath($source);
		$data['message'] = $message;
		$data['place'] = $place;
		$data['no_story'] = $noStory;

		return $this->createConnection($user, 'photos', $data,
array('Content-Type' => 'multipart/form-data'));
	}

	/**
	 * Method to get the user's posts. Requires authentication and
read_stream permission for non-public posts.
	 *
	 * @param   mixed    $user      Either an integer containing the user ID
or a string containing the username.
	 * @param   boolean  $location  Retrieve only posts with a location
attached.
	 * @param   integer  $limit     The number of objects per page.
	 * @param   integer  $offset    The object's number on the page.
	 * @param   string   $until     A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since     A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getPosts($user, $location = false, $limit = 0, $offset =
0, $until = null, $since = null)
	{
		if ($location == true)
		{
			$location = '?with=location';
		}

		// Send the request.
		return $this->getConnection($user, 'posts', $location,
$limit, $offset, $until, $since);
	}

	/**
	 * Method to post on a user's wall. Message or link parameter is
required. Requires authentication and publish_stream permission.
	 *
	 * @param   mixed   $user              Either an integer containing the
user ID or a string containing the username.
	 * @param   string  $message           Post message.
	 * @param   string  $link              Post URL.
	 * @param   string  $picture           Post thumbnail image (can only be
used if link is specified)
	 * @param   string  $name              Post name (can only be used if link
is specified).
	 * @param   string  $caption           Post caption (can only be used if
link is specified).
	 * @param   string  $description       Post description (can only be used
if link is specified).
	 * @param   array   $actions           Post actions array of objects
containing name and link.
	 * @param   string  $place             Facebook Page ID of the location
associated with this Post.
	 * @param   string  $tags              Comma-separated list of Facebook
IDs of people tagged in this Post.
	 *                                     For example: 1207059,701732. You
cannot specify this field without also specifying a place.
	 * @param   string  $privacy           Post privacy settings (can only be
specified if the Timeline being posted
	 *                                     on belongs to the User creating the
Post).
	 * @param   string  $objectAttachment  Facebook ID for an existing picture
in the User's photo albums to use as the thumbnail image.
	 *                                     The User must be the owner of the
photo, and the photo cannot be part of a message attachment.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function createPost($user, $message = null, $link = null, $picture
= null, $name = null, $caption = null,
		$description = null, $actions = null, $place = null, $tags = null,
$privacy = null, $objectAttachment = null)
	{
		// Set POST request parameters.
		$data = array();
		$data['message'] = $message;
		$data['link'] = $link;
		$data['name'] = $name;
		$data['caption'] = $caption;
		$data['description'] = $description;
		$data['actions'] = $actions;
		$data['place'] = $place;
		$data['tags'] = $tags;
		$data['privacy'] = $privacy;
		$data['object_attachment'] = $objectAttachment;
		$data['picture'] = $picture;

		return $this->createConnection($user, 'feed', $data);
	}

	/**
	 * Method to delete a post. Note: you can only delete the post if it was
created by the current user. Requires authentication
	 *
	 * @param   string  $post  The Post ID.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function deletePost($post)
	{
		return $this->deleteConnection($post);
	}

	/**
	 * Method to get the user's statuses. Requires authentication
read_stream permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getStatuses($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'statuses', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to post a status message on behalf of the user. Requires
authentication publish_stream permission.
	 *
	 * @param   mixed   $user     Either an integer containing the user ID or
a string containing the username.
	 * @param   string  $message  Status message content.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function createStatus($user, $message)
	{
		// Set POST request parameters.
		$data = array();
		$data['message'] = $message;

		return $this->createConnection($user, 'feed', $data);
	}

	/**
	 * Method to delete a status. Note: you can only delete the post if it was
created by the current user.
	 * Requires authentication publish_stream permission.
	 *
	 * @param   string  $status  The Status ID.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function deleteStatus($status)
	{
		return $this->deleteConnection($status);
	}

	/**
	 * Method to get the videos the user has been tagged in. Requires
authentication and user_videos or friends_videos permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getVideos($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'videos', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to post a video on behalf of the user. Requires authentication
and publish_stream permission.
	 *
	 * @param   mixed   $user         Either an integer containing the user ID
or a string containing the username.
	 * @param   string  $source       Path to video.
	 * @param   string  $title        Video title.
	 * @param   string  $description  Video description.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function createVideo($user, $source, $title = null, $description =
null)
	{
		// Set POST request parameters.
		$data = array();
		$data[basename($source)] = '@' . realpath($source);
		$data['title'] = $title;
		$data['description'] = $description;

		return $this->createConnection($user, 'videos', $data,
array('Content-Type' => 'multipart/form-data'));
	}

	/**
	 * Method to get the posts the user has been tagged in. Requires
authentication and user_videos or friends_videos permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getTagged($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'tagged', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to get the activities listed on the user's profile.
Requires authentication and user_activities or friends_activities
permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getActivities($user, $limit = 0, $offset = 0, $until =
null, $since = null)
	{
		return $this->getConnection($user, 'activities',
'', $limit, $offset, $until, $since);
	}

	/**
	 * Method to get the books listed on the user's profile. Requires
authentication and user_likes or friends_likes permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getBooks($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'books', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to get the interests listed on the user's profile. Requires
authentication.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getInterests($user, $limit = 0, $offset = 0, $until =
null, $since = null)
	{
		return $this->getConnection($user, 'interests',
'', $limit, $offset, $until, $since);
	}

	/**
	 * Method to get the movies listed on the user's profile. Requires
authentication and user_likes or friends_likes permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getMovies($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'movies', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to get the television listed on the user's profile.
Requires authentication and user_likes or friends_likes permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getTelevision($user, $limit = 0, $offset = 0, $until =
null, $since = null)
	{
		return $this->getConnection($user, 'television',
'', $limit, $offset, $until, $since);
	}

	/**
	 * Method to get the music listed on the user's profile. Requires
authentication user_likes or friends_likes permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 * @param   string   $until   A unix timestamp or any date accepted by
strtotime.
	 * @param   string   $since   A unix timestamp or any date accepted by
strtotime.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getMusic($user, $limit = 0, $offset = 0, $until = null,
$since = null)
	{
		return $this->getConnection($user, 'music', '',
$limit, $offset, $until, $since);
	}

	/**
	 * Method to get the user's subscribers. Requires authentication and
user_subscriptions or friends_subscriptions permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getSubscribers($user, $limit = 0, $offset = 0)
	{
		return $this->getConnection($user, 'subscribers',
'', $limit, $offset);
	}

	/**
	 * Method to get the people the user is subscribed to. Requires
authentication and user_subscriptions or friends_subscriptions permission.
	 *
	 * @param   mixed    $user    Either an integer containing the user ID or
a string containing the username.
	 * @param   integer  $limit   The number of objects per page.
	 * @param   integer  $offset  The object's number on the page.
	 *
	 * @return  mixed   The decoded JSON response or false if the client is
not authenticated.
	 *
	 * @since   3.2.0
	 */
	public function getSubscribedTo($user, $limit = 0, $offset = 0)
	{
		return $this->getConnection($user, 'subscribedto',
'', $limit, $offset);
	}
}
home/lmsyaran/public_html/j3/htaccess.back/fof/form/field/user.php000064400000015557151161120640021135
0ustar00<?php
/**
 * @package    FrameworkOnFramework
 * @subpackage form
 * @copyright   Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba
Ltd. All rights reserved.
 * @license    GNU General Public License version 2 or later; see
LICENSE.txt
 */
// Protect from unauthorized access
defined('FOF_INCLUDED') or die;

JFormHelper::loadFieldClass('user');

/**
 * Form Field class for the FOF framework
 * A user selection box / display field
 *
 * @package  FrameworkOnFramework
 * @since    2.0
 */
class FOFFormFieldUser extends JFormFieldUser implements FOFFormField
{
	protected $static;

	protected $repeatable;

	/** @var   FOFTable  The item being rendered in a repeatable form field */
	public $item;

	/** @var int A monotonically increasing number, denoting the row number in
a repeatable view */
	public $rowid;

	/**
	 * Method to get certain otherwise inaccessible properties from the form
field object.
	 *
	 * @param   string  $name  The property name for which to the the value.
	 *
	 * @return  mixed  The property value or null.
	 *
	 * @since   2.0
	 */
	public function __get($name)
	{
		switch ($name)
		{
			case 'static':
				if (empty($this->static))
				{
					$this->static = $this->getStatic();
				}

				return $this->static;
				break;

			case 'repeatable':
				if (empty($this->repeatable))
				{
					$this->repeatable = $this->getRepeatable();
				}

				return $this->repeatable;
				break;

			default:
				return parent::__get($name);
		}
	}

	/**
	 * Get the rendering of this field type for static display, e.g. in a
single
	 * item view (typically a "read" task).
	 *
	 * @since 2.0
	 *
	 * @return  string  The field HTML
	 */
	public function getStatic()
	{
		// Initialise
		$show_username = true;
		$show_email    = false;
		$show_name     = false;
		$show_id       = false;
		$class         = '';

		// Get the field parameters
		if ($this->element['class'])
		{
			$class = ' class="' . (string)
$this->element['class'] . '"';
		}

		if ($this->element['show_username'] == 'false')
		{
			$show_username = false;
		}

		if ($this->element['show_email'] == 'true')
		{
			$show_email = true;
		}

		if ($this->element['show_name'] == 'true')
		{
			$show_name = true;
		}

		if ($this->element['show_id'] == 'true')
		{
			$show_id = true;
		}

		// Get the user record
		$user = JFactory::getUser($this->value);

		// Render the HTML
		$html = '<div id="' . $this->id . '"
' . $class . '>';

		if ($show_username)
		{
			$html .= '<span
class="fof-userfield-username">' . $user->username .
'</span>';
		}

		if ($show_id)
		{
			$html .= '<span class="fof-userfield-id">' .
$user->id . '</span>';
		}

		if ($show_name)
		{
			$html .= '<span class="fof-userfield-name">' .
$user->name . '</span>';
		}

		if ($show_email)
		{
			$html .= '<span class="fof-userfield-email">'
. $user->email . '</span>';
		}

		$html .= '</div>';

		return $html;
	}

	/**
	 * Get the rendering of this field type for a repeatable (grid) display,
	 * e.g. in a view listing many item (typically a "browse" task)
	 *
	 * @since 2.0
	 *
	 * @return  string  The field HTML
	 */
	public function getRepeatable()
	{
		// Initialise
		$show_username = true;
		$show_email    = true;
		$show_name     = true;
		$show_id       = true;
		$show_avatar   = true;
		$show_link     = false;
		$link_url      = null;
		$avatar_method = 'gravatar';
		$avatar_size   = 64;
		$class         = '';

		// Get the user record
		$user = JFactory::getUser($this->value);

		// Get the field parameters
		if ($this->element['class'])
		{
			$class = ' class="' . (string)
$this->element['class'] . '"';
		}

		if ($this->element['show_username'] == 'false')
		{
			$show_username = false;
		}

		if ($this->element['show_email'] == 'false')
		{
			$show_email = false;
		}

		if ($this->element['show_name'] == 'false')
		{
			$show_name = false;
		}

		if ($this->element['show_id'] == 'false')
		{
			$show_id = false;
		}

		if ($this->element['show_avatar'] == 'false')
		{
			$show_avatar = false;
		}

		if ($this->element['avatar_method'])
		{
			$avatar_method =
strtolower($this->element['avatar_method']);
		}

		if ($this->element['avatar_size'])
		{
			$avatar_size = $this->element['avatar_size'];
		}

		if ($this->element['show_link'] == 'true')
		{
			$show_link = true;
		}

		if ($this->element['link_url'])
		{
			$link_url = $this->element['link_url'];
		}
		else
		{
			if (FOFPlatform::getInstance()->isBackend())
			{
				// If no link is defined in the back-end, assume the user edit
				// link in the User Manager component
				$link_url =
'index.php?option=com_users&task=user.edit&id=[USER:ID]';
			}
			else
			{
				// If no link is defined in the front-end, we can't create a
				// default link. Therefore, show no link.
				$show_link = false;
			}
		}

		// Post-process the link URL
		if ($show_link)
		{
			$replacements = array(
				'[USER:ID]'			 => $user->id,
				'[USER:USERNAME]'	 => $user->username,
				'[USER:EMAIL]'		 => $user->email,
				'[USER:NAME]'		 => $user->name,
			);

			foreach ($replacements as $key => $value)
			{
				$link_url = str_replace($key, $value, $link_url);
			}
		}

		// Get the avatar image, if necessary
		if ($show_avatar)
		{
			$avatar_url = '';

			if ($avatar_method == 'plugin')
			{
				// Use the user plugins to get an avatar
				FOFPlatform::getInstance()->importPlugin('user');
				$jResponse =
FOFPlatform::getInstance()->runPlugins('onUserAvatar',
array($user, $avatar_size));

				if (!empty($jResponse))
				{
					foreach ($jResponse as $response)
					{
						if ($response)
						{
							$avatar_url = $response;
						}
					}
				}

				if (empty($avatar_url))
				{
					$show_avatar = false;
				}
			}
			else
			{
				// Fall back to the Gravatar method
				$md5 = md5($user->email);

				if (FOFPlatform::getInstance()->isCli())
				{
					$scheme = 'http';
				}
				else
				{
					$scheme = JURI::getInstance()->getScheme();
				}

				if ($scheme == 'http')
				{
					$avatar_url = 'http://www.gravatar.com/avatar/' . $md5 .
'.jpg?s='
						. $avatar_size . '&d=mm';
				}
				else
				{
					$avatar_url = 'https://secure.gravatar.com/avatar/' . $md5 .
'.jpg?s='
						. $avatar_size . '&d=mm';
				}
			}
		}

		// Generate the HTML
		$html = '<div id="' . $this->id . '"
' . $class . '>';

		if ($show_avatar)
		{
			$html .= '<img src="' . $avatar_url . '"
align="left" class="fof-usersfield-avatar" />';
		}

		if ($show_link)
		{
			$html .= '<a href="' . $link_url .
'">';
		}

		if ($show_username)
		{
			$html .= '<span
class="fof-usersfield-username">' . $user->username
				. '</span>';
		}

		if ($show_id)
		{
			$html .= '<span class="fof-usersfield-id">' .
$user->id
				. '</span>';
		}

		if ($show_name)
		{
			$html .= '<span class="fof-usersfield-name">'
. $user->name
				. '</span>';
		}

		if ($show_email)
		{
			$html .= '<span class="fof-usersfield-email">'
. $user->email
				. '</span>';
		}

		if ($show_link)
		{
			$html .= '</a>';
		}

		$html .= '</div>';

		return $html;
	}
}
home/lmsyaran/public_html/j3/plugins/fields/user/tmpl/user.php000064400000001245151161430330020507
0ustar00<?php
/**
 * @package     Joomla.Plugin
 * @subpackage  Fields.User
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */
defined('_JEXEC') or die;

$value = $field->value;

if ($value == '')
{
	return;
}

$value = (array) $value;
$texts = array();

foreach ($value as $userId)
{
	if (!$userId)
	{
		continue;
	}

	$user = JFactory::getUser($userId);

	if ($user)
	{
		// Use the Username
		$texts[] = $user->name;
		continue;
	}

	// Fallback and add the User ID if we get no JUser Object
	$texts[] = $userId;
}

echo htmlentities(implode(', ', $texts));
home/lmsyaran/public_html/j3/plugins/fields/user/user.php000064400000002021151161503360017530
0ustar00<?php
/**
 * @package     Joomla.Plugin
 * @subpackage  Fields.User
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

JLoader::import('components.com_fields.libraries.fieldsplugin',
JPATH_ADMINISTRATOR);

/**
 * Fields User Plugin
 *
 * @since  3.7.0
 */
class PlgFieldsUser extends FieldsPlugin
{

	/**
	 * Transforms the field into a DOM XML element and appends it as a child
on the given parent.
	 *
	 * @param   stdClass    $field   The field.
	 * @param   DOMElement  $parent  The field node parent.
	 * @param   JForm       $form    The form.
	 *
	 * @return  DOMElement
	 *
	 * @since   3.7.0
	 */
	public function onCustomFieldsPrepareDom($field, DOMElement $parent, JForm
$form)
	{
		if (JFactory::getApplication()->isClient('site'))
		{
			// The user field is not working on the front end
			return;
		}

		return parent::onCustomFieldsPrepareDom($field, $parent, $form);
	}
}
home/lmsyaran/public_html/j3/plugins/privacy/user/user.php000064400000015256151162050500017747
0ustar00<?php
/**
 * @package     Joomla.Plugin
 * @subpackage  Privacy.user
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\Utilities\ArrayHelper;

JLoader::register('PrivacyPlugin', JPATH_ADMINISTRATOR .
'/components/com_privacy/helpers/plugin.php');
JLoader::register('PrivacyRemovalStatus', JPATH_ADMINISTRATOR .
'/components/com_privacy/helpers/removal/status.php');

/**
 * Privacy plugin managing Joomla user data
 *
 * @since  3.9.0
 */
class PlgPrivacyUser extends PrivacyPlugin
{
	/**
	 * Performs validation to determine if the data associated with a remove
information request can be processed
	 *
	 * This event will not allow a super user account to be removed
	 *
	 * @param   PrivacyTableRequest  $request  The request record being
processed
	 * @param   JUser                $user     The user account associated
with this request if available
	 *
	 * @return  PrivacyRemovalStatus
	 *
	 * @since   3.9.0
	 */
	public function onPrivacyCanRemoveData(PrivacyTableRequest $request, JUser
$user = null)
	{
		$status = new PrivacyRemovalStatus;

		if (!$user)
		{
			return $status;
		}

		if ($user->authorise('core.admin'))
		{
			$status->canRemove = false;
			$status->reason    =
JText::_('PLG_PRIVACY_USER_ERROR_CANNOT_REMOVE_SUPER_USER');
		}

		return $status;
	}

	/**
	 * Processes an export request for Joomla core user data
	 *
	 * This event will collect data for the following core tables:
	 *
	 * - #__users (excluding the password, otpKey, and otep columns)
	 * - #__user_notes
	 * - #__user_profiles
	 * - User custom fields
	 *
	 * @param   PrivacyTableRequest  $request  The request record being
processed
	 * @param   JUser                $user     The user account associated
with this request if available
	 *
	 * @return  PrivacyExportDomain[]
	 *
	 * @since   3.9.0
	 */
	public function onPrivacyExportRequest(PrivacyTableRequest $request, JUser
$user = null)
	{
		if (!$user)
		{
			return array();
		}

		/** @var JTableUser $userTable */
		$userTable = JUser::getTable();
		$userTable->load($user->id);

		$domains = array();
		$domains[] = $this->createUserDomain($userTable);
		$domains[] = $this->createNotesDomain($userTable);
		$domains[] = $this->createProfileDomain($userTable);
		$domains[] =
$this->createCustomFieldsDomain('com_users.user',
array($userTable));

		return $domains;
	}

	/**
	 * Removes the data associated with a remove information request
	 *
	 * This event will pseudoanonymise the user account
	 *
	 * @param   PrivacyTableRequest  $request  The request record being
processed
	 * @param   JUser                $user     The user account associated
with this request if available
	 *
	 * @return  void
	 *
	 * @since   3.9.0
	 */
	public function onPrivacyRemoveData(PrivacyTableRequest $request, JUser
$user = null)
	{
		// This plugin only processes data for registered user accounts
		if (!$user)
		{
			return;
		}

		$pseudoanonymisedData = array(
			'name'      => 'User ID ' . $user->id,
			'username'  => bin2hex(random_bytes(12)),
			'email'     => 'UserID' . $user->id .
'removed@email.invalid',
			'block'     => true,
		);

		$user->bind($pseudoanonymisedData);

		$user->save();

		// Destroy all sessions for the user account
		$sessionIds = $this->db->setQuery(
			$this->db->getQuery(true)
				->select($this->db->quoteName('session_id'))
				->from($this->db->quoteName('#__session'))
				->where($this->db->quoteName('userid') . ' =
' . (int) $user->id)
		)->loadColumn();

		// If there aren't any active sessions then there's nothing to
do here
		if (empty($sessionIds))
		{
			return;
		}

		$storeName = JFactory::getConfig()->get('session_handler',
'none');
		$store     = JSessionStorage::getInstance($storeName);
		$quotedIds = array();

		// Destroy the sessions and quote the IDs to purge the session table
		foreach ($sessionIds as $sessionId)
		{
			$store->destroy($sessionId);
			$quotedIds[] = $this->db->quoteBinary($sessionId);
		}

		$this->db->setQuery(
			$this->db->getQuery(true)
				->delete($this->db->quoteName('#__session'))
				->where($this->db->quoteName('session_id') . '
IN (' . implode(', ', $quotedIds) . ')')
		)->execute();
	}

	/**
	 * Create the domain for the user notes data
	 *
	 * @param   JTableUser  $user  The JTableUser object to process
	 *
	 * @return  PrivacyExportDomain
	 *
	 * @since   3.9.0
	 */
	private function createNotesDomain(JTableUser $user)
	{
		$domain = $this->createDomain('user_notes',
'joomla_user_notes_data');

		$query = $this->db->getQuery(true)
			->select('*')
			->from($this->db->quoteName('#__user_notes'))
			->where($this->db->quoteName('user_id') . ' =
' . $this->db->quote($user->id));

		$items = $this->db->setQuery($query)->loadAssocList();

		// Remove user ID columns
		foreach (array('user_id', 'created_user_id',
'modified_user_id') as $column)
		{
			$items = ArrayHelper::dropColumn($items, $column);
		}

		foreach ($items as $item)
		{
			$domain->addItem($this->createItemFromArray($item,
$item['id']));
		}

		return $domain;
	}

	/**
	 * Create the domain for the user profile data
	 *
	 * @param   JTableUser  $user  The JTableUser object to process
	 *
	 * @return  PrivacyExportDomain
	 *
	 * @since   3.9.0
	 */
	private function createProfileDomain(JTableUser $user)
	{
		$domain = $this->createDomain('user_profile',
'joomla_user_profile_data');

		$query = $this->db->getQuery(true)
			->select('*')
			->from($this->db->quoteName('#__user_profiles'))
			->where($this->db->quoteName('user_id') . ' =
' . $this->db->quote($user->id))
			->order($this->db->quoteName('ordering') . '
ASC');

		$items = $this->db->setQuery($query)->loadAssocList();

		foreach ($items as $item)
		{
			$domain->addItem($this->createItemFromArray($item));
		}

		return $domain;
	}

	/**
	 * Create the domain for the user record
	 *
	 * @param   JTableUser  $user  The JTableUser object to process
	 *
	 * @return  PrivacyExportDomain
	 *
	 * @since   3.9.0
	 */
	private function createUserDomain(JTableUser $user)
	{
		$domain = $this->createDomain('users',
'joomla_users_data');
		$domain->addItem($this->createItemForUserTable($user));

		return $domain;
	}

	/**
	 * Create an item object for a JTableUser object
	 *
	 * @param   JTableUser  $user  The JTableUser object to convert
	 *
	 * @return  PrivacyExportItem
	 *
	 * @since   3.9.0
	 */
	private function createItemForUserTable(JTableUser $user)
	{
		$data    = array();
		$exclude = array('password', 'otpKey',
'otep');

		foreach (array_keys($user->getFields()) as $fieldName)
		{
			if (!in_array($fieldName, $exclude))
			{
				$data[$fieldName] = $user->$fieldName;
			}
		}

		return $this->createItemFromArray($data, $user->id);
	}
}