summaryrefslogtreecommitdiffstats
path: root/lbu-model.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lbu-model.lua')
-rw-r--r--lbu-model.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/lbu-model.lua b/lbu-model.lua
index e06add2..271a238 100644
--- a/lbu-model.lua
+++ b/lbu-model.lua
@@ -78,7 +78,7 @@ local function validateconfig(config)
break
end
end
-
+
config.value.DEFAULT_CIPHER.errtxt = "Invalid Cipher"
for i,cipher in ipairs(config.value.DEFAULT_CIPHER.option) do
if cipher == config.value.DEFAULT_CIPHER.value then
@@ -86,7 +86,7 @@ local function validateconfig(config)
break
end
end
-
+
if config.value.PASSWORD.value == "" and config.value.ENCRYPTION.value then
config.value.PASSWORD.errtxt = "Encryption without password is not allowed!\nDeactivate password protection or configure a password!"
end
@@ -144,7 +144,7 @@ local function validatefilecontent (filedetails)
local config = mymodule.getconfig(nil, clientdata)
local errors = {}
for name,value in pairs(config.value) do
- if value.errtxt then
+ if value.errtxt then
errors[#errors+1] = value.errtxt
end
end
@@ -193,7 +193,7 @@ function mymodule.getstatus ()
status["DEFAULT_CIPHER"] = config.value.DEFAULT_CIPHER
status["DEFAULT_CIPHER"].seq=4
end
-
+
return cfe({ type="group", value=status, label="LBU Status" })
end
@@ -259,10 +259,10 @@ end
function mymodule.setconfig (self, config)
validateconfig(config)
-
+
if not config.errtxt then
local content = (fs.read_file(configfile) or "").."\n"
-
+
-- LBU_MEDIA, ENCRYPTION, DEFAULT_CIPHER, PASSWORD
content = replacestring(content, "[^\n%w]*LBU_MEDIA=[^\n]*\n", "LBU_MEDIA="..config.value.LBU_MEDIA.value.."\n")
local newstring = "ENCRYPTION=$DEFAULT_CIPHER\n"
@@ -370,7 +370,7 @@ function mymodule.commit(self, input)
if input.value.delete.value then flag=flag.." -d" end
input.descr, input.errtxt = modelfunctions.run_executable({"lbu", "commit", flag}, true)
end
-
+
return input
end