mirror of
https://github.com/anope/anope.git
synced 2026-07-04 18:33:12 +02:00
Add m_sql_authentication to allow authenticating users against an external SQL database
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user