I have seperate User and Domains tables. When a domain is marked as not active I want all the users for that domain to fail auth.
This query works fine.
password_query = \
SELECT CONCAT("5500") AS gid, CONCAT("5500") AS uid, \
CONCAT("/mail/dir/",'%d','/','%n') AS home,Email as User, Password as password \
FROM users_table WHERE Email='%u' AND active=1;
Now I'm trying to add a check to see if the domain is marked at active. Adding SELECT DomainName FROM domains_table UNION
. (Which I will extend later) But when I add this, the query fails. The table names and headers are correct. Why would this line cause the query to fail?
In addition, are conditional statements supported here? I would like to add IF (domain is active) THEN (pass query)
password_query = \
SELECT DomainName FROM domains_table \
UNION SELECT CONCAT("5500") AS gid, CONCAT("5500") AS uid, \
CONCAT("/mail/dir/",'%d','/','%n') AS home,Email as User, Password as password \
FROM users_table WHERE Email='%u' AND active=1;
Each query seems to only work if they return gid, uid, home, user & password variables.
Thanks