spacejewel-ipn-communication/source/defs/Auth/Authentication.php

30 lines
473 B
PHP
Raw Normal View History

2018-06-07 10:56:13 +00:00
<?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");
}
}
}