private static function installCoreClasses(Module_Admin $module) { require_once GWF_CORE_PATH . 'inc/install/GWF_InstallFunctions.php'; foreach (GWF_InstallFunctions::get_core_tables() as $classname) { if (false === GDO::table($classname)->createTable(false)) { return GWF_HTML::err('ERR_DATABASE', __FILE__, __LINE__); } } return ''; }
} else { GWF3::onLoadConfig(GWF_CONFIG_PATH); } require_once GWF_CORE_PATH . 'inc/install/GWF_InstallWizard.php'; require_once GWF_CORE_PATH . 'inc/install/GWF_InstallFunctions.php'; require_once GWF_CORE_PATH . 'inc/install/GWF_InstallConfig.php'; require_once GWF_CORE_PATH . 'inc/install/GWF_InstallWizardLanguage.php'; GWF_InstallWizardLanguage::init(); GWF_Log::init(false, true, GWF_PATH . '/protected/installlog'); $lang = new GWF_LangTrans(GWF_CORE_PATH . 'lang/install/install'); if (isset($write_a_config)) { GWF_InstallConfig::writeConfig($lang); echo 'I have written a default config to protected/config.php' . PHP_EOL; echo 'Please edit that config.php, before installing gwf3.' . PHP_EOL; die(0); } if (false === gdo_db()) { file_put_contents('php://stderr', 'Cannot connect to the database. Check your protected/config.php!' . PHP_EOL); die(1); } echo "Installing gwf util core..." . PHP_EOL; if (!GWF_InstallFunctions::core(false)) { file_put_contents('php://stderr', 'Cannot install core... giving up!'); die(2); } echo "Installing Language,Country,IP2Country..." . PHP_EOL; GWF_InstallFunctions::createLanguage(true, true, false); echo "Installing all modules..." . PHP_EOL; echo GWF_InstallFunctions::all_modules(false); echo "Thank you for trying GWF!" . PHP_EOL; die(0);
/** * Add admin */ public static function wizard_9_1() { $username = Common::getPostString('username', ''); if (!GWF_Validator::isValidUsername($username)) { return GWF_HTML::error('Install Wizard', 'Invalid username.', false) . self::wizard_8(); } $password = Common::getPostString('password', ''); if (!GWF_Validator::isValidPassword($password)) { return GWF_HTML::error('Install Wizard', 'Invalid password (minlength: 6).', false) . self::wizard_8(); } $email = Common::getPostString('email', ''); if (!GWF_Validator::isValidEmail($email)) { return GWF_HTML::error('Install Wizard', 'Invalid email.', false) . self::wizard_8(); } if (false === GWF_InstallFunctions::default_groups()) { return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__)); } $back = ''; if (false === GWF_InstallFunctions::createAdmin($username, $password, $email, $back)) { return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__)); } return $back . self::wizard_btn('9') . self::wizard_btn('10'); }
if (!class_exists('GDO')) { die('Please do not call directly.'); } if (isset($argv[4]) && $argv[4] === 'lamb_import') { require_once 'lamb_import.php'; } # Want a flush? $drop_tables = isset($argv[3]) && $argv[3] === 'flush'; ############################# ### Needed GWF/inc tables ### ############################# require_once GWF_CORE_PATH . 'inc/install/GWF_InstallFunctions.php'; GDO::table('GWF_Language')->createTable($drop_tables); GDO::table('GWF_Country')->createTable($drop_tables); GDO::table('GWF_LangMap')->createTable($drop_tables); GWF_InstallFunctions::createLanguage(true, true, false); # More util GDO::table('GWF_CachedCounter')->createTable($drop_tables); GDO::table('GWF_Counter')->createTable($drop_tables); GDO::table('GWF_Settings')->createTable($drop_tables); ################## # DOG GDO Tables # ################## $tables = array('Channel', 'Conf_Bot', 'Conf_Chan', 'Conf_Mod', 'Conf_Mod_Chan', 'Conf_Mod_Serv', 'Conf_Mod_User', 'Conf_Plug', 'Conf_Plug_Chan', 'Conf_Plug_Serv', 'Conf_Plug_User', 'Conf_User', 'Nick', 'PrivChannel', 'PrivServer', 'Server', 'User'); # Install Tables foreach ($tables as $table) { GDO::table("Dog_{$table}")->createTable($drop_tables); } # Install modules Dog_Init::installModules($drop_tables); # Want defaults?
GWF_ModuleLoader::loadModuleFS('Login')->onInclude(); $lf = GDO::table('GWF_LoginFailure'); GWF_ModuleLoader::renameColumn($lf, 'ip', 'logfail_ip'); GWF_ModuleLoader::renameColumn($lf, 'userid', 'logfail_uid'); GWF_ModuleLoader::renameColumn($lf, 'timestamp', 'logfail_time'); $lm = GDO::table('GWF_LangMap'); GWF_ModuleLoader::renameColumn($lm, 'countryid', 'langmap_cid'); GWF_ModuleLoader::renameColumn($lm, 'langid', 'langmap_lid'); # echo "Module_PM changed a lot ... <br/>\n"; if (false !== ($mod_pm = GWF_ModuleLoader::loadModuleFS('PM'))) { $mod_pm->onInclude(); require_once 'install23pm.php'; } echo "Module_Category changed a lot, but was unused.... reinstall wipe<br/>\n"; if (false !== ($mod_cat = GWF_ModuleLoader::loadModuleFS('Category'))) { GWF_ModuleLoader::installModule($mod_cat, true); } echo "Module Flags have changed<br/>\n"; GDO::table('GWF_Module')->update('module_options=module_options|2', 'module_options&4'); GDO::table('GWF_Module')->update('module_options=module_options-4', 'module_options&4'); echo "Register tokens<br/>\n"; GWF_Module::loadModuleDB('Register')->onInclude(); GDO::table('GWF_UserActivation')->createTable(true); echo "CORE: Counter<br/>\n"; $counter = GDO::table('GWF_Counter'); GWF_ModuleLoader::changeColumn($counter, 'key', 'count_key'); GWF_ModuleLoader::changeColumn($counter, 'value', 'count_value'); echo "Installing all modules... some might be gone.<br/>\n"; GWF_InstallFunctions::all_modules(); echo "WHOHO!<br/>\n";