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

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

Please Log in or Create an account to join the conversation.

More
9 years 5 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 or Create an account to join the conversation.

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

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum

Last from the forum

    • topbestbloggercenter
    • Lemon (Lin Fangjing), a popular member of Taiwan's Fubon Warriors, has extremely long legs and a proud figure. She recently shared on a program "Awkward moments that make girls want to find a hole to hide". She said that she once attended a post-party event. Because her performance costume was a two-piece sexy suit and the top was a cold-shoulder design, she changed into a NuBra to avoid exposing her bra straps and affecting the visual effect. Unexpectedly, while dancing, she accidentally caught a glimpse of something skin-colored on the ground. At the moment, she smiled and thought to herself, "It shouldn't be mine." But just in case, she checked when she turned around, and the result made her stunned instantly.
    • In Plugins Joomline / JL Like / JL Like PRO
    • newbloggingaboutanything
    • Lemon (Lin Fangjing), a popular member of Taiwan's Fubon Warriors, has extremely long legs and a proud figure. She recently shared on a program "Awkward moments that make girls want to find a hole to hide". She said that she once attended a post-party event. Because her performance costume was a two-piece sexy suit and the top was a cold-shoulder design, she changed into a NuBra to avoid exposing her bra straps and affecting the visual effect. Unexpectedly, while dancing, she accidentally caught a glimpse of something skin-colored on the ground. At the moment, she smiled and thought to herself, "It shouldn't be mine." But just in case, she checked when she turned around, and the result made her stunned instantly.  
    • In Component / Slogin
    • Fildena double 200 buy online in USA
    • You can online in the USA easily and discreetly through trusted platforms like Arrowmeds. Fildena Double 200 is a powerful erectile dysfunction (ED) medication containing 200mg of Sildenafil Citrate. It is ideal for men who need a higher dose to achieve a firm and lasting erection. Fildena Double 200 enhances blood flow to the penile area, improving sexual performance and satisfaction. offers genuine medicines at affordable prices with fast shipping and secure payment options. Always consult a healthcare provider before use to ensure safety and proper dosage for your specific health needs and conditions.
    • In Component / Slogin
© 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.