_username && isset($_GET["u"])) { $this->setUsername($_GET["u"]); } if (!$this->_password && isset($_GET["key"])) { $this->setPassword($_GET["key"]); } parent::__construct($storage); } public function authenticate() { if (!$this->_username || !$this->_password) { return null; } $user = $this->_storage->fetchByUsername($this->_username); if ($user && $user->getApiKey() == $this->_password) { return $user; } return null; } }