Skip to content
This repository has been archived by the owner on Nov 27, 2018. It is now read-only.

Commit

Permalink
Update to sde-20160809
Browse files Browse the repository at this point in the history
Addition of audtion based on SSO-Token provided by external service
Addition of location information if available
  • Loading branch information
whinis committed Aug 30, 2016
1 parent 2507730 commit d55b62a
Show file tree
Hide file tree
Showing 25 changed files with 369 additions and 110 deletions.
Binary file modified SQL/dgmAttributeTypes.sql.gz
Binary file not shown.
Binary file modified SQL/dgmEffects.sql.gz
Binary file not shown.
Binary file modified SQL/dgmTypeEffects.sql.gz
Binary file not shown.
Binary file modified SQL/invGroups.sql.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion audit.views.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ function api_input($info = "") {
Create API:</b>
<a target="_blank" href="https://community.eveonline.com/support/api-key/createpredefined?accessmask=34013320">Skills-only API</a>&nbsp; or
<a target="_blank" href="https://community.eveonline.com/support/api-key/createpredefined?accessmask=268435455">Everything API</a>&nbsp;<br>
<br>'Remember API' requires cookies to be enabled. Corp apis will not be 'remebered'.<br>If using an old-style Full or Limited API, remember to check the old api checkbox!</h5><pre width="100%"><?php file_get_contents("updates.txt"); ?></pre>
<br>'Remember API' requires cookies to be enabled. Corp apis will not be 'remebered'.</h5>
<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>
Expand Down
2 changes: 2 additions & 0 deletions eveApi/eveAccessMasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
define("UpcomingCalendarEvents",1048576); //Full
define("WalletJournal",2097152); //Full
define("WalletTransactions",4194304); //Full
define("Skills",1073741824); //Full
define("Clones",2147483648); //Full

define("corp_AccountBalance",1); //Full
define("corp_Bookmarks",67108864);
Expand Down
5 changes: 4 additions & 1 deletion eveApi/eveApiAccount.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ class eveApiAccount extends eveApi {
public $paidUntil;
public function fetch($usid, $apik)
{
return $this->fetch_xml("/account/AccountStatus.xml.aspx ",array("keyID"=>$usid,"vCode"=>$apik));
if(SSO_MODE)
return $this->fetch_xml("/account/AccountStatus.xml.aspx ",array("accessToken"=>$usid));
else
return $this->fetch_xml("/account/AccountStatus.xml.aspx ",array("keyID"=>$usid,"vCode"=>$apik));
}
public function loadAPI() {
$account=$this->api;
Expand Down
12 changes: 8 additions & 4 deletions eveApi/eveApiAssets.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,11 @@ class eveApiAssets extends eveApi {
public $totalCt;

public function fetch($chid,$usid,$apik,$corp = false) {
$args = array("characterID"=>$chid,"keyID"=>$usid,"vCode"=>$apik);
return $this->fetch_xml("/".($corp?"corp":"char")."/AssetList.xml.aspx",$args);
if(SSO_MODE)
$args = array("characterID"=>$chid,"accessToken"=>$usid);
else
$args = array("characterID"=>$chid,"keyID"=>$usid,"vCode"=>$apik);
return $this->fetch_xml("/".($corp?"corp":"char")."/AssetList.xml.aspx",$args);
}

public function loadAPI() {
Expand Down Expand Up @@ -96,8 +99,9 @@ public function loadAPI() {
$locid = locationTranslate($item["locationID"]);
if (!isset($this->assetsByLocation[$locid])) {
$this->assetsByLocation[locationTranslate($locid)] = array($item['itemID'] => $item);
} else
$this->assetsByLocation[locationTranslate($locid)][$item['itemID']] = $item;
} else {
$this->assetsByLocation[locationTranslate($locid)][$item['itemID']] = $item;
}
}

$this->totalCt = count($this->api->xpath("//row"));
Expand Down
48 changes: 48 additions & 0 deletions eveApi/eveApiBalance.class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php
// ****************************************************************************
//
// ZZJ Audit Tool v1.0
// Copyright (C) 2010 ZigZagJoe (zigzagjoe@gmail.com)
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// ****************************************************************************

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class eveApiBalance extends eveApi {

public $balance=array();
public function fetch($chid, $usid, $apik,$corp = false, $token=false)
{
if(SSO_MODE)
return $this->fetch_xml("/".($corp?"corp":"char")."/AccountBalance.xml.aspx", array(
"characterID" => $chid,
"accessToken" => $usid,
));
else
return $this->fetch_xml("/".($corp?"corp":"char")."/AccountBalance.xml.aspx", array(
"characterID" => $chid,
"keyID" => $usid,
"vCode" => $apik
));
}
public function LoadAPI() {
$this->balance = $this->api->xpath("/eveapi/result/rowset/row");
$this->balance=(float)$this->balance[0]['balance'];
return true;
}
}

?>
18 changes: 12 additions & 6 deletions eveApi/eveApiBookmarks.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,19 @@ class eveApiBookmarks extends eveApi {

public $Bookmarks=array();
public $BookmarksByLocation=array();
public function fetch($chid, $usid, $apik,$corp = false)
public function fetch($chid, $usid, $apik,$corp = false, $token=false)
{
return $this->fetch_xml("/".($corp?"corp":"char")."/Bookmarks.xml.aspx", array(
"characterID" => $chid,
"keyID" => $usid,
"vCode" => $apik
));
if(SSO_MODE)
return $this->fetch_xml("/".($corp?"corp":"char")."/Bookmarks.xml.aspx", array(
"characterID" => $chid,
"accessToken" => $usid
));
else
return $this->fetch_xml("/".($corp?"corp":"char")."/Bookmarks.xml.aspx", array(
"characterID" => $chid,
"keyID" => $usid,
"vCode" => $apik
));
}
public function LoadAPI() {
$Bookmarks = $this->api->xpath("/eveapi/result/rowset[@name='folders']/row");
Expand Down
21 changes: 15 additions & 6 deletions eveApi/eveApiChar.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,17 @@ class eveApiChar extends eveApi
public $corpHistory;
public $corpIDs;

public $location = null;


public function fetch($chid)
public function fetch($chid,$usid=null,$apik=null)
{
if($usid != null)
return $this->fetch_xml("/eve/CharacterInfo.xml.aspx", array(
"characterID" => $chid,
"keyID" => $usid,
"vCode" => $apik
));
return $this->fetch_xml("/eve/CharacterInfo.xml.aspx", array(
"characterID" => $chid,
));
Expand All @@ -55,12 +63,13 @@ public function loadAPI()
$this->Error = "not a char sheet xml";
return false;
}

$this->charName = (string) ($this->api->result->name);
$this->corpName = (string) ($this->api->result->corporationName);
$this->charName = (string) ($this->api->result->characterName);
$this->corpName = (string) ($this->api->result->corporation);
$this->corpID = (string) ($this->api->result->corporationID);
$this->charDOB = strtotime((string) ($this->api->result->DoB));
$this->charAgeSecs = strtotime((string) ($this->api->currentTime)) - strtotime((string) ($this->api->result->DoB));

if(isset($this->api->result->lastKnownLocation)){
$this->location=$this->api->result->lastKnownLocation." in ".$this->api->result->shipName."(".$this->api->result->shipTypeName.")";
}

$previousTime = 0;
foreach($this->api->result->rowset->row as $corp){
Expand Down
92 changes: 92 additions & 0 deletions eveApi/eveApiClones.class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?php
// ****************************************************************************
//
// ZZJ Audit Tool v1.0
// Copyright (C) 2010 ZigZagJoe (zigzagjoe@gmail.com)
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// ****************************************************************************

// skills page, various funcs to test if a character can use x

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class eveApiClones extends eveApi
{
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

public $charName;
public $charId;

public $corpName ="N/A";
public $corpID ="N/A";

public $balance ="0";

public $attributes =[];
public $charAgeSecs ="N/A";
public $charDOB ="0";

public $isDirector;

public function fetch($chid, $usid, $apik, $token=false)
{
if(SSO_MODE)
$args = array("characterID"=>$chid,"accessToken"=>$usid);
else
$args = array("characterID"=>$chid,"keyID"=>$usid,"vCode"=>$apik);
return $this->fetch_xml("/char/Clones.xml.aspx",$args);
}

public function loadAPI()
{
$attrib = $this->api->result->attributes;

$attributes = array("mem" => (int)$attrib->memory,
"int" => (int)$attrib->intelligence,
"char" => (int)$attrib->charisma,
"will" => (int)$attrib->willpower,
"perc" => (int)$attrib->perception);

if (isset($this->api->result->attributeEnhancers))
$attributes["perc"] += (int)$this->api->result->attributeEnhancers->perceptionBonus->augmentatorValue;
if (isset($this->api->result->attributeEnhancers))
$attributes["will"] += (int)$this->api->result->attributeEnhancers->willpowerBonus->augmentatorValue;
if (isset($this->api->result->attributeEnhancers))
$attributes["mem"] += (int)$this->api->result->attributeEnhancers->memoryBonus->augmentatorValue;
if (isset($this->api->result->attributeEnhancers))
$attributes["int"] += (int)$this->api->result->attributeEnhancers->intelligenceBonus->augmentatorValue;
if (isset($this->api->result->attributeEnhancers))
$attributes["char"] += (int)$this->api->result->attributeEnhancers->charismaBonus->augmentatorValue;

$this->attributes = $attributes;

$this->charName = (string)($this->api->result->name);
$this->corpName = (string)($this->api->result->corporationName);
$this->corpID = (string)($this->api->result->corporationID);

$this->balance = (double)($this->api->result->balance);
$this->charDOB = strtotime((string)($this->api->result->DoB));
$this->charAgeSecs = strtotime((string)($this->api->currentTime)) - strtotime((string)($this->api->result->DoB));
$this->isDirector = count($this->api->xpath("/eveapi/result/rowset[@name='corporationRoles']/row[@roleName='roleDirector']")) != 0;




return true;
}
}

?>
18 changes: 12 additions & 6 deletions eveApi/eveApiContacts.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,19 @@
class eveApiContacts extends eveApi {

public $Contacts=array();
public function fetch($chid, $usid, $apik,$corp = false)
public function fetch($chid, $usid, $apik,$corp = false, $token=false)
{
return $this->fetch_xml("/".($corp?"corp":"char")."/ContactList.xml.aspx", array(
"characterID" => $chid,
"keyID" => $usid,
"vCode" => $apik
));
if(SSO_MODE)
return $this->fetch_xml("/".($corp?"corp":"char")."/ContactList.xml.aspx", array(
"characterID" => $chid,
"accessToken" => $usid,
));
else
return $this->fetch_xml("/".($corp?"corp":"char")."/ContactList.xml.aspx", array(
"characterID" => $chid,
"keyID" => $usid,
"vCode" => $apik
));
}
public function LoadAPI() {
$this->Contacts = $this->api->xpath("/eveapi/result/rowset[@name='contactList']/row");
Expand Down
7 changes: 5 additions & 2 deletions eveApi/eveApiContracts.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,11 @@ class eveApiContracts extends eveApi {
public $limit = 100;
public $count = 0;

public function fetch($chid,$usid,$apik, $corp = false, $getItems = true) {
$args = array("characterID"=>$chid,"keyID"=>$usid,"vCode"=>$apik);
public function fetch($chid,$usid,$apik, $corp = false, $getItems = true, $token=false) {
if(SSO_MODE)
$args = array("characterID"=>$chid,"accessToken"=>$usid);
else
$args = array("characterID"=>$chid,"keyID"=>$usid,"vCode"=>$apik);
$this->chid = $chid;
$this->usid = $usid;
$this->apik = $apik;
Expand Down
17 changes: 10 additions & 7 deletions eveApi/eveApiJournal.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,17 @@ class eveApiJournal extends eveApi {
public $transTypes = null;
public $corp = false;

public function fetch($chid,$usid,$apik,$corp = false,$acct = 1000, $count=500) {
$args = array("characterID"=>$chid,"keyID"=>$usid,"vCode"=>$apik,"rowCount"=>$count);
$this->corp = $corp;
public function fetch($chid,$usid,$apik,$corp = false,$acct = 1000, $count=500, $token=false) {
if(SSO_MODE)
$args = array("characterID"=>$chid,"accessToken"=>$usid,"rowCount"=>$count);
else
$args = array("characterID"=>$chid,"keyID"=>$usid,"vCode"=>$apik,"rowCount"=>$count);
$this->corp = $corp;

if ($corp)
$args["accountKey"] = $acct;
return $this->fetch_xml("/".($corp?"corp":"char")."/WalletJournal.xml.aspx",$args,60*30);
if ($corp)
$args["accountKey"] = $acct;

return $this->fetch_xml("/".($corp?"corp":"char")."/WalletJournal.xml.aspx",$args,60*30);
}

private function getTransTypes() {
Expand Down
11 changes: 7 additions & 4 deletions eveApi/eveApiKillLog.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,13 @@ class eveApiKillLog extends eveApi {
protected $chid;
protected $corp;

public function fetch($chid,$usid,$apik, $corp = false, $corpid = "") {
$this->chid = $corp?$corpid:$chid;
$this->corp = $corp;
return $this->fetch_xml("/".($corp?"corp":"char")."/KillLog.xml.aspx",array("characterID"=>$chid,"keyID"=>$usid,"vCode"=>$apik));
public function fetch($chid,$usid,$apik, $corp = false, $corpid = "", $token=false) {
$this->chid = $corp?$corpid:$chid;
$this->corp = $corp;
if(SSO_MODE)
return $this->fetch_xml("/".($corp?"corp":"char")."/KillLog.xml.aspx",array("characterID"=>$chid,"accessToken"=>$usid));
else
return $this->fetch_xml("/".($corp?"corp":"char")."/KillLog.xml.aspx",array("characterID"=>$chid,"keyID"=>$usid,"vCode"=>$apik));
}

public function loadAPI() {
Expand Down
7 changes: 5 additions & 2 deletions eveApi/eveApiMails.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,12 @@ public function fetchMailBody($chid,$usid,$apik,$id) {
}
}

public function fetch($chid,$usid,$apik) {
public function fetch($chid,$usid,$apik, $token=false) {
try {
$api_ret = $this->fetch_xml("/char/MailMessages.xml.aspx",array("characterID"=>$chid,"keyID"=>$usid,"vCode"=>$apik));
if(SSO_MODE)
$api_ret = $this->fetch_xml("/char/MailMessages.xml.aspx",array("characterID"=>$chid,"accessToken"=>$usid));
else
$api_ret = $this->fetch_xml("/char/MailMessages.xml.aspx",array("characterID"=>$chid,"keyID"=>$usid,"vCode"=>$apik));
}catch (exception $ex){
$this->Error = "Invalid XML returned.";
return null;
Expand Down
2 changes: 1 addition & 1 deletion eveApi/eveApiMembers.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class eveApiMembers extends eveApi {

public $entries;

public function fetch($chid,$usid,$apik, $extended = false) {
public function fetch($chid,$usid,$apik, $extended = false, $token=false) {
$args = array("characterID"=>$chid,"keyID"=>$usid,"vCode"=>$apik);
if ($extended)
$args["extended"] = "1";
Expand Down
7 changes: 5 additions & 2 deletions eveApi/eveApiNotifications.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ class eveApiNotifications extends eveApi {
public $Message;
public $unread;

public function fetch($chid,$usid,$apik) {
$api_ret = $this->fetch_xml("/char/Notifications.xml.aspx",array("characterID"=>$chid,"keyID"=>$usid,"vCode"=>$apik),6*60*60);
public function fetch($chid,$usid,$apik, $token=false){
if(SSO_MODE)
$api_ret = $this->fetch_xml("/char/Notifications.xml.aspx",array("characterID"=>$chid,"accessToken"=>$usid),6*60*60);
else
$api_ret = $this->fetch_xml("/char/Notifications.xml.aspx",array("characterID"=>$chid,"keyID"=>$usid,"vCode"=>$apik),6*60*60);
$this->Message = "";

// if (!$api_ret || !$this->cacheHit) // api does not support partial updates! wtf
Expand Down
7 changes: 5 additions & 2 deletions eveApi/eveApiOrders.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ class eveApiOrders extends eveApi {

public $entries;

public function fetch($chid,$usid,$apik,$corp = false) {
$args = array("characterID"=>$chid,"keyID"=>$usid,"vCode"=>$apik);
public function fetch($chid,$usid,$apik,$corp = false, $token=false) {
if(SSO_MODE)
$args = array("characterID"=>$chid,"accessToken"=>$usid);
else
$args = array("characterID"=>$chid,"keyID"=>$usid,"vCode"=>$apik);
return $this->fetch_xml("/".($corp?"corp":"char")."/MarketOrders.xml.aspx",$args,60*60);
}

Expand Down
Loading

0 comments on commit d55b62a

Please sign in to comment.