$db_config holds the database connection info for the installer
- Code: Select all
/**
* Update admin account
*/
include(ROSTER_BASE . 'conf.php');
define('ROSTER_DB_DIR', ROSTER_LIB . 'dbal' . DIR_SEP);
switch( $db_config['dbtype'] )
{
case 'mysql':
include_once(ROSTER_DB_DIR . 'mysql.php');
break;
default:
include_once(ROSTER_DB_DIR . 'mysql.php');
break;
}
$db = new roster_db($db_config['host'], $db_config['database'], $db_config['username'], $db_config['password'], $db_config['table_prefix']);
$db->log_level();
$db->error_die();
if( !is_resource($db->link_id) )
{
$tpl->message_die('Failed to connect to database <strong>' . $db_config['database'] . '</strong> as <strong>' . $db_config['username'] . '@' . $db_config['host'] . '</strong><br /><br /><a href="index.php">Restart Installation</a>');
}
This section of the installer includes the created conf.php file, which holds the database connection info
If I were you, I would create a new installer made specifically to work within phpnuke and not use the Roster installer
The sql setup files are in lib/dbal/structure
mysql_structure.sql is the database table structure
mysql_data.sql is the initial data that is entered into the database
The installer also sets some specific db values as well
- Code: Select all
$db->query("UPDATE `" . $db->table('config') . "` SET `config_value` = '$default_locale' WHERE `config_name` = 'locale';");
$db->query("UPDATE `" . $db->table('config') . "` SET `config_value` = '" . ROSTER_VERSION . "' WHERE `config_name` = 'version';");
$db->query("UPDATE `" . $db->table('config') . "` SET `config_value` = '$server_name' WHERE `config_name` = 'website_address';");
The config table, setting the following rows
locale - One of these are valid: enUS, deDE, frFR, esES
version - The current Roster version, as of this post 2.0.2
website_address - the main url for your site, the logo at the top links to this and some addons might use it as well, I know that SigGen does
Then it updates the account table with 3 users and a password
- Code: Select all
$db->query("INSERT INTO `" . $db->table('account') . "` (`account_id`, `name`) VALUES
(1, 'Guild'),
(2, 'Officer'),
(3, 'Admin');");
$db->query("UPDATE `" . $db->table('account') . "` SET `hash` = '" . $pass_word . "';");
the installer then logs you into RosterCP and directs you to a first time install routine (admin/install_guide.php), which sets up one upload rules and directs you to the addon installer page