- SQLresult* res = static_cast<SQLresult*>(&request);
-
- User* user = GetAssocUser(this, SQLutils, res->id).S().user;
- UnAssociate(this, SQLutils, res->id).S();
-
- if(user)
- {
- if(res->error.Id() == SQL_NO_ERROR)
- {
- if(res->Rows())
- {
- /* We got a row in the result, this is enough really */
- sqlAuthed.set(user, 1);
- }
- else if (verbose)
- {
- /* No rows in result, this means there was no record matching the user */
- ServerInstance->SNO->WriteGlobalSno('a', "Forbidden connection from %s!%s@%s (SQL query returned no matches)", user->nick.c_str(), user->ident.c_str(), user->host.c_str());
- }
- }
- else if (verbose)
- {
- ServerInstance->SNO->WriteGlobalSno('a', "Forbidden connection from %s!%s@%s (SQL query failed: %s)", user->nick.c_str(), user->ident.c_str(), user->host.c_str(), res->error.Str());
- }
- }
- else
- {
- return;
- }
-
- if (!sqlAuthed.get(user))
- {