public function __construct($class = NULL) { if (is_object($class) === true) { $this->currentClass = get_class($class); if ($this->currentClass === false) { throw new SecurityException("Access deny"); } } else { if (is_string($class)) { if (class_exists($class) === true) { $this->currentClass = $class; } } else { throw new SecurityException("Access Deny", 6029); } } try { $this->user = new UserAuth(); } catch (SessionExpired $e) { EmaRpcApi::$sesExpired = true; } $this->dbConnection = $GLOBALS['EMA']['DB']['connection']; }