summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-08 12:11:02 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-08 12:11:02 +0000
commit18afeadae4c6520388777fbd3d371402b5aeae9f (patch)
tree0ff2e93ff00eab44f616f1164f4e548d3f2e0c95 /src/modules
parent5c2954bf548130990a071017be6f7bbe739dc9cb (diff)
Changed m_sqlauth to allow more advanced encryption types
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3549 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/extra/m_sqlauth.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/modules/extra/m_sqlauth.cpp b/src/modules/extra/m_sqlauth.cpp
index 0f5fde5f3..6a760e198 100644
--- a/src/modules/extra/m_sqlauth.cpp
+++ b/src/modules/extra/m_sqlauth.cpp
@@ -64,6 +64,10 @@ class ModuleSQLAuth : public Module
// define, but leave blank if no encryption is to be used.
WallOperFail = Conf->ReadFlag("sqlauth","verbose",0); // set to 1 if failed connects should be reported to operators
allowpattern = Conf->ReadValue("sqlauth","allowpattern",0); // allow nicks matching the pattern without requiring auth
+ if (encryption.find("(") == std::string::npos)
+ {
+ encryption.append("(");
+ }
delete Conf;
SQLModule = Srv->FindModule("m_sql.so");
if (!SQLModule)
@@ -126,7 +130,7 @@ class ModuleSQLAuth : public Module
password = temp;
// Create a request containing the SQL query and send it to m_sql.so
- std::string querystr("SELECT * FROM "+usertable+" WHERE "+userfield+"='"+username+"' AND "+passfield+"="+encryption+"('"+password+"')");
+ std::string querystr("SELECT * FROM "+usertable+" WHERE "+userfield+"='"+username+"' AND "+passfield+"="+encryption+"'"+password+"')");
Srv->Log(DEBUG, "m_sqlauth.so: Query: " + querystr);