spacejewel-ipn-communication/source/defs/Auth/Authentication.php
2018-06-07 10:56:13 +00:00

30 lines
473 B
PHP

<?php
class Auth
{
public $AdminID;
private $ApiTools;
public function __construct($AdminID)
{
$this->ApiTools = new ApplicationAPI($AdminID);
$this->AdminID = $AdminID;
}
public function Auth($key)
{
if ($this->ApiTools->keysMatch($key))
{
return true;
}
else
{
throw new Exception("FATAL: Invalid API key");
}
}
}