summaryrefslogtreecommitdiffstats
path: root/postfix-model.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2009-08-12 08:33:03 +0000
committerTed Trask <ttrask01@yahoo.com>2009-08-12 08:33:03 +0000
commit7ae059ecfd9ade1215046bc20a1b2eb7de2328b5 (patch)
tree7455b89521007ddb8c1acd8d53cc8c349262683a /postfix-model.lua
parent083ad8d884ca4f67eea16cb1e446b8698c503d8f (diff)
downloadacf-postfix-7ae059ecfd9ade1215046bc20a1b2eb7de2328b5.tar.bz2
acf-postfix-7ae059ecfd9ade1215046bc20a1b2eb7de2328b5.tar.xz
Removed duplicate aliases file and .db files from list, bumped to 0.2.2v0.2.2
Diffstat (limited to 'postfix-model.lua')
-rw-r--r--postfix-model.lua12
1 files changed, 10 insertions, 2 deletions
diff --git a/postfix-model.lua b/postfix-model.lua
index f05fa40..32eb2ce 100644
--- a/postfix-model.lua
+++ b/postfix-model.lua
@@ -50,8 +50,14 @@ end
local function geteditablefilelist()
local listed_files = fs.find_files_as_array("[^%.].*", baseurl)
- table.insert(listed_files, aliasesfile)
- return listed_files
+ -- remove .db files
+ local result = {}
+ for i,name in ipairs(listed_files) do
+ if not string.find(name, "%.db$") then
+ result[#result+1] = name
+ end
+ end
+ return result
end
function getfilelist()
@@ -90,6 +96,8 @@ function createfile(newfile)
if validator.is_valid_filename(path, baseurl) then
if posix.stat(path) then
newfile.value.filename.errtxt = "File already exists"
+ elseif string.find(path, "%.db$") then
+ newfile.value.filename.errtxt = "Cannot create .db files"
else
fs.create_file(path)
newfile.errtxt = nil