Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Authentication joomla:身份验证_Authentication_Joomla - Fatal编程技术网

Authentication joomla:身份验证

Authentication joomla:身份验证,authentication,joomla,Authentication,Joomla,我在joomla目录中创建了一个文件夹。在这个文件夹里我有一些文件 我想使用URL按名称通过直接访问对这些文件进行身份验证 如何实现它?我不确定这是否是最好的方法,但您可以创建一个包含以下内容的PHP脚本(我们称之为joomla auth.PHP): <?php define( '_JEXEC', 1 ); define('JPATH_BASE', dirname(__FILE__)); define( 'DS', DIRECTORY_SEPARATOR ); require_once

我在joomla目录中创建了一个文件夹。在这个文件夹里我有一些文件

我想使用URL按名称通过直接访问对这些文件进行身份验证


如何实现它?

我不确定这是否是最好的方法,但您可以创建一个包含以下内容的PHP脚本(我们称之为
joomla auth.PHP
):

<?php

define( '_JEXEC', 1 );
define('JPATH_BASE', dirname(__FILE__));
define( 'DS', DIRECTORY_SEPARATOR );
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );

$mainframe =& JFactory::getApplication('site');

if (JFactory::getUser()->id == 0)
   die("Access denied: login required.");

?>

您可以使用.htaccess:看看这个:
<?php
include 'joomla-auth.php';
?>
{jumi myfile.html}{/jumi}