first commit
This commit is contained in:
74
admin/index.php
Normal file
74
admin/index.php
Normal file
@@ -0,0 +1,74 @@
|
||||
<?
|
||||
if ( get_magic_quotes_gpc() )
|
||||
{
|
||||
function stripslashes_deep( $value )
|
||||
{
|
||||
$value = is_array( $value ) ? array_map( 'stripslashes_deep', $value ) : stripslashes( $value );
|
||||
return $value;
|
||||
}
|
||||
$_POST = array_map( 'stripslashes_deep', $_POST );
|
||||
$_GET = array_map( 'stripslashes_deep', $_GET );
|
||||
}
|
||||
|
||||
function __autoload_my_classes( $classname )
|
||||
{
|
||||
$q = explode( '\\' , $classname );
|
||||
$c = array_pop( $q );
|
||||
$f = '../autoload/' . implode( '/' , $q ) . '/class.' . $c . '.php';
|
||||
if ( $c == 'Savant3' )
|
||||
{
|
||||
require_once( '../autoload/Savant3.php' );
|
||||
return true;
|
||||
}
|
||||
if ( file_exists( $f ) )
|
||||
require_once( $f );
|
||||
}
|
||||
spl_autoload_register( '__autoload_my_classes' );
|
||||
|
||||
define( 'OPD_DIR' , '../autoload/' );
|
||||
require( OPD_DIR . 'opd.class.php' );
|
||||
if ( file_exists( '../files/config.php' ) )
|
||||
include '../files/config.php';
|
||||
else
|
||||
include '../config.php';
|
||||
date_default_timezone_set('Europe/Warsaw');
|
||||
|
||||
session_start();
|
||||
$db = opdClass::create(
|
||||
array(
|
||||
'dsn' => 'mysql:host=' . $database['host'] . ';dbname=' . $database['name'],
|
||||
'user' => $database['user'] ,
|
||||
'password' => $database['password'] ,
|
||||
'cache' => 'Temp/' ,
|
||||
'debugConsole' => false
|
||||
)
|
||||
);
|
||||
$db -> query('SET NAMES utf8');
|
||||
|
||||
$cache = new \FileCache;
|
||||
|
||||
if ( \System::formGet( 'del' ) == 'true' )
|
||||
{
|
||||
\System::deleteCacheAdmin();
|
||||
\System::deleteCache();
|
||||
session_destroy();
|
||||
echo '<script>document.location.href="./";</script>';
|
||||
}
|
||||
|
||||
$lang = \System::getSessionVar('lang' , true );
|
||||
if ( !$lang )
|
||||
{
|
||||
$lang = \language\FLanguage::loadLang();
|
||||
\System::setSessionVar( 'lang' , $lang , true );
|
||||
}
|
||||
|
||||
\admin\controls\Page::checkUrlParams();
|
||||
|
||||
$user = \System::getSessionVar( 'user' , true );
|
||||
if ( file_exists( '../resources/xajax/xajax_core/xajax.inc.php' ) )
|
||||
include( '../resources/xajax/xajax_core/xajax.inc.php' );
|
||||
|
||||
include( '../functions/xajax.php' );
|
||||
|
||||
echo \admin\view\Page::show();
|
||||
?>
|
||||
Reference in New Issue
Block a user