| Current Path : /proc/thread-self/root/proc/self/root/tmp/ |
| Current File : //proc/thread-self/root/proc/self/root/tmp/phpxVfcED |
home/digilove/public_html/modules/mod_seller_banner/helper.php 0000644 00000001416 15232603610 0020712 0 ustar 00 <?php
/**
* Marketplace Menus module
*
* PHP version 7.0
*
* @category Module
* @package Joomla
* @author WebKul software private limited <support@webkul.com>
* @copyright 2010 WebKul software private limited
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
* @version GIT:5.2
* @filesource http://store.webkul.com
* @link Technical Support: webkul.uvdesk.com
*/
// no direct access
defined('_JEXEC') or die();
/**
* SellerBannerHelper - Mp Seller Banner Helper Class.
*
* @category Module
* @package Joomla
* @author WebKul software private limited <support@webkul.com>
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
* @link Technical Support: webkul.uvdesk.com
*/
class ModSellerBannerHelper
{
} home/digilove/public_html/modules/mod_feed/helper.php 0000644 00000001611 15234437754 0017017 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage mod_feed
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Helper for mod_feed
*
* @since 1.5
*/
class ModFeedHelper
{
/**
* Retrieve feed information
*
* @param \Joomla\Registry\Registry $params module parameters
*
* @return JFeedReader|string
*/
public static function getFeed($params)
{
// Module params
$rssurl = $params->get('rssurl', '');
// Get RSS parsed object
try
{
$feed = new JFeedFactory;
$rssDoc = $feed->getFeed($rssurl);
}
catch (Exception $e)
{
return JText::_('MOD_FEED_ERR_FEED_NOT_RETRIEVED');
}
if (empty($rssDoc))
{
return JText::_('MOD_FEED_ERR_FEED_NOT_RETRIEVED');
}
if ($rssDoc)
{
return $rssDoc;
}
}
}
home/digilove/public_html/administrator/includes/helper.php 0000644 00000001737 15234461446 0020277 0 ustar 00 <?php
/**
* @package Joomla.Administrator
*
* @copyright (C) 2007 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Joomla! Administrator Application helper class.
* Provide many supporting API functions.
*
* @since 1.5
*
* @deprecated 4.0 Deprecated without replacement
*/
class JAdministratorHelper
{
/**
* Return the application option string [main component].
*
* @return string The component to access.
*
* @since 1.5
*/
public static function findOption()
{
$app = JFactory::getApplication();
$option = strtolower($app->input->get('option'));
$app->loadIdentity();
$user = $app->getIdentity();
if ($user->get('guest') || !$user->authorise('core.login.admin'))
{
$option = 'com_login';
}
if (empty($option))
{
$option = 'com_cpanel';
}
$app->input->set('option', $option);
return $option;
}
}
home/digilove/public_html/modules/mod_related_items/helper.php 0000644 00000010267 15234516720 0020733 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage mod_related_items
*
* @copyright (C) 2006 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::register('ContentHelperRoute', JPATH_SITE . '/components/com_content/helpers/route.php');
/**
* Helper for mod_related_items
*
* @since 1.5
*/
abstract class ModRelatedItemsHelper
{
/**
* Get a list of related articles
*
* @param \Joomla\Registry\Registry &$params module parameters
*
* @return array
*/
public static function getList(&$params)
{
$db = JFactory::getDbo();
$app = JFactory::getApplication();
$user = JFactory::getUser();
$groups = implode(',', $user->getAuthorisedViewLevels());
$date = JFactory::getDate();
$maximum = (int) $params->get('maximum', 5);
// Get an instance of the generic articles model
JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_content/models');
$articles = JModelLegacy::getInstance('Articles', 'ContentModel', array('ignore_request' => true));
if ($articles === false)
{
JFactory::getApplication()->enqueueMessage(JText::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error');
return array();
}
// Set application parameters in model
$appParams = $app->getParams();
$articles->setState('params', $appParams);
$option = $app->input->get('option');
$view = $app->input->get('view');
if (!($option === 'com_content' && $view === 'article'))
{
return array();
}
$temp = $app->input->getString('id');
$temp = explode(':', $temp);
$id = $temp[0];
$nullDate = $db->getNullDate();
$now = $date->toSql();
$related = array();
$query = $db->getQuery(true);
if ($id)
{
// Select the meta keywords from the item
$query->select('metakey')
->from('#__content')
->where('id = ' . (int) $id);
$db->setQuery($query);
try
{
$metakey = trim($db->loadResult());
}
catch (RuntimeException $e)
{
JFactory::getApplication()->enqueueMessage(JText::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error');
return array();
}
// Explode the meta keys on a comma
$keys = explode(',', $metakey);
$likes = array();
// Assemble any non-blank word(s)
foreach ($keys as $key)
{
$key = trim($key);
if ($key)
{
$likes[] = $db->escape($key);
}
}
if (count($likes))
{
// Select other items based on the metakey field 'like' the keys found
$query->clear()
->select('a.id')
->from('#__content AS a')
->where('a.id != ' . (int) $id)
->where('a.state = 1')
->where('a.access IN (' . $groups . ')');
$wheres = array();
foreach ($likes as $keyword)
{
$wheres[] = 'a.metakey LIKE ' . $db->quote('%' . $keyword . '%');
}
$query->where('(' . implode(' OR ', $wheres) . ')')
->where('(a.publish_up = ' . $db->quote($nullDate) . ' OR a.publish_up <= ' . $db->quote($now) . ')')
->where('(a.publish_down = ' . $db->quote($nullDate) . ' OR a.publish_down >= ' . $db->quote($now) . ')');
// Filter by language
if (JLanguageMultilang::isEnabled())
{
$query->where('a.language in (' . $db->quote(JFactory::getLanguage()->getTag()) . ',' . $db->quote('*') . ')');
}
$db->setQuery($query, 0, $maximum);
try
{
$articleIds = $db->loadColumn();
}
catch (RuntimeException $e)
{
JFactory::getApplication()->enqueueMessage(JText::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error');
return array();
}
if (count($articleIds))
{
$articles->setState('filter.article_id', $articleIds);
$articles->setState('filter.published', 1);
$related = $articles->getItems();
}
unset($articleIds);
}
}
if (count($related))
{
// Prepare data for display using display options
foreach ($related as &$item)
{
$item->slug = $item->id . ':' . $item->alias;
/** @deprecated Catslug is deprecated, use catid instead. 4.0 */
$item->catslug = $item->catid . ':' . $item->category_alias;
$item->route = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language));
}
}
return $related;
}
}
home/digilove/public_html/modules/mod_marketplacemenus/helper.php 0000644 00000012225 15234531604 0021444 0 ustar 00 <?php
/**
* Marketplace Menus module
*
* PHP version 7.0
*
* @category Module
* @package Joomla
* @author WebKul software private limited <support@webkul.com>
* @copyright 2010 WebKul software private limited
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
* @version GIT:5.2
* @filesource http://store.webkul.com
* @link Technical Support: webkul.uvdesk.com
*/
// no direct access
defined('_JEXEC') or die();
/**
* ModSocLoginHelper class
*
* @category Module
* @package Joomla
* @author WebKul software private limited <support@webkul.com>
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
* @link Technical Support: webkul.uvdesk.com
*/
class ModMpMenuHelper
{
/**
* CheckAndStoreUser function
*
* @param array $user var
*
* @return void
*/
function checkAndStoreUser($user = array())
{
$chk_user = $this->_checkUser($user['email']);
if (!$chk_user) {
$this->_registerUser($user);
$chk_user = $this->_checkUser($user['email']);
}
// Login user
$result = $this->_forceLogin($chk_user);
$juri = JUri::getInstance();
/* $url = $juri->root();
JFactory::getApplication()->redirect($url); */
}
/**
* Check User exists using email function
*
* @param string $email var
*
* @return void
*/
private function _checkUser($email="")
{
$db=JFactory::getDbo();
$query=$db->getQuery(true);
$query->select("id")->from($db->quoteName("#__users"))->where(
$db->QuoteName("email")."=".$db->quote($email)
);
$db->setQuery($query);
$result = $db->loadObject();
if (isset($result->id)) {
return $result->id;
}
return 0;
}
/**
* Register User function
*
* @param array $user var
*
* @return void
*/
private function _registerUser($user = array())
{
JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_users/models/');
$model = JModelLegacy::getInstance('Registration', 'UsersModel');
$user["username"] = substr($user['name'], 0, strpos($user['name'], ' '));
if (empty($user["username"])) {
$user["username"] = $user['name'];
}
$username = $user["username"];
$match_found = true;
$i=0;
$db= JFactory::getDbo();
while ($match_found) {
$query = $db->getQuery(true);
$query->select($db->quoteName("email"))
->from($db->quoteName("#__users"))
->where($db->quoteName("username")."=".$db->quote($username));
$db->setQuery($query);
try {
$res_match_user = $db->loadObject();
} catch (Exception $e) {
$match_found= true;
}
if (isset($res_match_user) && $res_match_user->email !== $user["email"]) {
$username=$username.(++$i);
$match_found= true;
} else {
$match_found= false;
}
}
$user["username"] = $username;
$user["password"] = $this->randomPassword();
$lang = JFactory::getLanguage();
$extension = 'com_users';
$base_dir = JPATH_SITE;
$lang->load($extension, $base_dir);
$data=array(
"name" => $user["name"],
"username" => strtolower($user["username"]),
"password1" => $user["password"],
"password2" => $user["password"],
"email1" => $user["email"],
"email2" => $user["email"]
);
$res=$model->register($data);
return $res;
}
/**
* Random Password function
*
* @param integer $length Password length
*
* @return void
*/
function randomPassword($length = 8)
{
$alphabet = 'abcdefghijklmnopqrstuvwxyzAB'.
'CDEFGHIJKLMNOPQRSTUVWXYZ1234567890+-*/|{}[]()%^&#@!~';
$pass = array();
$alphaLength = strlen($alphabet) - 1;
for ($i = 0; $i < $length; $i++) {
$n = rand(0, $alphaLength);
$pass[] = $alphabet[$n];
}
return str_shuffle(implode($pass));
}
/**
* Force Login function
*
* @param [type] $userId var
*
* @return Mixed
*/
private function _forceLogin($userId)
{
$user = JFactory::getUser($userId);
if ($user->guest) {
return 'guest';
} else {
//Will authorize you as this user.
JPluginHelper::importPlugin('user');
$options = array();
$options['action'] = 'core.login.site';
$response = new stdClass();
$response->username = $user->username;
$response->language = '';
$response->email = $user->email;
$response->password_clear = '';
$response->fullname = '';
$result = JFactory::getApplication()->triggerEvent(
'onUserLogin', array((array)$response, $options)
);
return $result;
}
}
}