1
Sicurezza / Re:[RISOLTO] Sicurezza file php/wrapper
« il: 03 Mag 2012, 12:34:51 »
Ho risolto con il seguente codice:
define( '_JEXEC', 1 );
define( '_VALID_MOS', 1 );
define( 'JPATH_BASE', realpath(dirname(__FILE__) .'/..' ) );// indicare /.. nel caso il file si trovi in una cartella
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');
$mainframe->initialise();
$user =& JFactory::getUser();
// RECUPERO lo username dell'utente e inizializzo la variabile $utente
$utente = $user->username;//
if ($utente){
...mio codice...
}
else
echo 'ACCESSO NEGATO';
define( '_JEXEC', 1 );
define( '_VALID_MOS', 1 );
define( 'JPATH_BASE', realpath(dirname(__FILE__) .'/..' ) );// indicare /.. nel caso il file si trovi in una cartella
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');
$mainframe->initialise();
$user =& JFactory::getUser();
// RECUPERO lo username dell'utente e inizializzo la variabile $utente
$utente = $user->username;//
if ($utente){
...mio codice...
}
else
echo 'ACCESSO NEGATO';