public function index() { if (!Auth::LoggedIn()) { $this->set('message', 'You must be logged in to access this feature!'); $this->render('core_error.tpl'); return; } /* * This is from /profile/editprofile */ if (isset($this->post->action)) { if ($this->post->action == 'saveprofile') { $this->save_profile_post(); } /* this comes from /profile/changepassword */ if ($this->post->action == 'changepassword') { $this->change_password_post(); } } if (Config::Get('TRANSFER_HOURS_IN_RANKS') == true) { $totalhours = intval(Auth::$userinfo->totalhours) + intval(Auth::$userinfo->transferhours); } else { $totalhours = Auth::$userinfo->totalhours; } $this->set('pilotcode', PilotData::GetPilotCode(Auth::$userinfo->code, Auth::$userinfo->pilotid)); $this->set('report', PIREPData::GetLastReports(Auth::$userinfo->pilotid)); $this->set('nextrank', RanksData::GetNextRank($totalhours)); $this->set('allawards', AwardsData::GetPilotAwards(Auth::$userinfo->pilotid)); $this->set('userinfo', Auth::$userinfo); $this->set('pilot_hours', $totalhours); $this->render('profile_main.tpl'); CodonEvent::Dispatch('profile_viewed', 'Profile'); }
}*/ if (!($pilot = PilotData::GetPilotData($pilotid))) { echo 'Invalid Pilot!'; return; } # # Check if anything was in the log # If not, then it probably wasn't a multi-chunk, so # just pull it straight from the query string # Otherwise, pull the full-text from the session # if ($_GET['more'] == '1') { # # We have more coming to the log # $report = PIREPData::GetLastReports($pilotid, 1); /* Check for any other data which might be in the other chunks sent by fsacars, because it's stupid and doesn't just do POST */ $log = explode('*', $_GET['log']); /* Find the landing rate */ $pos = find_in_fsacars_log('TouchDown:Rate', $log); $landingrate = str_replace('TouchDown:Rate', '', $log[$pos]); $count = preg_match('/([0-9]*:[0-9]*).*([-+]\\d*).*/i', $landingrate, $matches); if ($count > 0) { PIREPData::editPIREPFields($report->pirepid, array('landingrate' => $matches[2])); } PIREPData::AppendToLog($report->pirepid, $_GET['log']); echo 'OK'; return; }