- hashymodules::iterator x = hashers.find(hashtype);
- if (x == hashers.end())
- return false;
-
- /* Reset hash module first back to MD5 standard state */
- HashResetRequest(this, x->second).Send();
- /* Make an MD5 hash of the password for using in the query */
- std::string md5_pass_hash = HashSumRequest(this, x->second, password.c_str()).Send();
-
- /* We generate our own sum here because some database providers (e.g. SQLite) dont have a builtin md5/sha256 function,
- * also hashing it in the module and only passing a remote query containing a hash is more secure.
- */
- SQLrequest req = SQLrequest(this, target, databaseid,
- SQLquery("SELECT username, password, hostname, type FROM ircd_opers WHERE username = '?' AND password='?'") % username % md5_pass_hash);
-
- if (req.Send())
- {
- /* When we get the query response from the service provider we will be given an ID to play with,
- * just an ID number which is unique to this query. We need a way of associating that ID with a User
- * so we insert it into a map mapping the IDs to users.
- * Thankfully m_sqlutils provides this, it will associate a ID with a user or channel, and if the user quits it removes the
- * association. This means that if the user quits during a query we will just get a failed lookup from m_sqlutils - telling
- * us to discard the query.
- */
- AssociateUser(this, SQLutils, req.id, user).Send();
-
- saved_user.set(user, username);
- saved_pass.set(user, password);
-
- return true;
- }
- else
- {
- return false;
- }
+ std::vector<std::string> params;
+ params.push_back(username);
+ params.push_back(password);
+ oper_command->Handle(params, user);