2015-04-01 15:35:27 +00:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
* Sakura C/PMS
|
|
|
|
* (c)Flashwave/Flashii.net 2013-2015 <http://flash.moe>
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Declare namespace
|
|
|
|
namespace Sakura;
|
|
|
|
|
|
|
|
// Define Sakura version
|
2015-05-09 00:56:55 +00:00
|
|
|
define('SAKURA_VERSION', '20150508');
|
|
|
|
define('SAKURA_VLABEL', 'Eminence');
|
2015-04-26 16:01:28 +00:00
|
|
|
define('SAKURA_VTYPE', 'Development');
|
2015-05-09 00:56:55 +00:00
|
|
|
define('SAKURA_COLOUR', '#6C3082');
|
2015-04-01 15:35:27 +00:00
|
|
|
|
|
|
|
// Define Sakura Path
|
2015-04-06 16:15:20 +00:00
|
|
|
define('ROOT', str_replace(basename(__DIR__), '', dirname(__FILE__)));
|
2015-04-01 15:35:27 +00:00
|
|
|
|
|
|
|
// Error Reporting: 0 for production and -1 for testing
|
|
|
|
error_reporting(-1);
|
|
|
|
ini_set('log_errors', 1);
|
|
|
|
ini_set('error_log', ROOT .'errors.log');
|
|
|
|
|
2015-04-02 13:29:30 +00:00
|
|
|
// Start output buffering
|
|
|
|
ob_start();
|
2015-04-01 15:35:27 +00:00
|
|
|
|
|
|
|
// Include Configuration
|
|
|
|
require_once ROOT .'_sakura/config/config.php';
|
|
|
|
|
|
|
|
// Include libraries
|
|
|
|
require_once ROOT .'_sakura/vendor/autoload.php';
|
|
|
|
require_once ROOT .'_sakura/components/Main.php';
|
|
|
|
require_once ROOT .'_sakura/components/Hashing.php';
|
|
|
|
require_once ROOT .'_sakura/components/Configuration.php';
|
|
|
|
require_once ROOT .'_sakura/components/Templates.php';
|
|
|
|
require_once ROOT .'_sakura/components/Sessions.php';
|
|
|
|
require_once ROOT .'_sakura/components/Users.php';
|
2015-05-03 16:25:57 +00:00
|
|
|
require_once ROOT .'_sakura/components/Forum.php';
|
2015-04-30 23:01:01 +00:00
|
|
|
require_once ROOT .'_sakura/components/Manage.php';
|
2015-04-18 18:26:52 +00:00
|
|
|
require_once ROOT .'_sakura/components/Whois.php';
|
2015-04-28 15:53:53 +00:00
|
|
|
require_once ROOT .'_sakura/components/SockChat.php';
|
2015-04-01 15:35:27 +00:00
|
|
|
|
|
|
|
// Generate path to database driver
|
|
|
|
$_DBNGNPATH = ROOT .'_sakura/components/database/'. $sakuraConf['db']['driver'] .'.php';
|
|
|
|
|
|
|
|
// Include database driver
|
|
|
|
if(file_exists($_DBNGNPATH))
|
|
|
|
require_once $_DBNGNPATH;
|
|
|
|
else
|
|
|
|
die('<h1>Failed to load database driver.</h1>');
|
|
|
|
|
|
|
|
// Set Error handler
|
2015-04-30 23:01:01 +00:00
|
|
|
set_error_handler(array('Sakura\Main', 'errorHandler'));
|
2015-04-01 15:35:27 +00:00
|
|
|
|
|
|
|
// Initialise Flashii Class
|
|
|
|
Main::init($sakuraConf);
|
|
|
|
|
|
|
|
// Set base page rendering data
|
|
|
|
$renderData = array(
|
|
|
|
'sakura' => [
|
2015-04-06 21:23:54 +00:00
|
|
|
'version' => SAKURA_VERSION,
|
2015-04-30 23:01:01 +00:00
|
|
|
'vlabel' => SAKURA_VLABEL,
|
|
|
|
'vtype' => SAKURA_VTYPE,
|
|
|
|
'vcolour' => SAKURA_COLOUR,
|
2015-04-06 21:23:54 +00:00
|
|
|
'urls' => Configuration::getLocalConfig('urls'),
|
|
|
|
'charset' => Configuration::getConfig('charset'),
|
2015-04-17 22:51:53 +00:00
|
|
|
'currentpage' => '//'. $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'],
|
2015-04-13 10:14:59 +00:00
|
|
|
'recaptcha_public' => Configuration::getConfig('recaptcha_public'),
|
2015-04-20 19:39:49 +00:00
|
|
|
'recaptcha_enable' => Configuration::getConfig('recaptcha'),
|
|
|
|
'resources' => '//'. Configuration::getLocalConfig('urls')['content'] .'/data/'. strtolower(Templates::$_TPL),
|
|
|
|
'disableregister' => Configuration::getConfig('disable_registration'),
|
2015-04-24 19:31:09 +00:00
|
|
|
'lockauth' => Configuration::getConfig('lock_authentication'),
|
2015-04-20 19:39:49 +00:00
|
|
|
'requireregcodes' => Configuration::getConfig('require_registration_code'),
|
|
|
|
'requireactiveate' => Configuration::getConfig('require_activation'),
|
2015-05-09 00:56:55 +00:00
|
|
|
'sitename' => Configuration::getConfig('sitename'),
|
|
|
|
'cookieprefix' => Configuration::getConfig('cookie_prefix'),
|
|
|
|
'cookiedomain' => Configuration::getConfig('cookie_domain'),
|
|
|
|
'cookiepath' => Configuration::getConfig('cookie_path')
|
2015-04-01 15:35:27 +00:00
|
|
|
],
|
|
|
|
'php' => [
|
|
|
|
'sessionid' => \session_id(),
|
2015-04-20 19:39:49 +00:00
|
|
|
'time' => \time(),
|
|
|
|
'self' => $_SERVER['PHP_SELF']
|
2015-04-01 15:35:27 +00:00
|
|
|
],
|
|
|
|
'user' => [
|
2015-04-18 11:35:16 +00:00
|
|
|
'checklogin' => Users::checkLogin(),
|
|
|
|
'session' => Session::$sessionId,
|
|
|
|
'data' => ($_init_udata = Users::getUser(Session::$userId)),
|
2015-04-25 20:08:44 +00:00
|
|
|
'rank' => ($_init_rdata = Users::getRank($_init_udata['rank_main'])),
|
|
|
|
'colour' => ($_init_udata['name_colour'] == null ? $_init_rdata['colour'] : $_init_udata['name_colour'])
|
2015-04-01 15:35:27 +00:00
|
|
|
]
|
|
|
|
);
|