$do = $eve->VarCleanFromInput('do');
    if ($do) {
        echo $do();
        exit;
    }
    $upgrade = $eve->VarCleanFromInput('upgrade');
    if ($upgrade) {
        //$eveRender->Assign('upgrade', $upgrade);
        $eve->SessionSetVar('statusmsg', 'Tables created/updated succesfully');
        $eve->RedirectUrl('install.php?step=4');
    }
    if ($eve->IsMiniBrowser()) {
        if (!$eve->IsTrusted()) {
            $eve->RequestTrust('You must add this site to your trusted list to log in in-game!');
        } else {
            $userinfo = $eve->GetUserVars();
            $eveRender->Assign('IS_IGB', true);
            $eveRender->Assign('userinfo', $userinfo);
        }
    } else {
        $eveRender->Assign('IS_IGB', false);
    }
    $eveRender->Assign('done', true);
    $eveRender->Display('install/install.tpl');
    exit;
} elseif ($step == 3) {
    $name = $eve->VarCleanFromInput('name');
    $pass = $eve->VarCleanFromInput('pass');
    $email = $eve->VarCleanFromInput('email');
    if (empty($pass) || empty($email)) {
        $eve->SessionSetVar('errormsg', 'Please fill all the fields of the form!');
    }
    if (!empty($newpass) && $newpass != $newpass2) {
        $eve->SessionSetVar('errormsg', 'Password and confirmation password are different!');
        $eve->RedirectUrl('user.php');
    }
    if ($newpass) {
        if (!$posmgmt->UpdateUserPass(array('id' => $userinfo['id'], 'newpass' => $newpass))) {
            $eve->RedirectUrl('user.php');
        }
        $eve->SessionSetVar('statusmsg', 'New password saved!');
        $eve->RedirectUrl('user.php');
    }
    $userinfo = $posmgmt->GetUserInfo();
}
if ($action == 'updatecorpinfo') {
    $eveinfo = $eve->GetUserVars();
    $userinfo = array_merge($userinfo, $eveinfo);
    if ($posmgmt->UpdateUserInfo($userinfo)) {
        $eve->SessionSetVar('statusmsg', 'Your information has been saved!');
        $eve->RedirectUrl('user.php');
    }
}
$user_track_sort = array(11 => 'Corp (A)', 23 => 'Corp (D)', 6 => 'Fuel Tech 1 (A)', 18 => 'Fuel Tech 1 (D)', 7 => 'Fuel Tech 2 (A)', 19 => 'Fuel Tech 2 (D)', 2 => 'Location (A)', 14 => 'Location (D)', 10 => 'POS Race (A)', 22 => 'POS Race (D)', 9 => 'POS Size (A)', 21 => 'POS Size (D)', 5 => 'POS Type (A)', 17 => 'POS Type (D)', 3 => 'Region (A)', 15 => 'Region (D)', 1 => 'Status (A)', 13 => 'Status (D)', 4 => 'Tower Name (A)', 16 => 'Tower Name (D)');
$userinfo['access'] = explode('.', $userinfo['access']);
$eveRender->Assign($userinfo);
$eveRender->Assign('awaystatus', array(2 => 'No', 1 => 'Yes'));
$eveRender->Assign('themeset', array(1 => 'FGV - Default', 2 => 'Original POS-Tracker', 3 => 'Majesta Empire', 4 => 'Razor Alliance', 5 => 'Morsus Mihi'));
$eveRender->Assign('user_track_display', array(10 => '10', 15 => '15', 30 => '30', 50 => '50', 75 => '75', 100 => '100'));
$eveRender->Assign('user_track_sort', $user_track_sort);
$eveRender->Assign('IS_IGB', $IS_IGB);
$eveRender->Display('user.tpl');