The "sqlauth" Module


This module allows connecting users to be authenticated against an arbitrary SQL table.


To load this module use the following <module> tag:

<module name="">


The <sqlauth> tag defines settings about how the sqlauth module should behave. This tag can only be defined once.

Name Type Default Value Description
allowpattern Text None If defined then a glob pattern for nicknames that are exempted from the authentication requirement.
dbid Text None Required! The name of the database connection to execute the query against.
killreason Text None Required! The message to kill users that fail to authenticate with.
query Text None Required! The SQL query to authenticate users with. If this query returns one or more rows it is considered a success otherwise it is considered a failure.
verbose Boolean No Whether to log failed authentications to snomask a (local) and snomask A (remote).

The query field can contain any of the following template variables:

Variable Description
$gecos The real name (gecos) of the connecting user.
$host The real hostname of the connecting user.
$ident The username (ident) of the connecting user.
$ip The IP address of the connecting user.
$md5pass An MD5 hash of the password sent with /PASS by the connecting user (requires the md5 module).
$nick The nickname of the connecting user.
$pass The password sent with /PASS by the connecting user.
$server The name of the server the connecting user connected to.
$sha256pass A SHA-256 hash of the password sent with /PASS by the connecting user (requires the sha256 module).
$uuid The UUID of the connecting user.
Example Usage
<sqlauth allowpattern="Guest*"
         killreason="Access denied"
         query="SELECT * FROM users WHERE name='$nick' AND password='$sha256pass' LIMIT 1"

Special Notes

The following SQL modules are included with InspIRCd:

Engine Module Description
mysql mysql Queries a MySQL database.
pgsql pgsql Queries a PostgreSQL database.
sqlite3 sqlite3 Queries an SQLite database.