} } OperationsData::updateAircraftRankLevels(); /* Add them to the default group */ $status_type_list = Config::get('PILOT_STATUS_TYPES'); $pilot_list = PilotData::getAllPilots(); foreach ($pilot_list as $pilot) { echo "Fixing settings for " . $pilot->firstname . " " . $pilot->lastname . "<br>"; PilotData::resetLedgerforPilot($pilot->pilotid); PilotGroups::addUsertoGroup($pilot->pilotid, DEFAULT_GROUP); # Reset the default groups $status = $status_type_list[$pilot->retired]; foreach ($status['group_add'] as $group) { PilotGroups::addUsertoGroup($pilot->pilotid, $group); } foreach ($status['group_remove'] as $group) { PilotGroups::removeUserFromGroup($pilot->pilotid, $group); } } SettingsData::saveSetting('PHPVMS_VERSION', $FULL_VERSION_STRING); # Don't count forced updates if (!isset($_GET['force'])) { Installer::RegisterInstall($FULL_VERSION_STRING); } echo '<p><strong>Update completed!</strong></p> <hr> <p >If there were any errors, you may have to manually run the SQL update, or correct the errors, and click the following to re-run the update: <br /> <a href="update.php?force">Click here to force the update to run again</a></p> <p>Click here to <a href="' . SITE_URL . '">goto your site</a>, or <a href="' . SITE_URL . '/admin">your admin panel</a></p> '; Template::Show('footer');
break; case 'installdb': if ($_POST['action'] == 'submitdb') { if ($_POST['DBASE_NAME'] == '' || $_POST['DBASE_USER'] == '' || $_POST['DBASE_TYPE'] == '' || $_POST['DBASE_SERVER'] == '' || $_POST['SITE_URL'] == '') { echo '<div id="error">You must fill out all the required fields</div>'; break; } if (!Installer::AddTables()) { echo '<div id="error">' . Installer::$error . '</div>'; break; } if (!Installer::WriteConfig()) { echo '<div id="error">' . Installer::$error . '</div>'; break; } SettingsData::saveSetting('PHPVMS_VERSION', INSTALLER_VERSION); echo '<div align="center" style="font-size: 18px;"><br /> <a href="install.php?page=sitesetup">Continue to the next step</a> </div>'; } break; case 'sitesetup': Template::Show('s2_site_setup.tpl'); break; case 'complete': if ($_POST['action'] == 'submitsetup') { if ($_POST['firstname'] == '' || $_POST['lastname'] == '' || $_POST['email'] == '' || $_POST['password'] == '' || $_POST['vaname'] == '' || $_POST['vacode'] == '') { Template::Set('message', 'You must fill out all of the fields'); Template::Show('s2_site_setup.tpl'); break; }
echo "<strong>Updating PIREPS Hours</strong><br />"; StatsData::UpdateTotalHours(); echo 'Found ' . StatsData::TotalHours() . ' total hours, updated<br />'; } if ($version < 20854) { Installer::add_to_config('USERS_ONLINE_TIME', 20, 'The StatsData::UserOnline() function - how many minutes to check'); Installer::sql_file_update(SITE_ROOT . '/install/update_854.sql'); } Installer::sql_file_update(SITE_ROOT . '/install/update.sql'); OperationsData::updateAircraftRankLevels(); /* Add them to the default group */ $allpilots = PilotData::GetAllPilots(); foreach ($allpilots as $pilot) { PilotGroups::AddUsertoGroup($pilot->pilotid, DEFAULT_GROUP); } SettingsData::saveSetting('PHPVMS_VERSION', UPDATE_VERSION); /* Update expenses */ //FinanceData::updateAllExpenses(); /* Manually specify a revenue value for all PIREPs */ /*$allpireps = PIREPData::findPIREPS(array()); if(is_array($allpireps)) { foreach($allpireps as $pirep) { $data = array( 'price' => $pirep->price, 'load' => $pirep->load, 'fuelprice' => $pirep->fuelprice, 'pilotpay' => $pirep->pilotpay, 'flighttime' => $pirep->flighttime, );