+ else
+ {
+ /* No rows in result, this means there was no oper line for the user,
+ * we should have already checked the o:lines so now we need an
+ * "insufficient awesomeness" (invalid credentials) error
+ */
+
+ user->WriteServ( "491 %s :Invalid oper credentials", user->nick);
+ Srv->WriteOpers("*** WARNING! Failed oper attempt by %s!%s@%s!", user->nick, user->ident, user->host);
+ ServerInstance->Log(DEFAULT,"OPER: Failed oper attempt by %s!%s@%s: user, host or password did not match.", user->nick, user->ident, user->host);
+ }
+ }
+ else
+ {
+ /* This one shouldn't happen, the query failed for some reason.
+ * We have to fail the /oper request and give them the same error
+ * as above.
+ */
+ ServerInstance->Log(DEBUG, "Query failed: %s", res->error.Str());
+
+ user->WriteServ( "491 %s :Invalid oper credentials", user->nick);
+ Srv->WriteOpers("*** WARNING! Failed oper attempt by %s!%s@%s! (SQL query failed: %s)", user->nick, user->ident, user->host, res->error.Str());
+ ServerInstance->Log(DEFAULT,"OPER: Failed oper attempt by %s!%s@%s: user, host or password did not match.", user->nick, user->ident, user->host);