Ho realizzato questo script che permette l'accesso diretto alla cartella images ai soli utenti registrati... E' un pò rudimentale e non credo faccia al caso tuo date le ultime considerazioni ma oramai l'ho fatto e lo posto, potrebbe esser d'aiuto ad altri. Il seguente codice va inserito nel file index.php, e questo file deve sostituire il file index.html contenuto nella cartella images.
<?php
define( '_JEXEC', 1 );
define('JPATH_BASE', '../' );
define( 'DS', DIRECTORY_SEPARATOR );
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
JDEBUG ? $_PROFILER->mark( 'afterLoad' ) : null;
$mainframe =& JFactory::getApplication('site');
$mainframe->initialise();
JPluginHelper::importPlugin('system');
JDEBUG ? $_PROFILER->mark('afterInitialise') : null;
$mainframe->triggerEvent('onAfterInitialise');
$user =& JFactory::getUser();
if ($user->guest) {
echo 'Accesso Negato';
} else {
$cartella="../images/";
chdir("./$cartella");
if(!($dp = opendir("./")))
die("Non riesco a esplorare il contenuto");
while($file = readdir($dp))
{
if(is_file($file))
$lista[] = $file;
}
if(!($dp = opendir("./")))
die("Non riesco a esplorare il contenuto");
while($file = readdir($dp))
{
if(!is_file($file))
$lista[] = $file;
}
sort($lista);
?>
<table border="1">
<tr>
<td>
<?
echo "Tipo file: ";
?>
</td>
<td>
<?
echo "Dimensione file KB: ";
?>
</td>
<td>
<?
echo "Nome: ";
?>
</td>
<td>
<?
echo "Data: ";
?>
</td>
</tr>
<tr>
<td>
<?
foreach($lista as $index => $nome)
{
echo "<div align=center>".filetype($nome)."<>";
}
?>
</td>
<td>
<?
foreach($lista as $index => $nome)
{
echo "<div align=center>".filesize($nome)."<>";
}
?>
</td>
<td>
<?
foreach($lista as $index => $nome)
{
?>
<a href="<? echo $cartella; echo $nome; ?>"><? echo $nome; ?></a><br>
<?
}
?>
</td>
<td>
<?
foreach($lista as $index => $nome)
{
echo date("F d Y H:i:s.", filectime($nome))."<br>";
}
?>
</td>
</tr>
</table>
<?php }
?>