Add all code files from IDE
This commit is contained in:
30
source/defs/Auth/Authentication.php
Normal file
30
source/defs/Auth/Authentication.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?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");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user