Проверка на авторизацию Joomla3

More
9 years 11 months ago #5268 by Дмитрий Малыш
Здравствуйте.
При проверке на авторизацию пользователя:
$user = JFactory::getUser();
if ($user->guest)
echo "true";
else
echo "false";
всегда выдает true, хотя захожу под зарегистрированным пользователем.
В чем может быть проблема?

Please Log in to join the conversation.

More
9 years 11 months ago #5269 by Дмитрий Малыш
Разобрался.
Не хватало следующего кода:
<?php define('_JEXEC', 1);
define('DS', DIRECTORY_SEPARATOR);

if (file_exists(dirname(__FILE__) . '/defines.php')) {
include_once dirname(__FILE__) . '/defines.php';
}

if (!defined('_JDEFINES')) {
define('JPATH_BASE', dirname(__FILE__));
require_once JPATH_BASE.'/includes/defines.php';
}

require_once JPATH_BASE.'/includes/framework.php';
$app = JFactory::getApplication('site');
$app->execute();
?>

Please Log in to join the conversation.

More
9 years 11 months ago #5273 by JoomLine
К какому нашему расширению это относится?

Please Log in to join the conversation.

Powered by Kunena Forum

Last from the forum

    • Карта сайта для компонента JoomMedia
    • Здравствуйте. Уже 2 года не могу создать карту сайта для компонента JoomMedia, который покупал: 1. В компоненте JSitemap нет такого источника данных, а сам не могу создать SQL запрос карты сайта для JoomMedia 2. В компоненте JL Sitemap нет плагина JoomMedia. Сможете помочь по любому из 2-х пунктов, могу оплатит расходы, компонент JoomMedia находится по ссылке drive.google.com/file/d/1xg4oQzcmYhJ1NGP...sw2/view?usp=sharing Компонент в работе: 4in.ru/sport.html  
    • In Component / JL Sitemap
    • чет не работает
    • You may have heard about the for a while now, but you still don't dare to visit them. It is time for you to lose your fear of these prostitute websites. Take your mobile phone, and visit it now. The escorts are local prostitutes you can access for a minimum amount.
    • In Component / Yandex Market XML
© 2010- JoomLine
The Joomla!® name is used under a limited license from Open Source Matters in the United States and other countries. joomline.net is not affiliated with or endorsed by Open Source Matters or the Joomla! Project.

email: This email address is being protected from spambots. You need JavaScript enabled to view it.