webmcp
view framework/env/param/get_all_cgi.lua @ 36:5380305a3d51
allow multiple arguments to trace.debug
you can now write trace.debug("bla", 2, ...)
you can now write trace.debug("bla", 2, ...)
| author | Daniel Poelzleithner <poelzi@poelzi.org> | 
|---|---|
| date | Sat Oct 09 00:57:26 2010 +0200 (2010-10-09) | 
| parents | 9fdfb27f8e67 | 
| children | 2f8d8edd1836 | 
 line source
     1 --[[--
     2 params =         -- table with all non-list parameters
     3 param.get_all_cgi()
     5 This function returns a table with all non-list GET/POST parameters (except internal parameters like "_webmcp_id").
     7 --]]--
     9 function param.get_all_cgi()
    10   local result = {}
    11   for key, value in pairs(cgi.params) do  -- TODO: exchanged params too?
    12     if
    13       (not string.match(key, "^_webmcp_")) and
    14       (not string.match(key, "%[%]$"))
    15     then
    16       result[key] = value
    17     end
    18   end
    19   return result
    20 end
