Esempio n. 1
0
$action = Misc::findSubmitButton();
switch ($action) {
    case 'phpinfo':
        phpinfo();
        exit;
        break;
    case 'back':
        Debug::Text('Back', __FILE__, __LINE__, __METHOD__, 10);
        Redirect::Page(URLBuilder::getURL(NULL, 'install.php'));
        break;
    case 'next':
        Debug::Text('Next', __FILE__, __LINE__, __METHOD__, 10);
        if ($external_installer == 1) {
            Redirect::Page(URLBuilder::getURL(array('external_installer' => $external_installer), 'DatabaseSchema.php'));
        } else {
            Redirect::Page(URLBuilder::getURL(NULL, 'DatabaseConfig.php'));
        }
        break;
    default:
        break;
}
$handle = @fopen('http://www.timetrex.com/' . URLBuilder::getURL(array_merge(array('v' => $install_obj->getFullApplicationVersion(), 'page' => 'require'), $install_obj->getFailedRequirements()), 'pre_install.php'), "r");
@fclose($handle);
$check_all_requirements = $install_obj->checkAllRequirements();
if ($external_installer == 1 and $check_all_requirements == 0 and $install_obj->checkTimeTrexVersion() == 0) {
    //Using external installer and there is no missing requirements, automatically send to next page.
    Redirect::Page(URLBuilder::getURL(array('external_installer' => $external_installer, 'action:next' => 'next'), $_SERVER['SCRIPT_NAME']));
}
$smarty->assign_by_ref('install_obj', $install_obj);
$smarty->assign_by_ref('external_installer', $external_installer);
$smarty->display('install/Requirements.tpl');
Esempio n. 2
0
     $force = FALSE;
 }
 if ($force == TRUE) {
     echo "Force Mode enabled...\n";
     //Force installer_enabled to TRUE so we don't have to manually modify the config file with scripts.
     $config_vars['other']['installer_enabled'] = TRUE;
 }
 //Re-initialize install object with new config file.
 $install_obj = new Install();
 $install_obj->cleanCacheDirectory();
 if ($install_obj->isInstallMode() == FALSE) {
     echo "ERROR: Install mode is not enabled in the timetrex.ini.php file!\n";
     exit(1);
 } else {
     $check_all_requirements = $install_obj->checkAllRequirements(TRUE);
     if ($check_all_requirements == 0 and $install_obj->checkTimeTrexVersion() == 0) {
         $install_obj->setDatabaseConnection($db);
         //Default connection
         //Make sure at least one company exists in the database, this only works for upgrades, not initial installs.
         if ($install_obj->checkDatabaseExists($config_vars['database']['database_name']) == TRUE) {
             if ($install_obj->checkTableExists('company') == TRUE) {
                 //Table could be created, but check to make sure a company actually exists too.
                 $clf = TTnew('CompanyListFactory');
                 $clf->getAll();
                 if ($clf->getRecordCount() >= 1) {
                     $install_obj->setIsUpgrade(TRUE);
                 } else {
                     //No company exists, send them to the create company page.
                     $install_obj->setIsUpgrade(FALSE);
                 }
             } else {