webmcp
changeset 2:72860d232f32 v1.0.2
Version 1.0.2
Fixed bug with explicit garbage collection (requests > 256kB caused an error)
Views prefixed with an underscore can't be called externally
ui.paginate now displays the last page, if the selected page number is too high.
Fixed bug with explicit garbage collection (requests > 256kB caused an error)
Views prefixed with an underscore can't be called externally
ui.paginate now displays the last page, if the selected page number is too high.
author | jbe/bsw |
---|---|
date | Thu Dec 10 12:00:00 2009 +0100 (2009-12-10) |
parents | 985024b16520 |
children | 795b764629ca |
files | demo-app/config/demo.lua doc/autodoc-header.htmlpart framework/cgi-bin/webmcp.lua framework/env/ui/paginate.lua libraries/rocketcgi/rocketcgi.lua |
line diff
1.1 --- a/demo-app/config/demo.lua Tue Nov 17 12:00:00 2009 +0100 1.2 +++ b/demo-app/config/demo.lua Thu Dec 10 12:00:00 2009 +0100 1.3 @@ -45,3 +45,4 @@ 1.4 :optional_object_mode() 1.5 :exec() 1.6 end 1.7 +
2.1 --- a/doc/autodoc-header.htmlpart Tue Nov 17 12:00:00 2009 +0100 2.2 +++ b/doc/autodoc-header.htmlpart Thu Dec 10 12:00:00 2009 +0100 2.3 @@ -55,10 +55,10 @@ 2.4 color: #505050; 2.5 } 2.6 </style> 2.7 - <title>WebMCP 1.0.1 Documentation</title> 2.8 + <title>WebMCP 1.0.2 Documentation</title> 2.9 </head> 2.10 <body> 2.11 - <h1>WebMCP 1.0.1 Documentation</h1> 2.12 + <h1>WebMCP 1.0.2 Documentation</h1> 2.13 <p> 2.14 WebMCP is a completely new web development framework, and has not been extensively tested yet. The API might change at any time, but in future releases there will be a list of all changes, which break downward compatibility. 2.15 </p>
3.1 --- a/framework/cgi-bin/webmcp.lua Tue Nov 17 12:00:00 2009 +0100 3.2 +++ b/framework/cgi-bin/webmcp.lua Thu Dec 10 12:00:00 2009 +0100 3.3 @@ -1,6 +1,6 @@ 3.4 #!/usr/bin/env lua 3.5 3.6 -_WEBMCP_VERSION = "1.0.1" 3.7 +_WEBMCP_VERSION = "1.0.2" 3.8 3.9 -- include "../lib/" in search path for libraries 3.10 do 3.11 @@ -346,10 +346,14 @@ 3.12 end 3.13 3.14 if not request.get_redirect_data() then 3.15 + local view = request.get_view() 3.16 + if string.find(view, "^_") then 3.17 + error("Tried to call a private view (prefixed with underscore).") 3.18 + end 3.19 request.process_forward() 3.20 execute.filtered_view{ 3.21 module = request.get_module(), 3.22 - view = request.get_view(), 3.23 + view = view, 3.24 } 3.25 end 3.26
4.1 --- a/framework/env/ui/paginate.lua Tue Nov 17 12:00:00 2009 +0100 4.2 +++ b/framework/env/ui/paginate.lua Thu Dec 10 12:00:00 2009 +0100 4.3 @@ -25,6 +25,9 @@ 4.4 local count = count_selector:exec().count 4.5 local page_count = math.floor((count - 1) / per_page) + 1 4.6 local current_page = atom.integer:load(cgi.params[name]) or 1 4.7 + if current_page > page_count then 4.8 + current_page = page_count 4.9 + end 4.10 selector:limit(per_page) 4.11 selector:offset((current_page - 1) * per_page) 4.12 local id = param.get_id_cgi()
5.1 --- a/libraries/rocketcgi/rocketcgi.lua Tue Nov 17 12:00:00 2009 +0100 5.2 +++ b/libraries/rocketcgi/rocketcgi.lua Thu Dec 10 12:00:00 2009 +0100 5.3 @@ -1,25 +1,26 @@ 5.4 #!/usr/bin/env lua 5.5 5.6 -local assert = assert 5.7 -local error = error 5.8 -local getfenv = getfenv 5.9 -local getmetatable = getmetatable 5.10 -local ipairs = ipairs 5.11 -local next = next 5.12 -local pairs = pairs 5.13 -local pcall = pcall 5.14 -local print = print 5.15 -local rawequal = rawequal 5.16 -local rawget = rawget 5.17 -local rawset = rawset 5.18 -local select = select 5.19 -local setfenv = setfenv 5.20 -local setmetatable = setmetatable 5.21 -local tonumber = tonumber 5.22 -local tostring = tostring 5.23 -local type = type 5.24 -local unpack = unpack 5.25 -local xpcall = xpcall 5.26 +local assert = assert 5.27 +local collectgarbage = collectgarbage 5.28 +local error = error 5.29 +local getfenv = getfenv 5.30 +local getmetatable = getmetatable 5.31 +local ipairs = ipairs 5.32 +local next = next 5.33 +local pairs = pairs 5.34 +local pcall = pcall 5.35 +local print = print 5.36 +local rawequal = rawequal 5.37 +local rawget = rawget 5.38 +local rawset = rawset 5.39 +local select = select 5.40 +local setfenv = setfenv 5.41 +local setmetatable = setmetatable 5.42 +local tonumber = tonumber 5.43 +local tostring = tostring 5.44 +local type = type 5.45 +local unpack = unpack 5.46 +local xpcall = xpcall 5.47 5.48 local io = io 5.49 local math = math