public function CheckUsernameAndPassword($username, $password, &$errorMessage) { $this->connectionOptions['username'] = $username; $this->connectionOptions['password'] = $password; $connection = $this->connectionFactory->CreateConnection($this->connectionOptions); $connection->Connect(); if ($connection->Connected()) { $errorMessage = null; $connection->Disconnect(); return true; } else { $errorMessage = $connection->LastError(); //'The username/password combination you entered was invalid.'; return false; } }
public function Connect() { if (!isset($this->connection)) { $this->connection = $this->connectionFactory->CreateConnection($this->connectionParams); $this->GetConnection()->OnAfterConnect->AddListener('AfterConnectHandler', $this); $this->GetConnection()->Connect(); } }