J'ai ce script :
include "../../mainfile.php";
include XOOPS_ROOT_PATH."/include/cp_functions.php";
if ( file_exists(XOOPS_ROOT_PATH."/modules/tinyurl/language/".$xoopsConfig['language']."/admin.php") ) {
include XOOPS_ROOT_PATH."/modules/tinyurl/language/".$xoopsConfig['language']."/admin.php";
} else {
include XOOPS_ROOT_PATH."/modules/tinyurl/language/english/admin.php";
}
// Nom des tables
$table_url = $xoopsDB -> prefix( "tinyurl_liste_url_courtes" ) ;
$table_options = $xoopsDB -> prefix( "tinyurl_options" ) ;
# Traitement de la redirection si elle existe
if( isSet( $_GET[ 'p' ] ) )
{
if( is_numeric( $_GET[ 'p' ] ) )
{
$requeteSelectionUrlRedirection = "
SELECT `url_longue`
FROM `$table_url`
WHERE
`identifiant_url` = ${_GET[ 'p' ]}
" ;
$url_redirection = $xoopsDB -> query( $requeteSelectionUrlRedirection ) ;
$url_redirection = $xoopsDB -> fetchArray( $url_redirection ) ;
$url_redirection = $url_redirection[ 'url_longue' ] ;
echo "
<iframe " .
"src = 'include/frame.php' " .
"scrolling = 'yes' " .
"width = '100%' " .
"height = '15%' " .
"marginwidth = '0' " .
"marginheight = '0' " .
"hspace = '0' " .
"vspace = '0' " .
"frameborder = '0' > " .
"</iframe>" ;
echo "
<iframe " .
"src = 'http://$url_redirection' " .
"scrolling = 'yes' " .
"width = '100%' " .
"height = '85%' " .
"marginwidth = '0' " .
"marginheight = '0' " .
"hspace = '0' " .
"vspace = '0' " .
"frameborder = '0' > " .
"</iframe>" ;
exit ;
}
}
Le problème est que ce script peut être appelé SANS que l'utilisateur soit connecté. Mais apparemment, il y a dans le mainfile quelque chose qui empêche d'exécuter le script sans être connecté.
Moi, je voudrais que ce soit possible.
Est-ce plus clair ?