getAllArray(); unset( $sslf ); //Get primary company data needs to be used when user isn't logged in as well. $clf->getByID( PRIMARY_COMPANY_ID ); if ( $clf->getRecordCount() == 1 ) { $primary_company = $clf->getCurrent(); } } catch ( Exception $e ) { //Database not initialized, or some error, redirect to Install page. throw new DBError( $e, 'DBInitialize' ); } } if ( DEPLOYMENT_ON_DEMAND == false && isset( $config_vars['other']['installer_enabled'] ) && $config_vars['other']['installer_enabled'] == true && !isset( $_GET['installer'] ) ) { //Installer is enabled, check to see if any companies have been created, if not redirect to installer automatically, as they skipped it somehow. //Check if Company table exists first, incase the installer hasn't run at all, this avoids a SQL error. $installer_url = 'index.php?installer=1&disable_db=1&external_installer=1#!m=Install&a=license&external_installer=0'; if ( isset( $db ) ) { $install_obj = new Install(); $install_obj->setDatabaseConnection( $db ); if ( $install_obj->checkTableExists( 'company' ) == true ) { $clf = TTnew( 'CompanyListFactory' ); /** @var CompanyListFactory $clf */ $clf->getAll(); if ( $clf->getRecordCount() == 0 ) { Redirect::Page( URLBuilder::getURL( null, $installer_url ) ); } } else { Redirect::Page( URLBuilder::getURL( null, $installer_url ) ); } } else { Redirect::Page( URLBuilder::getURL( null, $installer_url ) ); } unset( $install_obj, $clf, $installer_url ); } Misc::redirectMobileBrowser(); //Redirect mobile browsers automatically. Misc::redirectUnSupportedBrowser(); //Redirect unsupported web browsers automatically. ?>