Maybe as a start I could get some feedback on the SQL statements I'm using below?
checkPass: The result should be a table with exactly one line containing at least the password of the user. If the result table is empty or contains more than one row, access will be denied. The module access the password as ‘pass’ so an alias might be necessary.
$conf['auth']['mysql']['checkPass'] =
"SELECT USER_PASSWORD AS pass
FROM ubbt_USERS
WHERE USER_LOGIN_NAME='%{user}'
AND USER_PASSWORD=MD5('%{pass}')";
getUserInfo: This statement should return a table with exact one row containing information about one user. The fields needed are:
‘pass’ containing the encrypted or clear text password
‘name’ the user’s full name (I'm using the Display Name)
‘mail’ the user’s email address
$conf['auth']['mysql']['getUserInfo'] =
"SELECT USER_PASSWORD AS pass,
USER_DISPLAY_NAME AS name,
USER_REGISTRATION_EMAIL AS mail
FROM ubbt_USERS
WHERE USER_LOGIN_NAME='%{user}'";
getGroups: This statement is used to get all groups a user is member of. The result should be a table containing all groups the given user is member of. The module accesses the group name as ‘group’ so an alias might be necessary.
$conf['auth']['mysql']['getGroups'] =
"SELECT GROUP_NAME AS `group`
FROM ubbt_GROUPS g, ubbt_USERS u, ubbt_USER_GROUPS ug
WHERE u.USER_ID = ug.USER_ID
AND g.GROUP_ID = ug.GROUP_ID
AND u.USER_LOGIN_NAME='%{user}'";