This repository has been archived by the owner on Nov 27, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
audit.views.php
253 lines (240 loc) · 11.9 KB
/
audit.views.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
<?php
// main views
function insert_header($title = "API Jackknife") {
?>
<html>
<head>
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<title><?php echo $title; ?></title>
<link REL="STYLESHEET" TYPE="text/css" HREF="audit.style.css">
<script type="text/javascript" src="jquery-1.11.2.min.js"></script>
<script type="text/javascript" src="jquery-ui.js"></script>
<script type="text/javascript" src="audit.js"></script>
<script type="text/javascript" src="ajax.js"></script>
<style type="text/css">
section.center {
max-width: 150px;
margin: 100px auto;
}
span.clickMe {
font-size: 30px;
}
span.clickMe:hover {
cursor: pointer;
color: green;
}
section.hidden {
display: none;
position: fixed;
}
section article.popup {
position: relative;
width: 400px;
height: 300px;
background: #222262;
border: 1px solid #333;
border-radius: 3px;
padding: 5px 7px;
margin: 10% auto;
}
span.close {
text-transform: uppercase;
}
span.close:hover{
color: red;
cursor: pointer;
}
</style>
</head>
<body>
<section class="hidden" >
<article class="popup">
<a href="#" ><span class="close">Close</span></a>
<p>Paste red flagged characters, corps, and alliances. One entity per line</p>
<textarea id="redFlagBox"><?php if(isset($_SESSION)&&isset($_SESSION['redFlagText']))echo $_SESSION['redFlagText']; ?></textarea><br>
<input type="button" id="saveRedFlag" value="Save">
</article>
</section>
<section class="hidden" >
<article class="popup">
<a href="#" ><span class="close">Close</span></a>
<p>Please Select the scopes you want to use</p>
<form id="ssoSelect">
<table>
<tr><td> Wallet Read</td><td><input type="checkbox" checked name="scopes" value="characterWalletRead"></td></tr>
<tr><td> Assets Read</td><td><input type="checkbox" checked name="scopes" value="characterAssetsRead"></td></tr>
<tr><td> Contacts Read</td><td><input type="checkbox" checked name="scopes" value="characterContactsRead"></td></tr>
<tr><td> Kills Read</td><td><input type="checkbox" checked name="scopes" value="characterKillsRead"></td></tr>
<tr><td> Mails Read</td><td><input type="checkbox" checked name="scopes" value="characterMailRead"></td></tr>
<tr><td> Market Orders Read</td><td><input type="checkbox" checked name="scopes" value="characterMarketOrdersRead"></td></tr>
<tr><td> Notifications Read</td><td><input type="checkbox" checked name="scopes" value="characterNotificationsRead"></td></tr>
<tr><td> Skills Read</td><td><input type="checkbox" checked name="scopes" value="characterSkillsRead"></td></tr>
<tr><td> Contracts Read</td><td><input type="checkbox" checked name="scopes" value="characterContractsRead"></td></tr>
<tr><td> Bookmarks Read</td><td><input type="checkbox" checked name="scopes" value="characterBookmarksRead"></td></tr>
<tr><td> Clone Information Read</td><td><input type="checkbox" checked name="scopes" value="characterClonesRead"></td></tr>
</table>
<input type="button" id="generateSSOLink" value="Login">
</form>
</article>
</section>
<a name="top"></a>
<?php
}
function fatal_error($error = "Fatal Error", $addtl="",$api=false) {
global $Db;
@header("HTTP/1.0 500 Server Error");
insert_header("API Jackknife ERROR");
echo "<h3 style=\"display: inline;\">An error has occured:</h3><h4>$error</h4>";
if(!$api)echo "<a href=\"".SELF_URL."newapi\">API Key Input</a><br>";
if ($addtl != "")
echo "<br>$addtl";
echo "</body></html>";
$Db->close();
exit;
}
function character_select($Db, $chars) {
if(canAccess(33554432)){
$account = new eveApiAccount($Db);
if (!$account->fetch(USER_ID, API_KEY)) {
$account=false;
}
}else{
$account=false;
}
if (!$chars || count($chars) == 0) {
fatal_error("Failed to load characters. Verify API is valid and account has characters.");
} else {
insert_header("API Jackknife: Char Selection");
?>
<h3>Select character</h3><table><tr>
<?php
if(isset($_GET['key']))
$auth=SELF_URL."key=".$_GET['key'];
else
$auth=SELF_URL."usid=". USER_ID . "&apik=". API_KEY;
foreach ($chars as $ch_id => $char) {
echo "<td align=center><a href=\"".$auth."&chid=$ch_id".(isset($_GET['fittingid']) ? "&fittingid=$_GET[fittingid]" :"") . ((isset($_GET['save']) && $_GET['save'] == "1") ? "&save=1":""). "\">";
echo "<img src=\"https://image.eveonline.com/Character/".$ch_id."_256.jpg\" height=150 width=150><br>";
echo "<b>".$char["name"]."</b></a><br><span style=\"font-size:70%\">".$char["corporationName"].(($char["allianceID"] != 0)?("<br>".$char["allianceName"]):"<br> ")."</span>";
if(loggedIn()){
$Hide="";
echo "<script type=\"text/javascript\">getCharacterInfo($ch_id,".USER_ID .",'". API_KEY ."')</script>";
}else{
echo "<br><input style=\"font-size:80%;align:left\" type=\"button\" onclick=\"getCharacterInfo($ch_id,".USER_ID .",'". API_KEY ."');this.style.display='none';document.getElementById('iskTable".$ch_id."').style.display='block' \" value='Load Char Info'/>";
$Hide=";display:none;";
}
echo "<br><table id=\"iskTable".$ch_id."\" style=\"font-size:90%;align:left;width:100%".$Hide."\"> <tr><td>Isk: </td><td id=\"isk".$ch_id."\"></td></tr>";
echo "<tr><td>SP: </td><td id=\"sp".$ch_id."\"></td></tr>";
echo "<tr><td>Born: </td><td id=\"bday".$ch_id."\"></td></tr>";
echo "</table>";
echo "</td>\n";
}
?></tr></table>
<br><table style="font-size:80%"><tr><td>Total Isk: </td><td id="tIsk"></td></tr>
<tr><td>Total SP: </td><td id="tSp"></td></tr>
</table>
<?php if($account) { ?>
<span style="font-size:80%">Created <?php echo date("Y-m-d",strtotime($account->created)); ?>, <?php echo $account->paidUntil; ?> of subscription left</span>
<?php } ?>
<br><span style="font-size:80%"><a href="<?php SELF_URL . (isset($_GET['fittingid']) ? "&fittingid=$_GET[fittingid]" :"") ?>">back</a></span><br>
</body>
</html>
<?php
exit;
} /// END CHAR SELECT ///////////////////////////////////////////////////////////////////////////////
}
function api_input($info = "") {
global $infoBarFunctions,$footerFunctions;
insert_header();
$infobar="";
foreach($infoBarFunctions as $function){
$infobar.=$function();
}
if(!empty($infoBarFunctions))
$infobar="<span class=\"infobar\">< ".$infobar."></span><br>";
echo $infobar;
?>
<h2> Eve JackKnife Api Auditor</h2>
<style type="text/css">
* {
margin: 0;
}
html, body {
height: 100%;
}
.wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -4em;
}
.footer, .push {
height: 4em;
}
</style>
<div class="wrapper">
<b>Please insert your api key. You will need to enable items in the eve key interface for them to be accessible here.</b><br>
<?php
if ($info != "")
echo "<br><b>$info</b><br>";
?>
<br>
<form id="api" action="?" method="get">
<table>
<tr><td>User ID / key ID</td><td><input type="textbox" name="usid" size=7></td></tr>
<tr><td>API Key / vCode</td><td><input type="textbox" name="apik" size=90></td></tr>
<?php if (!loggedIn()) { ?><tr><td>Remember API?</td><td><input type="checkbox" name="save" value="1" checked></td></tr><?php } ?>
<?php if (isset($_GET['fittingid'])) { ?><input type="hidden" name="fittingid" value="<?php $_GET['fittingid'] ?>"><?php } ?>
</table>
<input type="submit" value="Get Chars"></form><h5>
<a target="_blank" href="https://support.eveonline.com/api/Key/Index">I don't know my NEW apis! (EVE Support)</a> <b><br>
Create API:</b>
<a target="_blank" href="https://community.eveonline.com/support/api-key/createpredefined?accessmask=34013320">Skills-only API</a> or
<a target="_blank" href="https://community.eveonline.com/support/api-key/createpredefined?accessmask=268435455">Everything API</a> <br>
<br>'Remember API' requires cookies to be enabled. Corp apis will not be 'remebered'.</h5>
<br>
<br>
<?php if(defined("SSO_URL")){ ?>
Login via SSO. After you select roles and login the url will be valid for exactly 20 minutes after which it will be invalidated by CCP.<br>
This URL can be shared with anyone without any risk to your account or the possibility of them keeping the api forever or needing to delete the key afterwards<br>
Refresh tokens are not stored<br>
<a href="#" id="ssoSelectButton"><img alt="EVE SSO Login Buttons Small White" src="https://images.contentful.com/idjq7aai9ylm/18BxKSXCymyqY4QKo8KwKe/c2bdded6118472dd587c8107f24104d7/EVE_SSO_Login_Buttons_Small_White.png?w=195&h=30"></a>
<?php } ?>
<br>
<br>
This Website is used to audit an api so that you might see your own skills and what ships you can fly, mails, contracts,assets, and any other given access from a specific api key<br>
After inputting your api key either precreated or by using one of the two create links above you can use the site to view the previously mentioned items from the eve api as well as<br>
checking if you have the skills required to fit a particular ship. This site is mainly for those who want to check another character's api to determine if they meet requirements for their<br>
corp or if what they are telling them is true however this can also be useful to new players to see what ships they can and cannot fly effectively. Green links at the top of the page<br>
can be used to navigate the apis or selecting one-page will display everything at once,WARNING may not load fully on first attempt<br>
<br>
<br>
Remember you can get source code at <a href="https://bitbucket.org/Whinis/eve-jacknife">Bitbucket</a> or <a href="https://github.com/whinis/eve-jacknife">Github</a>
<br>
<?php
if(defined("public")){ //something noone should need to set, displays a link to my github commit log on the main website
?>
<a href="history.html">Update History</a>
<?php
}
?>
<br>
<br>
Questions or concerns contact Equto ingame or Email me at [email protected]
<div class="push"></div>
</div>
<div class="footer">
EVE Online and the EVE logo are the registered trademarks of CCP hf. All rights are reserved worldwide. All other trademarks are the property of their respective owners. EVE Online, the EVE logo, EVE and all associated logos and designs are the intellectual property of CCP hf. All artwork, screenshots, characters, vehicles, storylines, world facts or other recognizable features of the intellectual property relating to these trademarks are likewise the intellectual property of CCP hf. CCP hf. has granted permission to Eve JackKnife to use EVE Online and all associated logos and designs for promotional and information purposes on its website but does not endorse, and is not in any way affiliated with, Eve JackKnife. CCP is in no way responsible for the content on or functioning of this website, nor can it be liable for any damage arising from the use of this website.
</div>
<?php
foreach($footerFunctions as $function){
echo $function();
}
?>
</body>
</html>
<?php
exit;
}
?>