Skip to content

Commit 76c2bf7

Browse files
unknownunknown
authored andcommitted
Moved main page to links.php to fix issue with eve trust.
If the site is enter without a trailing slash, IE http://example.com , the eve browser will not ask for tust.
1 parent 1ca4d21 commit 76c2bf7

4 files changed

Lines changed: 91 additions & 87 deletions

File tree

‎AddFleet.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
$brow = EveBowserFactory::Get();
99
if (!($brow->IsIGB() && $brow->IsTrusted()))
10-
RedirectResponse('index.php');
10+
RedirectResponse('links.php');
1111

1212
if (isset($_POST['fleetLink']) && isset($_POST['name'])){
1313
$matches;
@@ -25,7 +25,7 @@
2525
Fleet::DeleteOldFleets();
2626

2727
DataManager::CloseConnection();
28-
RedirectResponse('index.php');
28+
RedirectResponse('links.php');
2929
}
3030
}
3131
}

‎DeleteFleet.php‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
$brow = EveBowserFactory::Get();
88
if (!($brow->IsIGB() && $brow->IsTrusted()))
9-
RedirectResponse('index.php');
9+
RedirectResponse('links.php');
1010

1111
if (!isset($_GET['id']))
12-
RedirectResponse('index.php');
12+
RedirectResponse('links.php');
1313

1414
$id = (GetGet('id'));
1515

@@ -18,17 +18,17 @@
1818
$f = Fleet::Get($id);
1919
}
2020
catch (Exception $ex) {
21-
RedirectResponse('index.php');
21+
RedirectResponse('links.php');
2222
}
2323

2424
// you are only allowed to delete your own alliances fleet.
2525
if ($f->AllianceId != $brow->AllianceId())
26-
RedirectResponse('index.php');
26+
RedirectResponse('links.php');
2727

2828
// delete the fleet if the button was pressed.
2929
if (isset($_POST['btnDelete'])) {
3030
$f->Delete();
31-
RedirectResponse('index.php');
31+
RedirectResponse('links.php');
3232
}
3333

3434
DataManager::CloseConnection();

‎index.php‎

Lines changed: 3 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,4 @@
11
<?php
2-
require_once('app_code/EveBrowserFactory.php');
3-
require_once('app_code/Fleet.php');
4-
require_once('app_code/Alliance.php');
5-
$brow = EveBowserFactory::Get();
6-
$ogb = !$brow->IsIGB();
7-
$notTrusted = ($brow->IsIGB() && !$brow->IsTrusted());
8-
$trusted = ($brow->IsIGB() && $brow->IsTrusted());
9-
10-
if ($notTrusted)
11-
$brow->RequireTrust();
12-
13-
14-
$otherAlliances;
15-
if ($trusted) {
16-
$otherAlliances = Alliance::GetAlliancesOtherThanMineWithFleets($brow->AllianceID());
17-
}
18-
else {
19-
$otherAlliances = Alliance::GetAlliancesOtherThanMineWithFleets(-1);
20-
}
21-
22-
$otherFleets = array();
23-
foreach ($otherAlliances as $a) {
24-
$otherFleets[$a->Id] = $a->ActiveFleets();
25-
}
26-
27-
28-
$myFleets;
29-
if ($trusted) {
30-
$myFleets = Fleet::GetFleetsForAlliance($brow->AllianceId());
31-
}
32-
33-
34-
DataManager::CloseConnection();
35-
36-
function printAllianceFleets($name, $fleets, $myFleet = TRUE) {
37-
echo '<h2>' . $name . '</h2>';
38-
foreach ($fleets as $f) {
39-
echo gmdate('H:i', $f->Added);
40-
echo ' ';
41-
if ($myFleet) {
42-
echo '<a href="gang:' . $f->Id . '">' . htmlspecialchars($f->Name) . '</a>';
43-
echo ' <a href="DeleteFleet.php?id=' . $f->Id . '">[Delete]</a>';
44-
}
45-
else
46-
echo htmlspecialchars($f->Name);
47-
echo '<br />';
48-
}
49-
}
50-
51-
?>
52-
53-
<html>
54-
<head>
55-
<title>Fleet Links</title>
56-
</head>
57-
<body>
58-
<h1>Fleet Links</h1>
59-
<?php if ($ogb) {
60-
echo '<h2><font color="red">This page is designed to be viewed in the EVE in-game browser.</font></h2>';
61-
}
62-
elseif ($notTrusted) {
63-
echo '<h2><font color="red">You must add this site to your trusted site list. <a href="MakeTrusted.html">Instructions here.</a></font></h2>';
64-
}
65-
elseif ($trusted) {
66-
echo '<a href="AddFleet.php">Add a fleet</a><br>';
67-
printAllianceFleets(htmlspecialchars($brow->AllianceName()), $myFleets);
68-
}
69-
70-
71-
foreach ($otherAlliances as $a) {
72-
printAllianceFleets(htmlspecialchars($a->Name), $otherFleets[$a->Id], FALSE);
73-
}
74-
75-
?>
76-
77-
<hr>
78-
<small>Feel free contact <a href="showinfo:1376//1164427832">WoogyDude</a> in game or via <a href="http://www.goonfleet.com/member.php?u=22552">GoonFleet private message</a> if you have any questions or comments.</small>
79-
80-
</body>
81-
</html>
2+
require_once('app_code/Utilities.php');
3+
RedirectResponse('links.php');
4+
?>

‎links.php‎

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<?php
2+
require_once('app_code/EveBrowserFactory.php');
3+
require_once('app_code/Fleet.php');
4+
require_once('app_code/Alliance.php');
5+
$brow = EveBowserFactory::Get();
6+
$ogb = !$brow->IsIGB();
7+
$notTrusted = ($brow->IsIGB() && !$brow->IsTrusted());
8+
$trusted = ($brow->IsIGB() && $brow->IsTrusted());
9+
10+
if ($notTrusted)
11+
$brow->RequireTrust();
12+
13+
14+
$otherAlliances;
15+
if ($trusted) {
16+
$otherAlliances = Alliance::GetAlliancesOtherThanMineWithFleets($brow->AllianceID());
17+
}
18+
else {
19+
$otherAlliances = Alliance::GetAlliancesOtherThanMineWithFleets(-1);
20+
}
21+
22+
$otherFleets = array();
23+
foreach ($otherAlliances as $a) {
24+
$otherFleets[$a->Id] = $a->ActiveFleets();
25+
}
26+
27+
28+
$myFleets;
29+
if ($trusted) {
30+
$myFleets = Fleet::GetFleetsForAlliance($brow->AllianceId());
31+
}
32+
33+
34+
DataManager::CloseConnection();
35+
36+
function printAllianceFleets($name, $fleets, $myFleet = TRUE) {
37+
echo '<h2>' . $name . '</h2>';
38+
foreach ($fleets as $f) {
39+
echo gmdate('H:i', $f->Added);
40+
echo ' ';
41+
if ($myFleet) {
42+
echo '<a href="gang:' . $f->Id . '">' . htmlspecialchars($f->Name) . '</a>';
43+
echo ' <a href="DeleteFleet.php?id=' . $f->Id . '">[Delete]</a>';
44+
}
45+
else
46+
echo htmlspecialchars($f->Name);
47+
echo '<br />';
48+
}
49+
}
50+
51+
?>
52+
53+
<html>
54+
<head>
55+
<title>Fleet Links</title>
56+
</head>
57+
<body>
58+
<h1>Fleet Links</h1>
59+
<?php if ($ogb) {
60+
echo '<h2><font color="red">This page is designed to be viewed in the EVE in-game browser.</font></h2>';
61+
}
62+
elseif ($notTrusted) {
63+
echo '<h2><font color="red">You must add this site to your trusted site list. <a href="MakeTrusted.html">Instructions here.</a></font></h2>';
64+
}
65+
elseif ($trusted) {
66+
echo '<a href="AddFleet.php">Add a fleet</a><br>';
67+
printAllianceFleets(htmlspecialchars($brow->AllianceName()), $myFleets);
68+
}
69+
70+
71+
foreach ($otherAlliances as $a) {
72+
printAllianceFleets(htmlspecialchars($a->Name), $otherFleets[$a->Id], FALSE);
73+
}
74+
75+
?>
76+
77+
<hr>
78+
<small>Feel free contact <a href="showinfo:1376//1164427832">WoogyDude</a> in game or via <a href="http://www.goonfleet.com/member.php?u=22552">GoonFleet private message</a> if you have any questions or comments.</small>
79+
80+
</body>
81+
</html>

0 commit comments

Comments
 (0)