Файловый менеджер - Редактировать - /home/wuectly/www/03cbe/user.php.tar
Назад
home/wuectly/www/libraries/joomla/openstreetmap/user.php 0000604 00000006307 15245570454 0017643 0 ustar 00 <?php /** * @package Joomla.Platform * @subpackage Openstreetmap * * @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org> * @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/wuectly/www/components/com_acymailing/controllers/user.php 0000604 00000034371 15245572114 0021223 0 ustar 00 <?php /** * @package AcyMailing for Joomla! * @version 5.9.6 * @author acyba.com * @copyright (C) 2009-2018 ACYBA S.A.R.L. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); ?><?php class UserController extends acymailingController{ function __construct($config = array()){ parent::__construct($config); $this->registerDefaultTask('subscribe'); $this->registerTask('optout', 'unsub'); $this->registerTask('out', 'unsub'); } function confirm(){ if(acymailing_isRobot()) return false; $config = acymailing_config(); $userClass = acymailing_get('class.subscriber'); $userClass->geolocRight = true; $user = $userClass->identify(); if(empty($user)) return false; $redirectUrl = $config->get('confirm_redirect'); $listRedirection = ''; $subscription = $userClass->getSubscriptionStatus($user->subid); foreach($subscription as $i => $onelist){ if(!in_array($onelist->status, array(1, 2)) || acymailing_translation('REDIRECTION_CONFIRMATION_'.$i) == 'REDIRECTION_CONFIRMATION_'.$i) continue; $listRedirection = acymailing_translation('REDIRECTION_CONFIRMATION_'.$i); break; } if(!empty($listRedirection)) $redirectUrl = $listRedirection; if($config->get('confirmation_message', 1)){ if($user->confirmed && strlen(acymailing_translation('ALREADY_CONFIRMED')) > 0){ acymailing_enqueueMessage(acymailing_translation('ALREADY_CONFIRMED')); }elseif(!$user->confirmed && strlen(acymailing_translation('SUBSCRIPTION_CONFIRMED')) > 0) acymailing_enqueueMessage(acymailing_translation('SUBSCRIPTION_CONFIRMED')); } if(!$user->confirmed) $userClass->confirmSubscription($user->subid); $notifConfirm = $config->get('notification_confirm'); if(!empty($notifConfirm)){ $listsubClass = acymailing_get('class.listsub'); $userHelper = acymailing_get('helper.user'); $mailer = acymailing_get('helper.mailer'); $mailer->autoAddUser = true; $mailer->checkConfirmField = false; $mailer->report = false; foreach($user as $field => $value) $mailer->addParam('user:'.$field, $value); $mailer->addParam('user:subscription', $listsubClass->getSubscriptionString($user->subid)); $mailer->addParam('user:subscriptiondates', $listsubClass->getSubscriptionString($user->subid, true)); $mailer->addParam('user:ip', $userHelper->getIP()); if(!empty($userClass->geolocData)){ foreach($userClass->geolocData as $map => $value){ $mailer->addParam('geoloc:notif_'.$map, $value); } } $mailer->addParamInfo(); $allUsers = explode(' ', trim(str_replace(array(';', ','), ' ', $notifConfirm))); foreach($allUsers as $oneUser){ if(empty($oneUser)) continue; $mailer->sendOne('notification_confirm', $oneUser); } } if(!empty($redirectUrl)){ $replace = array(); foreach($user as $key => $val){ $replace['{'.$key.'}'] = $val; $replace['{user:'.$key.'}'] = $val; } if($config->get('redirect_tags', 0) == 1) $redirectUrl = str_replace(array_keys($replace), $replace, $redirectUrl); acymailing_redirect($redirectUrl); } if('joomla' == 'wordpress') acymailing_redirect(acymailing_rootURI()); acymailing_setVar('layout', 'confirm'); return parent::display(); }//endfct function modify(){ $userClass = acymailing_get('class.subscriber'); $userClass->geolocRight = true; $user = $userClass->identify(true); if(empty($user)) return $this->subscribe(); acymailing_setVar('layout', 'modify'); return parent::display(); } function subscribe(){ $userClass = acymailing_get('class.subscriber'); $userClass->geolocRight = true; $currentUserid = acymailing_currentUserId(); if(!empty($currentUserid) AND $userClass->identify(true)){ return $this->modify(); } $config = acymailing_config(); $allowvisitor = $config->get('allow_visitor', 1); if(empty($allowvisitor)){ acymailing_askLog(true, 'ONLY_LOGGED', 'message'); return false; } acymailing_setVar('layout', 'modify'); return parent::display(); } function unsub(){ $userClass = acymailing_get('class.subscriber'); $user = $userClass->identify(); if(empty($user)) return false; $statsClass = acymailing_get('class.stats'); $statsClass->countReturn = false; $statsClass->saveStats(); acymailing_setVar('layout', 'unsub'); return parent::display(); } function saveunsub(){ acymailing_checkRobots(); $subscriberClass = acymailing_get('class.subscriber'); $subscriberClass->sendConf = false; $listsubClass = acymailing_get('class.listsub'); $userHelper = acymailing_get('helper.user'); $config = acymailing_config(); $subscriber = new stdClass(); $subscriber->subid = acymailing_getVar('int', 'subid'); $user = $subscriberClass->identify(); if(!$user || empty($subscriber->subid) || $user->subid != $subscriber->subid){ echo "<script>alert('ERROR : You are not allowed to modify this user'); window.history.go(-1);</script>"; exit; } $refusemails = acymailing_getVar('int', 'refuse'); $unsuball = acymailing_getVar('int', 'unsuball'); $mailid = acymailing_getVar('int', 'mailid'); $oldUser = $subscriberClass->get($subscriber->subid); $survey = acymailing_getVar('array', 'survey', array(), ''); $tagSurvey = ''; $data = array(); if(!empty($survey)){ foreach($survey as $oneResult){ if(empty($oneResult)) continue; $data[] = "REASON::".str_replace(array("\n", "\r"), array('<br />', ''), strip_tags($oneResult)); } $tagSurvey = implode('<br />', $data); } $replace = array(); $replace['REASON::'] = '<br />'.acymailing_translation('REASON').' : '; $reasons = unserialize($config->get('unsub_reasons')); foreach($reasons as $i => $oneReason){ if(preg_match('#^[A-Z_]*$#', $oneReason)){ $replace[$oneReason] = acymailing_translation($oneReason); } } $tagSurvey = str_replace(array_keys($replace), $replace, $tagSurvey); $historyClass = acymailing_get('class.acyhistory'); $historyClass->insert($subscriber->subid, 'unsubscribed', $data, $mailid); $notifToSend = ''; $incrementUnsub = false; if($refusemails OR $unsuball){ if($refusemails){ $subscriber->accept = 0; if($config->get('unsubscription_message', 1) && strlen(acymailing_translation('CONFIRM_UNSUB_FULL')) > 0) acymailing_enqueueMessage(acymailing_translation('CONFIRM_UNSUB_FULL')); $notifToSend = 'notification_refuse'; }elseif($unsuball){ $notifToSend = 'notification_unsuball'; } $subscription = $subscriberClass->getSubscriptionStatus($subscriber->subid); $updatelists = array(); foreach($subscription as $listid => $oneList){ if($oneList->status != -1){ $updatelists[-1][] = $listid; } } $listsubClass->sendNotif = false; if(!empty($updatelists)){ $status = $listsubClass->updateSubscription($subscriber->subid, $updatelists); if($config->get('unsubscription_message', 1) && strlen(acymailing_translation('CONFIRM_UNSUB_ALL')) > 0) acymailing_enqueueMessage(acymailing_translation('CONFIRM_UNSUB_ALL')); $incrementUnsub = true; }else{ if($config->get('unsubscription_message', 1) && strlen(acymailing_translation('ERROR_NOT_SUBSCRIBED')) > 0) acymailing_enqueueMessage(acymailing_translation('ERROR_NOT_SUBSCRIBED')); } $subscriber->confirmed = 0; $subscriberClass->save($subscriber); }else{ $subscription = $subscriberClass->getSubscriptionStatus($subscriber->subid); $allLists = acymailing_loadObjectList('SELECT b.listid, b.name, b.type FROM '.acymailing_table('listmail').' as a JOIN '.acymailing_table('list').' as b on a.listid = b.listid WHERE a.mailid = '.$mailid); if(empty($allLists)){ $allLists = acymailing_loadObjectList('SELECT b.listid, b.name, b.type FROM '.acymailing_table('list').' as b WHERE b.welmailid = '.$mailid.' OR b.unsubmailid = '.$mailid); } if(empty($allLists)){ $allLists = acymailing_loadObjectList('SELECT b.listid, b.name, b.type FROM #__acymailing_listsub as a JOIN #__acymailing_list as b on a.listid = b.listid WHERE a.subid = '.$subscriber->subid); } $otherSubscriptionsBoxes = acymailing_getVar('array', 'unsubotherlists', array(), 'post'); $otherSubscriptionsId = acymailing_getVar('array', 'unsubotherlistsid', array(), 'post'); $othersubscriptionsToRemove = array(); if(!empty($otherSubscriptionsBoxes)){ $i = 0; foreach($otherSubscriptionsBoxes as $anotherSubscriptionsBox => $value){ if($value == 1) $othersubscriptionsToRemove[] = intval($otherSubscriptionsId[$i]); $i++; } $otherSubscriptions = acymailing_loadObjectList('SELECT listid, name, type FROM #__acymailing_list WHERE listid IN ('.implode(',', $othersubscriptionsToRemove).')'); foreach($otherSubscriptions as $anotherSubscription){ array_push($allLists, $anotherSubscription); } } if(empty($allLists)){ echo "<script>alert('ERROR : Could not get the list for the mailing $mailid'); window.history.go(-1);</script>"; exit; } $campaignList = array(); $unsubList = array(); foreach($allLists as $oneList){ if(isset($subscription[$oneList->listid]) AND $subscription[$oneList->listid]->status != -1){ if($oneList->type == 'campaign'){ $campaignList[] = $oneList->listid; }else{ $unsubList[$oneList->listid] = $oneList; } } } if(!empty($campaignList)){ $otherLists = acymailing_loadObjectList('SELECT b.listid, b.name, b.type FROM '.acymailing_table('listcampaign').' as a LEFT JOIN '.acymailing_table('list').' as b on a.listid = b.listid WHERE a.campaignid IN ('.implode(',', $campaignList).')'); if(!empty($otherLists)){ foreach($otherLists as $oneList){ if(isset($subscription[$oneList->listid]) AND $subscription[$oneList->listid]->status != -1){ $unsubList[$oneList->listid] = $oneList; } } } } if(!empty($unsubList)){ $updatelists = array(); $updatelists[-1] = array_keys($unsubList); $listsubClass->survey = $tagSurvey; $status = $listsubClass->updateSubscription($subscriber->subid, $updatelists); if($config->get('unsubscription_message', 1) && strlen(acymailing_translation('CONFIRM_UNSUB_CURRENT')) > 0) acymailing_enqueueMessage(acymailing_translation('CONFIRM_UNSUB_CURRENT')); $incrementUnsub = true; }else{ if($config->get('unsubscription_message', 1) && strlen(acymailing_translation('ERROR_NOT_SUBSCRIBED_CURRENT')) > 0) acymailing_enqueueMessage(acymailing_translation('ERROR_NOT_SUBSCRIBED_CURRENT')); } } if($incrementUnsub){ $alreadythere = acymailing_loadResult('SELECT subid FROM #__acymailing_history WHERE `action` = "unsubscribed" AND `subid` = '.intval($subscriber->subid).' AND `mailid` = '.intval($mailid).' LIMIT 1,1'); if(empty($alreadythere)){ acymailing_query('UPDATE '.acymailing_table('stats').' SET `unsub` = `unsub` +1 WHERE `mailid` = '.(int)$mailid); } } $classGeoloc = acymailing_get('class.geolocation'); $classGeoloc->saveGeolocation('unsubscription', $subscriber->subid); if(!empty($notifToSend)){ $notifyUsers = $config->get($notifToSend); if(!empty($notifyUsers)){ $mailer = acymailing_get('helper.mailer'); $mailer->autoAddUser = true; $mailer->checkConfirmField = false; $mailer->report = false; foreach($oldUser as $field => $value) $mailer->addParam('user:'.$field, $value); $mailer->addParam('user:subscription', $listsubClass->getSubscriptionString($oldUser->subid)); $mailer->addParam('user:subscriptiondates', $listsubClass->getSubscriptionString($oldUser->subid, true)); $mailer->addParam('user:ip', $userHelper->getIP()); $mailer->addParam('survey', $tagSurvey); $mailer->addParamInfo(); $allUsers = explode(' ', trim(str_replace(array(';', ','), ' ', $notifyUsers))); foreach($allUsers as $oneUser){ if(empty($oneUser)) continue; $mailer->sendOne('notification_unsuball', $oneUser); } } } $redirectUnsub = $config->get('unsub_redirect'); if(!empty($redirectUnsub)){ $replace = array(); foreach($oldUser as $key => $val){ $replace['{'.$key.'}'] = $val; $replace['{user:'.$key.'}'] = $val; } if($config->get('redirect_tags', 0) == 1) $redirectUnsub = str_replace(array_keys($replace), $replace, $redirectUnsub); acymailing_redirect($redirectUnsub); return; }elseif('joomla' == 'wordpress'){ acymailing_redirect(acymailing_rootURI()); return; } acymailing_setVar('layout', 'saveunsub'); return parent::display(); } function savechanges(){ acymailing_checkToken(); acymailing_checkRobots(); $config = acymailing_config(); $subscriberClass = acymailing_get('class.subscriber'); $subscriberClass->geolocRight = true; $subscriberClass->extendedEmailVerif = true; $status = $subscriberClass->saveForm(); $subscriberClass->sendNotification(); if($status){ if($subscriberClass->confirmationSent){ if($config->get('subscription_message', 1) && strlen(acymailing_translation('CONFIRMATION_SENT')) > 0) acymailing_enqueueMessage(acymailing_translation('CONFIRMATION_SENT'), 'message'); $redirectlink = $config->get('sub_redirect'); }elseif($subscriberClass->newUser){ if($config->get('subscription_message', 1) && strlen(acymailing_translation('SUBSCRIPTION_OK')) > 0) acymailing_enqueueMessage(acymailing_translation('SUBSCRIPTION_OK'), 'message'); $redirectlink = $config->get('sub_redirect'); }else{ if(strlen(acymailing_translation('SUBSCRIPTION_UPDATE_OK')) > 0) acymailing_enqueueMessage(acymailing_translation('SUBSCRIPTION_UPDATED_OK'), 'message'); $redirectlink = $config->get('modif_redirect'); } }elseif($subscriberClass->requireId){ if(strlen(acymailing_translation('IDENTIFICATION_SENT')) > 0) acymailing_enqueueMessage(acymailing_translation('IDENTIFICATION_SENT'), 'notice'); }else{ if(strlen(acymailing_translation('ERROR_SAVING')) > 0) acymailing_enqueueMessage(acymailing_translation('ERROR_SAVING'), 'error'); } if(!empty($redirectlink)){ if($config->get('redirect_tags', false)) { $user = $subscriberClass->identify(true); if(!empty($user->subid)) { $replace = array(); foreach ($user as $key => $val) { if(!is_array($val) && !is_object($val)) $replace['{' . $key . '}'] = $val; } $redirectlink = str_replace(array_keys($replace), $replace, $redirectlink); } } acymailing_redirect($redirectlink); return; } if($subscriberClass->identify(true)) return $this->modify(); return $this->subscribe(); } } home/wuectly/www/plugins/fields/user/tmpl/user.php 0000604 00000001230 15245573375 0016374 0 ustar 00 <?php /** * @package Joomla.Plugin * @subpackage Fields.User * * @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org> * @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/wuectly/www/plugins/fields/user/user.php 0000604 00000002004 15245603124 0015402 0 ustar 00 <?php /** * @package Joomla.Plugin * @subpackage Fields.User * * @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org> * @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/wuectly/www/libraries/joomla/facebook/user.php 0000604 00000116370 15245616750 0016530 0 ustar 00 <?php /** * @package Joomla.Platform * @subpackage Facebook * * @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org> * @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/wuectly/www/layouts/joomla/form/field/user.php 0000604 00000007254 15245617210 0016521 0 ustar 00 <?php /** * @package Joomla.Site * @subpackage Layout * * @copyright (C) 2015 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; use Joomla\Utilities\ArrayHelper; extract($displayData); /** * Layout variables * ----------------- * @var string $autocomplete Autocomplete attribute for the field. * @var boolean $autofocus Is autofocus enabled? * @var string $class Classes for the input. * @var string $description Description of the field. * @var boolean $disabled Is this field disabled? * @var string $group Group the field belongs to. <fields> section in form XML. * @var boolean $hidden Is this field hidden in the form? * @var string $hint Placeholder for the field. * @var string $id DOM id of the field. * @var string $label Label of the field. * @var string $labelclass Classes to apply to the label. * @var boolean $multiple Does this field support multiple values? * @var string $name Name of the input field. * @var string $onchange Onchange attribute for the field. * @var string $onclick Onclick attribute for the field. * @var string $pattern Pattern (Reg Ex) of value of the form field. * @var boolean $readonly Is this field read only? * @var boolean $repeat Allows extensions to duplicate elements. * @var boolean $required Is this field required? * @var integer $size Size attribute of the input. * @var boolean $spellcheck Spellcheck state for the form field. * @var string $validate Validation rules to apply. * @var string $value Value attribute of the field. * * @var string $userName The user name * @var mixed $groups The filtering groups (null means no filtering) * @var mixed $excluded The users to exclude from the list of users */ if (!$readonly) { JHtml::_('behavior.modal', 'a.modal_' . $id); JHtml::_('script', 'jui/fielduser.min.js', array('version' => 'auto', 'relative' => true)); } $uri = new JUri('index.php?option=com_users&view=users&layout=modal&tmpl=component&required=0'); $uri->setVar('field', $this->escape($id)); if ($required) { $uri->setVar('required', 1); } if (!empty($groups)) { $uri->setVar('groups', base64_encode(json_encode($groups))); } if (!empty($excluded)) { $uri->setVar('excluded', base64_encode(json_encode($excluded))); } // Invalidate the input value if no user selected if ($this->escape($userName) === JText::_('JLIB_FORM_SELECT_USER')) { $userName = ''; } $inputAttributes = array( 'type' => 'text', 'id' => $id, 'value' => $this->escape($userName) ); if ($size) { $inputAttributes['size'] = (int) $size; } if ($required) { $inputAttributes['required'] = 'required'; } if (!$readonly) { $inputAttributes['placeholder'] = JText::_('JLIB_FORM_SELECT_USER'); } $anchorAttributes = array( 'class' => 'btn btn-primary modal_' . $id, 'title' => JText::_('JLIB_FORM_CHANGE_USER'), 'rel' => '{handler: \'iframe\', size: {x: 800, y: 500}}' ); ?> <div class="input-append"> <input <?php echo ArrayHelper::toString($inputAttributes); ?> readonly /> <?php if (!$readonly) : ?> <?php echo JHtml::_('link', (string) $uri, '<span class="icon-user"></span>', $anchorAttributes); ?> <?php endif; ?> </div> <?php if (!$readonly) : ?> <input type="hidden" id="<?php echo $id; ?>_id" name="<?php echo $name; ?>" value="<?php echo (int) $value; ?>" data-onchange="<?php echo $this->escape($onchange); ?>" /> <?php endif; ?>