Comparison

mod_post_msg/mod_post_msg.lua @ 321:661f64627fed

mod_post_msg: Add compatibility with usermanager in 0.7
author Kim Alvefur <zash@zash.se>
date Thu, 27 Jan 2011 17:36:58 +0100
parent 320:8d4f3cd41f82
child 661:a6c8f252e5fa
comparison
equal deleted inserted replaced
320:8d4f3cd41f82 321:661f64627fed
21 r[ urldecode(k) ] = urldecode(v); 21 r[ urldecode(k) ] = urldecode(v);
22 return nil 22 return nil
23 end) 23 end)
24 return r 24 return r
25 end; 25 end;
26
27 --COMPAT 0.7
28 if not test_password then
29 local validate_credentials = require "core.usermanager".validate_credentials;
30 test_password = function(user, host, password)
31 return validate_credentials(host, user, password)
32 end
33 end
26 34
27 local function http_response(code, message, extra_headers) 35 local function http_response(code, message, extra_headers)
28 local response = { 36 local response = {
29 status = code .. " " .. message; 37 status = code .. " " .. message;
30 body = message .. "\n"; } 38 body = message .. "\n"; }