summaryrefslogtreecommitdiffstats
path: root/gnats-model.lua
diff options
context:
space:
mode:
authorMika Havela <mika.havela@gmail.com>2008-04-25 13:39:58 +0000
committerMika Havela <mika.havela@gmail.com>2008-04-25 13:39:58 +0000
commitb6269f672717c021e81da02e6332a06b6651612f (patch)
tree83def4abed77e05eb937e2c83606ad4cc7110e34 /gnats-model.lua
parent61f6393e8cc80635c33a7d77eb5b8208b768d4fa (diff)
downloadacf-gnats-b6269f672717c021e81da02e6332a06b6651612f.tar.bz2
acf-gnats-b6269f672717c021e81da02e6332a06b6651612f.tar.xz
Bugfix on SendBugreport.
Edit configurationfiles starts working. Started to work on EditPR (still not working). git-svn-id: svn://svn.alpinelinux.org/acf/gnats/trunk@1038 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'gnats-model.lua')
-rw-r--r--gnats-model.lua29
1 files changed, 12 insertions, 17 deletions
diff --git a/gnats-model.lua b/gnats-model.lua
index 28b9d9e..a39090c 100644
--- a/gnats-model.lua
+++ b/gnats-model.lua
@@ -7,9 +7,7 @@ require("date")
require("getopts")
require("format")
require("posix")
-require("daemoncontrol")
require("validator")
-require("socket")
require("processinfo")
-- Set variables
@@ -304,14 +302,6 @@ end
-- ################################################################################
-- PUBLIC FUNCTIONS
-function startstop_service ( self, action )
- local cmd = action.value
- local cmdresult,cmdmessage,cmderror,cmdaction = daemoncontrol.daemoncontrol(processname, cmd)
- action.descr=cmdmessage
- action.errtxt=cmderror
- return cmdresult,action
-end
-
function valid_filename(self, path)
local files = {}
recursedir(baseurl,files)
@@ -344,7 +334,7 @@ function getstatus()
status.configfiles.size = #status.configfiles.option
status.numbugs = cfe({ name="numbugs",
- label="Still not closed reports",
+ label="Number of open reports",
value=get_various_info(),
})
@@ -451,14 +441,19 @@ function get_filedetails(self,path)
return true, file
end
function update_filecontent (self, modifications,path)
- if not (valid_filename(self,path)) then
- return false, {['errtxt'] = "Not a valid filename!"}
+ if not (fs.is_file(path)) then
+ return false, "Not a filename"
end
- local file_result,err = fs.write_file(path, format.dostounix(modifications))
- if (err) and (#err > 0) then
- return false, err
+ if (valid_filename(self,path)) then
+ local file_result,err = fs.write_file(path, format.dostounix(modifications))
+ if (err) and (#err > 0) then
+ return false, err
+ end
+ return true
+ else
+ return false, "Not a valid filename!"
end
- return true, file_result
+ return false, "Something went wrong!"
end
function sendbug (self, message)