diff options
author | David Sommerseth <dazo@users.sourceforge.net> | 2013-03-04 11:57:32 +0100 |
---|---|---|
committer | David Sommerseth <dazo@users.sourceforge.net> | 2013-03-04 11:57:32 +0100 |
commit | e121092323ad2b3e0966da4f12b1636458715efb (patch) | |
tree | 7aaa79dcc5c664d460afbb74a8f592ab488497c1 /database | |
parent | 5da59efc978fce7b4da71dc967a22647721f78af (diff) | |
download | eurephia-e121092323ad2b3e0966da4f12b1636458715efb.tar.gz eurephia-e121092323ad2b3e0966da4f12b1636458715efb.tar.xz eurephia-e121092323ad2b3e0966da4f12b1636458715efb.zip |
sqlite: Modified eDBget_plugins() to support the new interface for plug-in init
This is needed to provide config data to a configured plug-in when it is loaded
and initialised.
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Diffstat (limited to 'database')
-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 ); |