/**
* Public class constructor
* @access public
* @throws Exception when user has already been registered
*/
public function __construct()
{
if (isset($_SESSION['visitor']) && $_SESSION['visitor'] == "accessed") {
throw new Exception("User already registered", 1);
} else {
$this->dateTime = Carbon::now();
$this->browser = BrowserDetect::browserFamily();
$this->OS = BrowserDetect::osName();
if (BrowserDetect::isMobile()) {
$this->deviceType = "mobile";
} elseif (Browser::isTablet()) {
$this->deviceType = "tablet";
} elseif (Browser::isDesktop()) {
$this->deviceType = "desktop";
} elseif (Browser::isBot()) {
$this->deviceType = "bot";
} else {
$this->deviceType = "unknown";
}
$this->deviceFamily = Broswer::deviceFamily();
$this->deviceModel = Browser::deviceModel();
$this->broadcastAddress = $_SERVER["REMOTE_ADDR"];
$this->model = new AccessModel($this);
}
}