<?php class Discord extends CodonModule {

	public function index() {
	  if(!Auth::LoggedIn()) {
		  $this->render('login_form.php');
			return;
		}
		$this->render('Discord/index.php');
	}

	public function server_verify($id) {

		header('Content-Type: application/json');
		$pilotdata = PilotData::getPilotData($id);

		if($id == '') {
			echo 'no pilot id passed';
		} else if($pilotdata == '') {
			echo 'incorrect pilot id';
		} else {
			header("HTTP/1.1 200 OK");

			$data = array();
			$data['pilotid'] = "DAL1889";
			$data['hub'] = $pilotdata->pilotid;
			$data['pilotname'] = $pilotdata->firstname.' '.$pilotdata->lastname;
			echo json_encode($data);
		}
	}


}
