function get_ids() { # order matters!!!! if (is_null($this->alliance_id)) { $this->alliance_id = get_alliance_id($this->alliance); } if (is_null($this->corp_id)) { $this->corp_id = get_corp_id($this->corp, $this->alliance_id); } if (is_null($this->pilot_id)) { $this->pilot_id = get_pilot_id($this->pilot, $this->corp_id); } if (is_null($this->char_id)) { $this->char_id = get_pilot_charid($this->pilot_id); } if (is_null($this->ship_id)) { $this->ship_id = get_item_id($this->ship); } if (is_null($this->group_id)) { $this->group_id = get_item_group_id($this->ship_id); } if (is_null($this->weapon_id)) { $this->weapon_id = get_item_id($this->weapon); } }
function get_pilot_id($name, $corpid = null, $first = 1) { global $ft; if (is_null($name)) { return 0; } $pilot = $ft->dbh->_select_row_as_object('SELECT pilotid FROM tbl:pilots WHERE name = ?', array($name)); $pilotid = null; if ($pilot) { $pilotid = $pilot->pilotid; if ($corpid && $pilot->corpid != $corpid) { $ft->dbh->_do_query('UPDATE tbl:pilots SET corpid = ? WHERE pilotid = ?', array($corpid, $pilotid)); } } if (!$pilotid && $name != "" && $first) { $ft->dbh->_do_query('INSERT INTO tbl:pilots (name, corpid) VALUES (?, ?)', array($name, $corpid)); $pilotid = get_pilot_id($name, $corpid, 0); } return $pilotid; }
<?php include 'lib/fortissimo.php'; # if not trusted, get trust global $_WEB_URL; if (!$ft->eve->TrustInit($_WEB_URL . '/', 'You must trust this Fortissimo killboard site in order to proceed.')) { return $ft->igberrorpage("You must trust this site to use it. Sorry!"); } # see if we know them $corpid = get_corp_id($ft->eve->CorpName, 0); if (!$corpid) { return $ft->igberrorpage("Sorry, unable to verify your corporation. I cannot let you pass!"); } $pilotid = get_pilot_id($ft->eve->CharName, $corpid); if (!$pilotid) { return $ft->igberrorpage("Sorry, unable to verify your account. I cannot let you pass!"); } # okay, they're in, do we know them? $obj = new User($pilotid); if (!$obj) { return $ft->igberrorpage("Sorry, unable to access your account. I cannot let you pass!"); } # see what their standings are if (!$obj->trustable()) { return $ft->igberrorpage("Sorry, we don't allow your type here."); } # do they have a password? if ($obj->password()) { return $ft->igberrorpage("Sorry, you already have a password on your account. If you need to reset your " . "password you must talk to an administrator. Thank you!"); } # store output here
return $ft->igberrorpage('Sorry, that run is already scheduled by <font color="#ff0000">' . get_corp_name($run->corpid) . '</font>.'); } # see if they are allowed to reserve spots # FIXME: implement if (0) { return $ft->igberrorpage('Sorry, you must be an accountant or director in your corporation in order to schedule a run.'); } # store output here $out = "<center><b><font color='#ffff00'>Plexer - The Complex Scheduler</font></b><br />"; $out .= "<font color='#ff0000'><b>{$plex->name}</b> in <b>{$plex->system}</b> rated <b>{$plex->rating}/10</b></font><br />"; $out .= "[ <a href='{$_WEB_URL}/'>Back to Top</a> ] [ <a href='{$_WEB_URL}/igb-showcomplex.php?id={$id}'>Back to Complex</a> ]"; $out .= "</center><br />"; # if they're trying to confirm if ($_GET['confirm'] == 1) { # okay, set the confirmation $run = submit_schedule($id, $dayid, $slotid, get_corp_id($ft->eve->CorpName), get_pilot_id($ft->eve->CharName)); $out .= "Your reservation has been confirmed. <b>Good luck!</b>"; } else { # so they want to reserve it eh... $out .= "Okay, so you want to run a complex? Well, from the looks of it, the run you've chosen is not "; $out .= "already reserved for someone. That's good for you, means you should be able to get in."; $out .= "<p>Please review the information below and confirm that you intend to run this complex. <b>You are "; $out .= "responsible for ensuring your corporation/group runs the complex. If you reserve slots and do not "; $out .= "use them, we will hunt you down and barbeque you. :-)</p>"; # now dump the information $info = array("Complex" => "<a href='{$_WEB_URL}/igb-showcomplex.php?id={$id}'>{$plex->name}</a> (" . $plex->rating . "/10)", "System" => $plex->system . " (" . $plex->region . ")", "a" => "-", "Date" => stddate(slot_to_date($dayid)), "Name" => get_complex_slot_name($slotid), "Description" => get_complex_slot_desc($slotid), "b" => "-", "Reserve for corp" => $ft->eve->CorpName, "Reserve by pilot" => $ft->eve->CharName); foreach ($info as $k => $v) { if ($v == "-") { $out .= "<br />"; continue; }
if ($ft->config('setup_done')) { return $ft->errorpage('Sorry, you have already completed the setup process.'); } # STEP 1: let's create the tables that we need... include 'lib/db_utils.php'; setup_db(); populate_db(); # okay, make sure they gave us all the inputs $user = trim($_POST['admin_name']); $pw1 = trim($_POST['admin_pw1']); $pw2 = trim($_POST['admin_pw2']); $ft->assign('admin_name', $user); if (!$user || !$pw1 || !$pw2) { $ft->assign('error1', 'You must fill in all fields in this section.'); return $ft->makepage('setup'); } if ($pw1 != $pw2) { $ft->assign('error1', 'The chosen passwords do not match.'); return $ft->makepage('setup'); } if (strlen($pw1) < 6) { $ft->assign('error1', 'Your password must be at least 6 characters long.'); return $ft->makepage('setup'); } # setup this account $id = get_pilot_id($user); $ft->dbh->_do_query('UPDATE tbl:pilots SET password = ?, roles = 1 WHERE pilotid = ?', array($pw1, $id)); $ft->set_config('setup_done', 1); # they're done $ft->assign('message', "Admin account <strong>{$user}</strong> created!"); $ft->makepage('setup_do');