equal
deleted
inserted
replaced
97 elseif script_type == "generic" then |
97 elseif script_type == "generic" then |
98 query = query..'\n'; |
98 query = query..'\n'; |
99 end |
99 end |
100 |
100 |
101 local response, err = send_query(query); |
101 local response, err = send_query(query); |
|
102 module:log("debug", "input: %q, output %q", query, response); |
102 if not response then |
103 if not response then |
103 log("warn", "Error while waiting for result from auth process: %s", err or "unknown error"); |
104 log("warn", "Error while waiting for result from auth process: %s", err or "unknown error"); |
104 elseif (script_type == "ejabberd" and response == "\0\2\0\0") or |
105 elseif (script_type == "ejabberd" and response == "\0\2\0\0") or |
105 (script_type == "generic" and response:gsub("\r?\n$", "") == "0") then |
106 (script_type == "generic" and response:gsub("\r?\n$", "") == "0") then |
106 return nil, "not-authorized"; |
107 return nil, "not-authorized"; |