-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsigadd.php
65 lines (56 loc) · 2.08 KB
/
sigadd.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
<?php
include "php/routes.php";
session_start();
$data = $_POST['sigdata'];
$sigs = explode("\n", $data);
$system = $_SESSION["CharacterSystemName"];
$system_id = $_SESSION["CharacterSystemID"];
$url = file_get_contents("https://esi.tech.ccp.is/dev/universe/systems/".$system_id."/?datasource=tranquility&language=en-us");
$content = json_decode($url, true);
$const_id = $content['constellation_id'];
$url2 = file_get_contents("https://esi.tech.ccp.is/latest/universe/constellations/".$const_id."/?datasource=tranquility&language=en-us");
$content2 = json_decode($url2, true);
$const_name = $content2['name'];
$region_id = $content2['region_id'];
$url3 = file_get_contents("https://esi.tech.ccp.is/latest/universe/regions/".$region_id."/?datasource=tranquility&language=en-us");
$content3 = json_decode($url3, true);
$region_name = $content3['name'];
$reporter_name = $_SESSION["CharacterName"];
$reporter_id = $_SESSION["CharacterID"];
$corp_id = $_SESSION["CharacterCorpID"];
$alliance_id = $_SESSION["CharacterAllianceID"];
$has = false;
for ($i=0; $i < sizeof($sigs); $i++) {
$info = explode("\t",$sigs[$i]);
$sig_id = $info[0];
$sig_type = $info[2];
$sig_name = $info[3];
if ($alliance_id == '' || is_null($alliance_id)) {
$alliance_id = "";
}
if ($corp_id == '' || is_null($corp_id)) {
$corp_id = "";
}
if ($sig_type == '' || !isset($sig_type) || $sig_type == null) {
$sig_type = "Unknown";
}
if ($sig_name == '' || !isset($sig_name) || $sig_name == null) {
$sig_name = "Unknown";
}
if ($sig_id == '' || is_null($sig_id)) {
$has = false;
} else {
$var = add_signature($system, $system_id, $const_name, $const_id, $region_name, $region_id, $sig_id, $sig_type, $sig_name, $reporter_name, $reporter_id, $corp_id, $alliance_id);
if ($var == false) {
$has = true;
}
}
}
if ($has == true) {
// header('Location: '.'/home?s=f');
echo "false";
} else {
// header('Location: '.'/home?s=t');
echo "true";
}
?>