private function isValidWorker()
{
// Get apiKey
$this->getAPIKey();
if ($this->apiKey == NULL) {
return false;
}
// Get ip
$ipAddress = $_SERVER['REMOTE_ADDR'];
if (count($this->select("SELECT ipAddress FROM Worker WHERE ipAddress = '" . $this->mysqli->real_escape_string($ipAddress) . "' and apiKey = " . $this->mysqli->real_escape_string($this->apiKey))) > 0) {
return true;
} else {
return false;
}
}