From 16019c9827e087e86b6dd14f613e2e046bb2f57b Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 12 Sep 2012 21:10:02 -0400 Subject: Add m_sql_authentication to allow authenticating users against an external SQL database --- data/modules.example.conf | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'data') diff --git a/data/modules.example.conf b/data/modules.example.conf index d4d86c0ba..2742ef3b0 100644 --- a/data/modules.example.conf +++ b/data/modules.example.conf @@ -339,6 +339,43 @@ proxyscan reason = "You have an open proxy running on your host (%t:%i:%p)" } +/* + * m_sql_authentication + * + * This module allows authenticating users against an external SQL database using a custom + * query. + */ +#module { name = "m_sql_authentication" } +m_sql_authentication +{ + /* SQL engine to use. Should be configured elsewhere with m_mysql, m_sqlite, etc. */ + engine = "mysql/main" + + /* Query to execute to authenticate. A non empty result from this query is considered a success, + * and the user will be authenticated. + * + * @a@ is replaced with the user's account name + * @p@ is replaced with the user's password + * @n@ is replaced with the user's nickname + * @i@ is replaced with the user's IP + * + * Furthermore, if a field named email is returned from this query the user's email is + * set to its value. + */ + query = "SELECT `email_addr` AS `email` FROM `my_users` WHERE `username` = @u@ AND `password` = MD5(CONCAT('salt', @p@))" + + /* + * Enable to have this module disable /nickserv register. + */ + disable_ns_register = false + + /* + * The reason to give the users who try to /ns register if + * disable_ns_register is enabled. + */ + #disable_reason = "To register on this network visit http://some.misconfigured.site/register" +} + /* * m_sqlite * -- cgit