diff options
-rw-r--r-- | database/sqlite/edb-sqlite.c | 8 | ||||
-rw-r--r-- | database/sqlite/sql-schema-delta-2.sql | 1 | ||||
-rw-r--r-- | database/sqlite/sql-schema.sql | 1 |
3 files changed, 9 insertions, 1 deletions
diff --git a/database/sqlite/edb-sqlite.c b/database/sqlite/edb-sqlite.c index d544a8c..b35d00d 100644 --- a/database/sqlite/edb-sqlite.c +++ b/database/sqlite/edb-sqlite.c @@ -1288,11 +1288,17 @@ eurephiaVALUES *eDBget_plugins(eurephiaCTX *ctx, const char *plgtype) { DEBUG(ctx, 20, "Function call eDBget_plugins(ctx, '%s')", plgtype); + /* Format of the plug-in information: [<dso-filename>]<config string> */ + res = sqlite_query(ctx, - "SELECT plgid, plgdsofile" + "SELECT plgid, " + "CASE WHEN plgconfig IS NULL" + " THEN '[' || plgdsofile || ']'" + " ELSE '[' || plgdsofile || ']' || plgconfig END" " FROM eurephia_plugins" " WHERE plgenabled = 't' " " AND plgtype = '%q'", plgtype); + if( sqlite_query_status(res) == dbSUCCESS ) { ret = eCreate_value_space(ctx, 21); for( i = 0; i < sqlite_get_numtuples(res); i++ ) { diff --git a/database/sqlite/sql-schema-delta-2.sql b/database/sqlite/sql-schema-delta-2.sql index f767a5d..b21899d 100644 --- a/database/sqlite/sql-schema-delta-2.sql +++ b/database/sqlite/sql-schema-delta-2.sql @@ -28,6 +28,7 @@ CREATE TABLE eurephia_plugins ( plgname varchar(32) NOT NULL, -- short name of the plug-in module plgtype varchar(16) NOT NULL, -- plug-in type (auth, firewall, etc) plgdsofile text NOT NULL, -- full path to the plug-in DSO file + plgconfig text , -- Optional config data for the plug-in plgenabled boolean NOT NULL, -- Enable/disable the plug-in plgid integer PRIMARY KEY AUTOINCREMENT ); diff --git a/database/sqlite/sql-schema.sql b/database/sqlite/sql-schema.sql index 2e21605..899c95b 100644 --- a/database/sqlite/sql-schema.sql +++ b/database/sqlite/sql-schema.sql @@ -25,6 +25,7 @@ CREATE TABLE eurephia_plugins ( plgname varchar(32) NOT NULL, -- short name of the plug-in module plgtype varchar(16) NOT NULL, -- plug-in type (auth, firewall, etc) plgdsofile text NOT NULL, -- full path to the plug-in DSO file + plgconfig text , -- Optional config data for the plug-in plgenabled boolean NOT NULL, -- Enable/disable the plug-in plgid integer PRIMARY KEY AUTOINCREMENT ); |