summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-09-12 21:10:02 -0400
committerAdam <Adam@anope.org>2012-09-12 21:10:02 -0400
commit16019c9827e087e86b6dd14f613e2e046bb2f57b (patch)
tree578d849996ec774cda2f2d7d2317c3b151f12479 /data
parentf391100586375fdf83c3e73cab173f08125920f3 (diff)
Add m_sql_authentication to allow authenticating users against an external SQL database
Diffstat (limited to 'data')
-rw-r--r--data/modules.example.conf37
1 files changed, 37 insertions, 0 deletions
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
@@ -340,6 +340,43 @@ proxyscan
}
/*
+ * 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
*
* This module allows other modules to use SQLite.