summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Mason <ms13sp@gmail.com>2008-03-18 20:32:12 +0000
committerMike Mason <ms13sp@gmail.com>2008-03-18 20:32:12 +0000
commit1c9d4e2f55b4a7110b43f2143af52dc07e47ab41 (patch)
tree01de7b37585b4f31ac5e525109219e9ea032d760
parent41fab5833057ce35305120bad9e94dc23166eaeb (diff)
downloadacf-core-1c9d4e2f55b4a7110b43f2143af52dc07e47ab41.tar.bz2
acf-core-1c9d4e2f55b4a7110b43f2143af52dc07e47ab41.tar.xz
Working fully except for one bug when you logout you get all the menus again.
git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@834 ab2d0c66-481e-0410-8bed-d214d4d58bed
-rw-r--r--app/acf_www-controller.lua16
1 files changed, 9 insertions, 7 deletions
diff --git a/app/acf_www-controller.lua b/app/acf_www-controller.lua
index 6dbc9e0..f6d2817 100644
--- a/app/acf_www-controller.lua
+++ b/app/acf_www-controller.lua
@@ -72,12 +72,13 @@ else
end
end
+ local temptab = {}
for a,b in pairs(sessiondata.menu.mainmenu) do
- if sessiondata.menu.mainmenu[a].match == "no" then
- sessiondata.menu.mainmenu[a] = nil
+ if sessiondata.menu.mainmenu[a].match ~= "no" then
+ temptab[#temptab +1 ] = sessiondata.menu.mainmenu[a]
end
end
-
+ sessiondata.menu.mainmenu = temptab
-- Debug: Timestamp on menu creation
sessiondata.menu.timestamp = {tab="Menu_created: " .. os.date(),action="Menu_created: " .. os.date(),}
end
@@ -109,7 +110,10 @@ mvc.on_load = function (self, parent)
if self.clientdata.sessionid == nil then
self.sessiondata.id = sessionlib.random_hash(512)
tempid = self.sessiondata.id
- build_menus(self)
+ if not (self.sessiondata.menu) then
+ build_menus(self)
+ end
+
else
local timestamp
tempid = self.clientdata.sessionid
@@ -125,9 +129,6 @@ mvc.on_load = function (self, parent)
else
-- FIXME: This is probably wrong place to generate the menus
- if not (self.sessiondata.menu) then
- build_menus(self)
- end
local now = os.time()
local minutes_ago = now - (sessionlib.minutes_expired_events * 60)
@@ -148,6 +149,7 @@ mvc.on_load = function (self, parent)
end
]]--
sessionlib.expired_events(self.conf.sessiondir,sessionlib.minutes_expired_events)
+ build_menus(self)
end
end
end