// Do some checks and load config defaults require_once LIB_DIR . DIRECTORY_SEPARATOR . 'checkdirs.php'; require_once LIB_DIR . DIRECTORY_SEPARATOR . 'common.php'; // Init database $DB = null; try { $DB = LMSDB::getInstance(); } catch (Exception $ex) { trigger_error($ex->getMessage(), E_USER_WARNING); // can't working without database die("Fatal error: cannot connect to database!<BR>"); } // Call any of upgrade process before anything else $layout['dbschversion'] = $DB->UpgradeDb(); // Initialize templates engine (must be before locale settings) $SMARTY = new LMSSmarty(); // test for proper version of Smarty if (defined('Smarty::SMARTY_VERSION')) { $ver_chunks = preg_split('/[- ]/', preg_replace('/^smarty-/i', '', Smarty::SMARTY_VERSION), -1, PREG_SPLIT_NO_EMPTY); } else { $ver_chunks = NULL; } if (count($ver_chunks) < 1 || version_compare('3.1', $ver_chunks[0]) > 0) { die('<B>Wrong version of Smarty engine! We support only Smarty-3.x greater than 3.1.</B>'); } define('SMARTY_VERSION', $ver_chunks[0]); // add LMS's custom plugins directory $SMARTY->addPluginsDir(LIB_DIR . DIRECTORY_SEPARATOR . 'SmartyPlugins'); $SMARTY->setMergeCompiledIncludes(true); $SMARTY->setDefaultResourceType('extendsall'); // uncomment this line if you're not gonna change template files no more
require_once $composer_autoload_path; } else { die("Composer autoload not found. Run 'composer install' command from LMS directory and try again. More informations at https://getcomposer.org/"); } require_once USERPANEL_LIB_DIR . DIRECTORY_SEPARATOR . 'checkdirs.php'; // Initialize database $DB = null; try { $DB = LMSDB::getInstance(); } catch (Exception $ex) { trigger_error($ex->getMessage(), E_USER_WARNING); // can't working without database die("Fatal error: cannot connect to database!<BR>"); } // Initialize templates engine (must be before locale settings) $SMARTY = new LMSSmarty(); // test for proper version of Smarty if (constant('Smarty::SMARTY_VERSION')) { $ver_chunks = preg_split('/[- ]/', preg_replace('/^smarty-/i', '', Smarty::SMARTY_VERSION), -1, PREG_SPLIT_NO_EMPTY); } else { $ver_chunks = NULL; } if (count($ver_chunks) < 1 || version_compare('3.1', $ver_chunks[0]) > 0) { die('<B>Wrong version of Smarty engine! We support only Smarty-3.x greater than 3.0.</B>'); } define('SMARTY_VERSION', $ver_chunks[0]); // add LMS's custom plugins directory $SMARTY->addPluginsDir(LIB_DIR . DIRECTORY_SEPARATOR . 'SmartyPlugins'); // Redirect to SSL $_FORCE_SSL = ConfigHelper::checkConfig('userpanel.force_ssl', ConfigHelper::getConfig('phpui.force_ssl')); if ($_FORCE_SSL && $_SERVER['HTTPS'] != 'on') {
require_once LIB_DIR . DIRECTORY_SEPARATOR . 'checkdirs.php'; require_once LIB_DIR . DIRECTORY_SEPARATOR . 'config.php'; require_once LIB_DIR . DIRECTORY_SEPARATOR . 'common.php'; // Init database $DB = null; try { $DB = LMSDB::getInstance(); } catch (Exception $ex) { trigger_error($ex->getMessage(), E_USER_WARNING); // can't working without database die("Fatal error: cannot connect to database!<BR>"); } // Call any of upgrade process before anything else $layout['dbschversion'] = $DB->UpgradeDb(); // Initialize templates engine (must be before locale settings) $SMARTY = new LMSSmarty(); // test for proper version of Smarty if (defined('Smarty::SMARTY_VERSION')) { $ver_chunks = preg_split('/[- ]/', preg_replace('/^smarty-/i', '', Smarty::SMARTY_VERSION), -1, PREG_SPLIT_NO_EMPTY); } else { $ver_chunks = NULL; } if (count($ver_chunks) < 1 || version_compare('3.1', $ver_chunks[0]) > 0) { die('<B>Wrong version of Smarty engine! We support only Smarty-3.x greater than 3.1.</B>'); } define('SMARTY_VERSION', $ver_chunks[0]); // add LMS's custom plugins directory $SMARTY->addPluginsDir(LIB_DIR . DIRECTORY_SEPARATOR . 'SmartyPlugins'); $SMARTY->registerFilter('pre', array('Smarty_Prefilter_Extendsall_Include', 'prefilter_extendsall_include')); // uncomment this line if you're not gonna change template files no more //$SMARTY->compile_check = false;
} else { die("Composer autoload not found. Run 'composer install' command from LMS directory and try again. More informations at https://getcomposer.org/"); } // Init database $DB = null; try { $DB = LMSDB::getInstance(); } catch (Exception $ex) { trigger_error($ex->getMessage(), E_USER_WARNING); // can't working without database die("Fatal error: cannot connect to database!" . PHP_EOL); } $filetype = ConfigHelper::getConfig('invoices.type', ''); if ($filetype != 'pdf') { // Initialize templates engine (must be before locale settings) $SMARTY = new LMSSmarty(); // test for proper version of Smarty if (defined('Smarty::SMARTY_VERSION')) { $ver_chunks = preg_split('/[- ]/', preg_replace('/^smarty-/i', '', Smarty::SMARTY_VERSION), -1, PREG_SPLIT_NO_EMPTY); } else { $ver_chunks = NULL; } if (count($ver_chunks) < 1 || version_compare('3.1', $ver_chunks[0]) > 0) { die('Wrong version of Smarty engine! We support only Smarty-3.x greater than 3.1.' . PHP_EOL); } define('SMARTY_VERSION', $ver_chunks[0]); // add LMS's custom plugins directory $SMARTY->addPluginsDir(LIB_DIR . DIRECTORY_SEPARATOR . 'SmartyPlugins'); } // Include required files (including sequence is important) require_once LIB_DIR . DIRECTORY_SEPARATOR . 'language.php';
} else { die("Composer autoload not found. Run 'composer install' command from LMS directory and try again. More informations at https://getcomposer.org/" . PHP_EOL); } // Do some checks and load config defaults require_once LIB_DIR . DIRECTORY_SEPARATOR . 'common.php'; // Init database $DB = null; try { $DB = LMSDB::getInstance(); } catch (Exception $ex) { trigger_error($ex->getMessage(), E_USER_WARNING); // can't working without database die("Fatal error: cannot connect to database!" . PHP_EOL); } // Initialize templates engine (must be before locale settings) $SMARTY = new LMSSmarty(); // test for proper version of Smarty if (defined('Smarty::SMARTY_VERSION')) { $ver_chunks = preg_split('/[- ]/', preg_replace('/^smarty-/i', '', Smarty::SMARTY_VERSION), -1, PREG_SPLIT_NO_EMPTY); } else { $ver_chunks = NULL; } if (count($ver_chunks) < 1 || version_compare('3.1', $ver_chunks[0]) > 0) { die('<B>Wrong version of Smarty engine! We support only Smarty-3.x greater than 3.1.</B>'); } define('SMARTY_VERSION', $ver_chunks[0]); // add LMS's custom plugins directory $SMARTY->addPluginsDir(LIB_DIR . DIRECTORY_SEPARATOR . 'SmartyPlugins'); $SMARTY->setMergeCompiledIncludes(true); $SMARTY->setDefaultResourceType('extendsall'); // Include required files (including sequence is important)