* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * * $Id$ */ // Load autloader require_once LIB_DIR . '/autoloader.php'; $_MAILDBTYPE = ConfigHelper::getConfig('database.mail_db_type'); $_MAILDBHOST = ConfigHelper::getConfig('database.mail_db_host'); $_MAILDBUSER = ConfigHelper::getConfig('database.mail_db_user'); $_MAILDBPASS = ConfigHelper::getConfig('database.mail_db_password'); $_MAILDBNAME = ConfigHelper::getConfig('database.mail_db_database'); // Initialize mail database $DB_MAIL = null; try { $DB_MAIL = LMSDB::getDB($_MAILDBTYPE, $_MAILDBHOST, $_MAILDBUSER, $_MAILDBPASS, $_MAILDBNAME); } catch (Exception $ex) { trigger_error($ex->getMessage(), E_USER_WARNING); // can't working without database die("Fatal error: cannot connect to database!\n"); } if (defined('USERPANEL_SETUPMODE')) { function module_setup() { global $SMARTY, $LMS; $SMARTY->assign('mail_limit', ConfigHelper::getConfig('userpanel.mail_limit')); $SMARTY->assign('mail_allowed_domains', ConfigHelper::getConfig('userpanel.mail_allowed_domains')); $SMARTY->display('module:accounts:setup.html'); } function module_submit_setup() {
define('MODULES_DIR', $CONFIG['directories']['modules_dir']); define('SMARTY_COMPILE_DIR', $CONFIG['directories']['smarty_compile_dir']); define('SMARTY_TEMPLATES_DIR', $CONFIG['directories']['smarty_templates_dir']); // Load autloader require_once LIB_DIR . '/autoloader.php'; // Load config defaults require_once LIB_DIR . '/config.php'; // Init database $_DBTYPE = $CONFIG['database']['type']; $_DBHOST = $CONFIG['database']['host']; $_DBUSER = $CONFIG['database']['user']; $_DBPASS = $CONFIG['database']['password']; $_DBNAME = $CONFIG['database']['database']; $DB = null; try { $DB = LMSDB::getDB($_DBTYPE, $_DBHOST, $_DBUSER, $_DBPASS, $_DBNAME); } catch (Exception $ex) { trigger_error($ex->getMessage(), E_USER_WARNING); // can't working without database die("Fatal error: cannot connect to database!\n"); } // Initialize templates engine $SMARTY = new Smarty(); $SESSION = NULL; // Include required files (including sequence is important) require_once LIB_DIR . '/language.php'; require_once LIB_DIR . '/common.php'; // Initialize LMS class $LMS = new LMS($DB, $SESSION); $LMS->ui_lang = $_ui_language; $LMS->lang = $_language;