diff options
-rw-r--r-- | extras/m_sqloper.mssql.sql | 1 | ||||
-rw-r--r-- | extras/m_sqloper.mysql.sql | 19 | ||||
-rw-r--r-- | extras/m_sqloper.postgresql.sql | 8 | ||||
-rw-r--r-- | extras/m_sqloper.sqlite3.sql | 4 | ||||
-rw-r--r-- | src/modules/m_sqloper.cpp | 2 |
5 files changed, 8 insertions, 26 deletions
diff --git a/extras/m_sqloper.mssql.sql b/extras/m_sqloper.mssql.sql index 5056e12e9..7580a4391 100644 --- a/extras/m_sqloper.mssql.sql +++ b/extras/m_sqloper.mssql.sql @@ -4,5 +4,6 @@ CREATE TABLE [dbo].[ircd_opers] ( [password] varchar(255) NULL,
[hostname] varchar(255) NULL,
[type] varchar(255) NULL,
+ [active] bit NOT NULL DEFAULT 1,
PRIMARY KEY CLUSTERED ([id])
)
diff --git a/extras/m_sqloper.mysql.sql b/extras/m_sqloper.mysql.sql index 293a2aa70..f43495806 100644 --- a/extras/m_sqloper.mysql.sql +++ b/extras/m_sqloper.mysql.sql @@ -1,24 +1,9 @@ --- MySQL dump 9.11 --- --- Host: localhost Database: brain --- ------------------------------------------------------ --- Server version 4.0.20 - --- --- Table structure for table `ircd_opers` --- - CREATE TABLE ircd_opers ( id bigint(20) NOT NULL auto_increment, username text, password text, hostname text, type text, + active tinyint(1) NOT NULL DEFAULT 1, PRIMARY KEY (id) -) TYPE=MyISAM; - --- --- Dumping data for table `ircd_opers` --- - - +) ENGINE=MyISAM; diff --git a/extras/m_sqloper.postgresql.sql b/extras/m_sqloper.postgresql.sql index fd640949f..4244abc22 100644 --- a/extras/m_sqloper.postgresql.sql +++ b/extras/m_sqloper.postgresql.sql @@ -1,14 +1,10 @@ --- --- PostgreSQL database dump --- - CREATE TABLE ircd_opers ( id serial NOT NULL, username text, "password" text, hostname text, - "type" text + "type" text, + active boolean NOT NULL DEFAULT 1 ); ALTER TABLE ONLY ircd_opers ADD CONSTRAINT ircd_opers_pkey PRIMARY KEY (id); - diff --git a/extras/m_sqloper.sqlite3.sql b/extras/m_sqloper.sqlite3.sql index 1bb2937b8..1c607e664 100644 --- a/extras/m_sqloper.sqlite3.sql +++ b/extras/m_sqloper.sqlite3.sql @@ -3,5 +3,5 @@ id integer primary key, username text, password text, hostname text, -type text); - +type text, +active integer NOT NULL DEFAULT 1); diff --git a/src/modules/m_sqloper.cpp b/src/modules/m_sqloper.cpp index bc46bd7e7..b5f0d6c47 100644 --- a/src/modules/m_sqloper.cpp +++ b/src/modules/m_sqloper.cpp @@ -122,7 +122,7 @@ public: SQL.SetProvider("SQL/" + dbid); hashtype = tag->getString("hash"); - query = tag->getString("query", "SELECT hostname as host, type FROM ircd_opers WHERE username='$username' AND password='$password'"); + query = tag->getString("query", "SELECT hostname as host, type FROM ircd_opers WHERE username='$username' AND password='$password' AND active=1;"); } ModResult OnPreCommand(std::string &command, std::vector<std::string> ¶meters, LocalUser *user, bool validated, const std::string &original_line) CXX11_OVERRIDE |