From f4559966aed8f81d115049007a41a931c77af14d Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Thu, 3 Oct 2013 23:50:18 +0000 Subject: Only load js libraries if not already loaded --- authenticator-freeswitch-vmail.lua | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) (limited to 'authenticator-freeswitch-vmail.lua') diff --git a/authenticator-freeswitch-vmail.lua b/authenticator-freeswitch-vmail.lua index 74065d9..38e6342 100644 --- a/authenticator-freeswitch-vmail.lua +++ b/authenticator-freeswitch-vmail.lua @@ -2,38 +2,21 @@ module (..., package.seeall) require("md5") -a = require("authenticator-plaintext") list_fields = function(self, tabl) - result = a.list_fields(self, tabl) - return result + return nil end read_field = function(self, tabl, field) - result = a.read_field(self, tabl, field) ---[[ - if tabl == authenticator.usertable and field == "" then - -- authenticator is reading all users - local vmcontroller = self:new("freeswitch-vmail/vmail") - local users = vmcontroller.model.list_passwords() - for i,val in ipairs(users.value) do - local string = md5.sumhexa(val.password)..":Voicemail User:/freeswitch-vmail/vmail/USER::/freeswitch-vmail/vmail/listmymessages" - result[#result+1] = { id=val.username, entry=string } - end - vmcontroller:destroy() - end ---]] - return result + return nil end delete_field = function(self, tabl, field) - result = a.delete_field(self, tabl, field) - return result + return false end write_entry = function(self, tabl, field, id, entry) - result = a.write_entry(self, tabl, field, id, entry) - return result + return false end read_entry = function(self, tabl, field, id) @@ -47,13 +30,9 @@ read_entry = function(self, tabl, field, id) end vmcontroller:destroy() end - if not result then - result = a.read_entry(self, tabl, field, id) - end return result end delete_entry = function (self, tabl, field, id) - result = a.delete_entry(self, tabl, field, id) - return result + return false end -- cgit v1.2.3